Documentation
¶
Overview ¶
Package pkg provides the v4 multisig-pool protocol for Bitcoin SV transactions.
Index ¶
- Constants
- Variables
- func BuildArbitratedPoolFinalState(input ArbitratedPoolStateInput) (*tx.Transaction, error)
- func BuildArbitratedPoolLock(roles ArbitratedPoolRoles) (*script.Script, error)
- func BuildArbitratedPoolOpeningState(fundingTxID []byte, poolOutputIndex uint32, poolAmount uint64, ...) (*tx.Transaction, error)
- func BuildArbitratedPoolState(input ArbitratedPoolStateInput) (*tx.Transaction, error)
- func BuildTwoPartyPoolLock(roles TwoPartyPoolRoles) (*script.Script, error)
- func BuildTwoPartyPoolOpeningState(fundingTxID []byte, poolOutputIndex uint32, poolAmount uint64, ...) (*tx.Transaction, error)
- func BuildTwoPartyPoolState(input TwoPartyPoolStateInput) (*tx.Transaction, error)
- func GetAddressFromPublicKey(pubKey *ec.PublicKey, isMain bool) (*script.Address, error)
- func Lock(pubKeys []*ec.PublicKey, m int) (*script.Script, error)
- func MergeArbitratedPoolBuyerArbiterSignatures(state *tx.Transaction, poolAmount uint64, roles ArbitratedPoolRoles, ...) (*tx.Transaction, error)
- func MergeArbitratedPoolBuyerSellerSignatures(state *tx.Transaction, poolAmount uint64, roles ArbitratedPoolRoles, ...) (*tx.Transaction, error)
- func MergeArbitratedPoolSellerArbiterSignatures(state *tx.Transaction, poolAmount uint64, roles ArbitratedPoolRoles, ...) (*tx.Transaction, error)
- func MergeTwoPartyPoolBuyerSellerSignatures(state *tx.Transaction, poolAmount uint64, roles TwoPartyPoolRoles, ...) (*tx.Transaction, error)
- func SignArbitratedPoolAsArbiter(state *tx.Transaction, poolAmount uint64, roles ArbitratedPoolRoles, ...) ([]byte, error)
- func SignArbitratedPoolAsBuyer(state *tx.Transaction, poolAmount uint64, roles ArbitratedPoolRoles, ...) ([]byte, error)
- func SignArbitratedPoolAsSeller(state *tx.Transaction, poolAmount uint64, roles ArbitratedPoolRoles, ...) ([]byte, error)
- func SignTwoPartyPoolAsBuyer(state *tx.Transaction, poolAmount uint64, roles TwoPartyPoolRoles, ...) ([]byte, error)
- func SignTwoPartyPoolAsSeller(state *tx.Transaction, poolAmount uint64, roles TwoPartyPoolRoles, ...) ([]byte, error)
- func VerifyArbitratedPoolArbiterSignature(state *tx.Transaction, poolAmount uint64, roles ArbitratedPoolRoles, ...) (bool, error)
- func VerifyArbitratedPoolBuyerSignature(state *tx.Transaction, poolAmount uint64, roles ArbitratedPoolRoles, ...) (bool, error)
- func VerifyArbitratedPoolSellerSignature(state *tx.Transaction, poolAmount uint64, roles ArbitratedPoolRoles, ...) (bool, error)
- func VerifyTwoPartyPoolBuyerSignature(state *tx.Transaction, poolAmount uint64, roles TwoPartyPoolRoles, ...) (bool, error)
- func VerifyTwoPartyPoolSellerSignature(state *tx.Transaction, poolAmount uint64, roles TwoPartyPoolRoles, ...) (bool, error)
- type ArbitratedPoolFundingResult
- type ArbitratedPoolRoles
- type ArbitratedPoolStateInput
- type FeeSatPerKB
- type MultiSig
- type TwoPartyPoolFundingResult
- type TwoPartyPoolRoles
- type TwoPartyPoolStateInput
- type UTXO
Constants ¶
View Source
const ( ProtocolVersion = versioninfo.ProtocolVersion ReleaseVersion = versioninfo.GoReleaseVersion Version = ProtocolVersion Protocol = versioninfo.Protocol )
Variables ¶
View Source
var ErrInvalidPublicKeys = libs.ErrInvalidPublicKeys
Functions ¶
func BuildArbitratedPoolFinalState ¶
func BuildArbitratedPoolFinalState(input ArbitratedPoolStateInput) (*tx.Transaction, error)
func BuildArbitratedPoolLock ¶
func BuildArbitratedPoolLock(roles ArbitratedPoolRoles) (*script.Script, error)
func BuildArbitratedPoolOpeningState ¶
func BuildArbitratedPoolOpeningState(fundingTxID []byte, poolOutputIndex uint32, poolAmount uint64, roles ArbitratedPoolRoles, lockTime uint32, rate FeeSatPerKB) (*tx.Transaction, error)
func BuildArbitratedPoolState ¶
func BuildArbitratedPoolState(input ArbitratedPoolStateInput) (*tx.Transaction, error)
func BuildTwoPartyPoolLock ¶
func BuildTwoPartyPoolLock(roles TwoPartyPoolRoles) (*script.Script, error)
func BuildTwoPartyPoolOpeningState ¶
func BuildTwoPartyPoolOpeningState(fundingTxID []byte, poolOutputIndex uint32, poolAmount uint64, roles TwoPartyPoolRoles, lockTime uint32, feeRate FeeSatPerKB) (*tx.Transaction, error)
func BuildTwoPartyPoolState ¶
func BuildTwoPartyPoolState(input TwoPartyPoolStateInput) (*tx.Transaction, error)
func GetAddressFromPublicKey ¶
func MergeArbitratedPoolBuyerArbiterSignatures ¶
func MergeArbitratedPoolBuyerArbiterSignatures(state *tx.Transaction, poolAmount uint64, roles ArbitratedPoolRoles, buyerSignature, arbiterSignature []byte) (*tx.Transaction, error)
func MergeArbitratedPoolBuyerSellerSignatures ¶
func MergeArbitratedPoolBuyerSellerSignatures(state *tx.Transaction, poolAmount uint64, roles ArbitratedPoolRoles, buyerSignature, sellerSignature []byte) (*tx.Transaction, error)
func MergeArbitratedPoolSellerArbiterSignatures ¶
func MergeArbitratedPoolSellerArbiterSignatures(state *tx.Transaction, poolAmount uint64, roles ArbitratedPoolRoles, sellerSignature, arbiterSignature []byte) (*tx.Transaction, error)
func MergeTwoPartyPoolBuyerSellerSignatures ¶
func MergeTwoPartyPoolBuyerSellerSignatures(state *tx.Transaction, poolAmount uint64, roles TwoPartyPoolRoles, buyerSignature, sellerSignature []byte) (*tx.Transaction, error)
func SignArbitratedPoolAsArbiter ¶
func SignArbitratedPoolAsArbiter(state *tx.Transaction, poolAmount uint64, roles ArbitratedPoolRoles, key *ec.PrivateKey) ([]byte, error)
func SignArbitratedPoolAsBuyer ¶
func SignArbitratedPoolAsBuyer(state *tx.Transaction, poolAmount uint64, roles ArbitratedPoolRoles, key *ec.PrivateKey) ([]byte, error)
func SignArbitratedPoolAsSeller ¶
func SignArbitratedPoolAsSeller(state *tx.Transaction, poolAmount uint64, roles ArbitratedPoolRoles, key *ec.PrivateKey) ([]byte, error)
func SignTwoPartyPoolAsBuyer ¶
func SignTwoPartyPoolAsBuyer(state *tx.Transaction, poolAmount uint64, roles TwoPartyPoolRoles, key *ec.PrivateKey) ([]byte, error)
func SignTwoPartyPoolAsSeller ¶
func SignTwoPartyPoolAsSeller(state *tx.Transaction, poolAmount uint64, roles TwoPartyPoolRoles, key *ec.PrivateKey) ([]byte, error)
func VerifyArbitratedPoolArbiterSignature ¶
func VerifyArbitratedPoolArbiterSignature(state *tx.Transaction, poolAmount uint64, roles ArbitratedPoolRoles, signature []byte) (bool, error)
func VerifyArbitratedPoolBuyerSignature ¶
func VerifyArbitratedPoolBuyerSignature(state *tx.Transaction, poolAmount uint64, roles ArbitratedPoolRoles, signature []byte) (bool, error)
func VerifyArbitratedPoolSellerSignature ¶
func VerifyArbitratedPoolSellerSignature(state *tx.Transaction, poolAmount uint64, roles ArbitratedPoolRoles, signature []byte) (bool, error)
func VerifyTwoPartyPoolBuyerSignature ¶
func VerifyTwoPartyPoolBuyerSignature(state *tx.Transaction, poolAmount uint64, roles TwoPartyPoolRoles, signature []byte) (bool, error)
func VerifyTwoPartyPoolSellerSignature ¶
func VerifyTwoPartyPoolSellerSignature(state *tx.Transaction, poolAmount uint64, roles TwoPartyPoolRoles, signature []byte) (bool, error)
Types ¶
type ArbitratedPoolFundingResult ¶
type ArbitratedPoolFundingResult = arbitrated.FundingTxResult
func BuildArbitratedPoolFundingTx ¶
func BuildArbitratedPoolFundingTx(utxos []UTXO, poolAmount uint64, buyerPrivateKey *ec.PrivateKey, roles ArbitratedPoolRoles, isMain bool, feeRate FeeSatPerKB) (*ArbitratedPoolFundingResult, error)
type ArbitratedPoolRoles ¶
type ArbitratedPoolRoles = arbitrated.ArbitratedPoolRoles
type ArbitratedPoolStateInput ¶
type ArbitratedPoolStateInput = arbitrated.StateInput
type FeeSatPerKB ¶
type FeeSatPerKB = arbitrated.FeeSatPerKB
type TwoPartyPoolFundingResult ¶
type TwoPartyPoolFundingResult = twoParty.FundingTxResult
func BuildTwoPartyPoolFundingTx ¶
func BuildTwoPartyPoolFundingTx(utxos []UTXO, poolAmount uint64, buyerPrivateKey *ec.PrivateKey, roles TwoPartyPoolRoles, isMain bool, feeRate float64) (*TwoPartyPoolFundingResult, error)
type TwoPartyPoolRoles ¶
type TwoPartyPoolRoles = twoParty.TwoPartyPoolRoles
type TwoPartyPoolStateInput ¶
type TwoPartyPoolStateInput = twoParty.StateInput
Click to show internal directories.
Click to hide internal directories.