Documentation
¶
Index ¶
- Constants
- func ExpirySpendWeight() int64
- func PayToWitnessTaprootScript(taprootKey *btcec.PublicKey) ([]byte, error)
- func ReservationScript(expiry uint32, serverKey, clientKey *btcec.PublicKey) ([]byte, error)
- func TaprootExpiryScript(expiry uint32, serverKey *btcec.PublicKey) (*txscript.TapLeaf, error)
- func TaprootKey(expiry uint32, serverKey, clientKey *btcec.PublicKey) (*musig2.AggregateKey, error)
Constants ¶
View Source
const ( // TaprootMultiSigWitnessSize evaluates to 66 bytes: // - num_witness_elements: 1 byte // - sig_varint_len: 1 byte // - <sig>: 64 bytes TaprootMultiSigWitnessSize = 1 + 1 + 64 // TaprootExpiryScriptSize evaluates to 39 bytes: // - OP_DATA: 1 byte (trader_key length) // - <trader_key>: 32 bytes // - OP_CHECKSIGVERIFY: 1 byte // - <reservation_expiry>: 4 bytes // - OP_CHECKLOCKTIMEVERIFY: 1 byte TaprootExpiryScriptSize = 1 + 32 + 1 + 4 + 1 // TaprootExpiryWitnessSize evaluates to 140 bytes: // - num_witness_elements: 1 byte // - trader_sig_varint_len: 1 byte (trader_sig length) // - <trader_sig>: 64 bytes // - witness_script_varint_len: 1 byte (script length) // - <witness_script>: 39 bytes // - control_block_varint_len: 1 byte (control block length) // - <control_block>: 33 bytes TaprootExpiryWitnessSize = 1 + 1 + 64 + 1 + TaprootExpiryScriptSize + 1 + 33 )
Variables ¶
This section is empty.
Functions ¶
func ExpirySpendWeight ¶
func ExpirySpendWeight() int64
ExpirySpendWeight returns the weight of the expiry path spend.
func PayToWitnessTaprootScript ¶
PayToWitnessTaprootScript creates a new script to pay to a version 1 (taproot) witness program.
func ReservationScript ¶
ReservationScript returns the tapscript pkscript for the given reservation parameters.
func TaprootExpiryScript ¶
TaprootExpiryScript returns the leaf script of the expiry script path.
<server_key> OP_CHECKSIGVERIFY <reservation_expiry> OP_CHECKLOCKTIMEVERIFY.
func TaprootKey ¶
func TaprootKey(expiry uint32, serverKey, clientKey *btcec.PublicKey) (*musig2.AggregateKey, error)
TaprootKey returns the aggregated MuSig2 combined key.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.