Documentation ¶
Index ¶
- func Extract(p *Packet) (*wire.MsgTx, error)
- func MaybeFinalize(p *Packet, inIndex int) (bool, error)
- func MaybeFinalizeAll(p *Packet) error
- func SerializeBIP32Derivation(masterKeyFingerprint uint32, bip32Path []uint32) []byte
- func SumUtxoInputValues(packet *Packet) (int64, error)
- func TxOutsEqual(out1, out2 *wire.TxOut) bool
- func VerifyInputPrevOutpointsEqual(ins1, ins2 []*wire.TxIn) error
- func VerifyOutputsEqual(outs1, outs2 []*wire.TxOut) error
- type Bip32Derivation
- type Bip32Sorter
- type PInput
- type POutput
- type Packet
- type PartialSig
- type PartialSigSorter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MaybeFinalizeAll ¶
func SerializeBIP32Derivation ¶ added in v0.6.0
SerializeBIP32Derivation takes a master key fingerprint as defined in BIP32, along with a path specified as a list of uint32 values, and returns a bytestring specifying the derivation in the format required by BIP174: // master key fingerprint (4) || child index (4) || child index (4) || ....
func SumUtxoInputValues ¶ added in v0.5.0
SumUtxoInputValues tries to extract the sum of all inputs specified in the UTXO fields of the PSBT. An error is returned if an input is specified that does not contain any UTXO information.
func TxOutsEqual ¶ added in v0.5.0
TxOutsEqual returns true if two transaction outputs are equal.
func VerifyInputPrevOutpointsEqual ¶ added in v0.5.0
VerifyInputPrevOutpointsEqual verifies that the previous outpoints of the two slices of transaction inputs are deep equal to each other. We do the length check and manual loop to provide better error messages to the user than just returning "not equal".
func VerifyOutputsEqual ¶ added in v0.5.0
VerifyOutputsEqual verifies that the two slices of transaction outputs are deep equal to each other. We do the length check and manual loop to provide better error messages to the user than just returning "not equal".
Types ¶
type Bip32Derivation ¶ added in v0.6.0
type Bip32Derivation struct { // PubKey is the raw pubkey serialized in compressed format. PubKey []byte // MasterKeyFingerprint is the finger print of the master pubkey. MasterKeyFingerprint uint32 // Bip32Path is the BIP 32 path with child index as a distinct integer. Bip32Path []uint32 }
Bip32Derivation encapsulates the data for the input and output Bip32Derivation key-value fields.
TODO(roasbeef): use hdkeychain here instead?
type Bip32Sorter ¶ added in v0.6.0
type Bip32Sorter []*Bip32Derivation
Bip32Sorter implements sort.Interface for the Bip32Derivation struct.
func (Bip32Sorter) Len ¶ added in v0.6.0
func (s Bip32Sorter) Len() int
func (Bip32Sorter) Less ¶ added in v0.6.0
func (s Bip32Sorter) Less(i, j int) bool
func (Bip32Sorter) Swap ¶ added in v0.6.0
func (s Bip32Sorter) Swap(i, j int)
type PInput ¶
type PInput struct { WitnessUtxo *wire.TxOut NonWitnessUtxo *wire.MsgTx FinalScriptSig []byte FinalScriptWitness []byte Bip32Derivation []*Bip32Derivation SighashType txscript.SigHashType PartialSigs []*PartialSig RedeemScript []byte WitnessScript []byte }
type PartialSig ¶ added in v0.6.0
PartialSig encapsulate a (BTC public key, ECDSA signature) pair, note that the fields are stored as byte slices, not btcec.PublicKey or btcec.Signature (because manipulations will be with the former not the latter, here); compliance with consensus serialization is enforced with .checkValid()
type PartialSigSorter ¶ added in v0.6.0
type PartialSigSorter []*PartialSig
PartialSigSorter implements sort.Interface for PartialSig.
func (PartialSigSorter) Len ¶ added in v0.6.0
func (s PartialSigSorter) Len() int
func (PartialSigSorter) Less ¶ added in v0.6.0
func (s PartialSigSorter) Less(i, j int) bool
func (PartialSigSorter) Swap ¶ added in v0.6.0
func (s PartialSigSorter) Swap(i, j int)