pkg

package
v4.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package pkg provides the v4 multisig-pool protocol for Bitcoin SV transactions.

Index

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 GetAddressFromPublicKey(pubKey *ec.PublicKey, isMain bool) (*script.Address, error)

func Lock

func Lock(pubKeys []*ec.PublicKey, m int) (*script.Script, error)

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 MultiSig

type MultiSig = libs.MultiSig

func Unlock

func Unlock(privKeys []*ec.PrivateKey, pubKeys []*ec.PublicKey, m int, sigHashFlag *sighash.Flag) (*MultiSig, error)

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

type UTXO

type UTXO = libs.UTXO

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL