Documentation
¶
Index ¶
- Constants
- Variables
- func AnchorOutput() *wire.TxOut
- func ExtractWithAnchors(p *psbt.Packet) (*wire.MsgTx, error)
- func FindAnchorOutpoint(tx *wire.MsgTx) (*wire.OutPoint, error)
- func GetArkPsbtFields[T any](ptx *psbt.Packet, inputIndex int, coder ArkPsbtFieldCoder[T]) ([]T, error)
- func ParseCosignerKeysFromArkPsbt(ptx *psbt.Packet, inIndex int) ([]*btcec.PublicKey, error)
- func ParseCosignersToECPubKeys(fields []IndexedCosignerPublicKey) []*btcec.PublicKey
- func ReadTxWitness(witnessSerialized []byte) (wire.TxWitness, error)
- func SetArkPsbtField[T any](ptx *psbt.Packet, inputIndex int, coder ArkPsbtFieldCoder[T], value T) error
- type ArkPsbtFieldCoder
- type IndexedCosignerPublicKey
- type TapTree
Constants ¶
View Source
const ArkPsbtFieldKeyType = 222
Variables ¶
View Source
var ( ANCHOR_PKSCRIPT = []byte{ 0x51, 0x02, 0x4e, 0x73, } ANCHOR_VALUE = int64(0) )
View Source
var ( // ArkPsbtFieldTaprootTree reveals the taproot tree associated with an input ArkFieldTaprootTree = []byte("taptree") // ArkFieldTreeExpiry attach the CSV locktime expiring a tx input ArkFieldTreeExpiry = []byte("expiry") // ArkFieldCosigner attach a musig2 cosigner public key to an unsigned tx input ArkFieldCosigner = []byte("cosigner") // ArkFieldConditionWitness allows to set extra witness elements used to sign custom script inputs ArkFieldConditionWitness = []byte("condition") )
Functions ¶
func AnchorOutput ¶
func ExtractWithAnchors ¶
ExtractWithAnchors extracts the final witness and scriptSig from psbt fields and ignores anchor inputs without failing.
func GetArkPsbtFields ¶ added in v0.8.0
func GetArkPsbtFields[T any](ptx *psbt.Packet, inputIndex int, coder ArkPsbtFieldCoder[T]) ([]T, error)
GetArkPsbtFields gets all ark psbt fields of the given type from the given psbt at the given input index
func ParseCosignerKeysFromArkPsbt ¶ added in v0.8.0
func ParseCosignersToECPubKeys ¶ added in v0.8.0
func ParseCosignersToECPubKeys(fields []IndexedCosignerPublicKey) []*btcec.PublicKey
func SetArkPsbtField ¶ added in v0.8.0
func SetArkPsbtField[T any](ptx *psbt.Packet, inputIndex int, coder ArkPsbtFieldCoder[T], value T) error
SetArkPsbtField sets an ark psbt field on the given psbt at the given input index
Types ¶
type ArkPsbtFieldCoder ¶ added in v0.8.0
type ArkPsbtFieldCoder[T any] interface { Encode(T) (*psbt.Unknown, error) Decode(*psbt.Unknown) (*T, error) // nil means not found }
var ConditionWitnessField ArkPsbtFieldCoder[wire.TxWitness] = arkPsbtFieldCoderConditionWitness{}
var CosignerPublicKeyField ArkPsbtFieldCoder[IndexedCosignerPublicKey] = arkPsbtFieldCoderCosignerPublicKey{}
var VtxoTaprootTreeField ArkPsbtFieldCoder[TapTree] = arkPsbtFieldCoderTaprootTree{}
Singletons instances for each field type
var VtxoTreeExpiryField ArkPsbtFieldCoder[arklib.RelativeLocktime] = arkPsbtFieldCoderTreeExpiry{}
type IndexedCosignerPublicKey ¶ added in v0.8.0
IndexedCosignerPublicKey is a public key with its associated index. it is needed in ark cosigner public key field because we need to keep track of the order of the keys.
type TapTree ¶
type TapTree []string
TapTree is a wrapper around a list of tapscripts it is used to encode and decode the taproot tree in a way that is compatible with the PSBT_OUT_TAP_TREE field / BIP-371
func DecodeTapTree ¶
Click to show internal directories.
Click to hide internal directories.