sigil-bitcoin-tx
sigil bitcoin tx
(sigil bitcoin tx) — Bitcoin transaction structs and serialization
sighash-default
variableStandard Taproot `SIGHASH_DEFAULT` flag.
sighash-all
variableStandard Bitcoin `SIGHASH_ALL` flag.
outpoint
procedureTransaction outpoint identifying a previous output by txid and index.
outpoint?
procedureTest if a value is a `outpoint` struct.
outpoint-txid
procedureGet the `txid` field of a `outpoint` struct.
outpoint-index
procedureGet the `index` field of a `outpoint` struct.
txin
procedureTransaction input with previous output, scriptSig, sequence, and witness.
txin?
procedureTest if a value is a `txin` struct.
txin-previous-output
procedureGet the `previous-output` field of a `txin` struct.
txin-script-sig
procedureGet the `script-sig` field of a `txin` struct.
txin-sequence
procedureGet the `sequence` field of a `txin` struct.
txin-witness
procedureGet the `witness` field of a `txin` struct.
txout
procedureTransaction output with satoshi value and scriptPubKey.
txout?
procedureTest if a value is a `txout` struct.
txout-value
procedureGet the `value` field of a `txout` struct.
txout-script-pubkey
procedureGet the `script-pubkey` field of a `txout` struct.
transaction
procedureBitcoin transaction record.
transaction?
procedureTest if a value is a `transaction` struct.
transaction-version
procedureGet the `version` field of a `transaction` struct.
transaction-inputs
procedureGet the `inputs` field of a `transaction` struct.
transaction-outputs
procedureGet the `outputs` field of a `transaction` struct.
transaction-lock-time
procedureGet the `lock-time` field of a `transaction` struct.
psbt-taproot-leaf-script
procedureBIP371 Taproot leaf script record for PSBT input maps.
psbt-taproot-leaf-script?
procedureTest if a value is a `psbt-taproot-leaf-script` struct.
psbt-taproot-leaf-script-control-block
procedureGet the `control-block` field of a `psbt-taproot-leaf-script` struct.
psbt-taproot-leaf-script-script
procedureGet the `script` field of a `psbt-taproot-leaf-script` struct.
psbt-taproot-leaf-script-leaf-version
procedureGet the `leaf-version` field of a `psbt-taproot-leaf-script` struct.
psbt-input
procedurePSBT input map subset supported by this package.
psbt-input?
procedureTest if a value is a `psbt-input` struct.
psbt-input-non-witness-utxo
procedureGet the `non-witness-utxo` field of a `psbt-input` struct.
psbt-input-witness-utxo
procedureGet the `witness-utxo` field of a `psbt-input` struct.
psbt-input-partial-sigs
procedureGet the `partial-sigs` field of a `psbt-input` struct.
psbt-input-sighash-type
procedureGet the `sighash-type` field of a `psbt-input` struct.
psbt-input-final-script-sig
procedureGet the `final-script-sig` field of a `psbt-input` struct.
psbt-input-final-script-witness
procedureGet the `final-script-witness` field of a `psbt-input` struct.
psbt-input-taproot-key-sig
procedureGet the `taproot-key-sig` field of a `psbt-input` struct.
psbt-input-taproot-script-sigs
procedureGet the `taproot-script-sigs` field of a `psbt-input` struct.
psbt-input-taproot-leaf-scripts
procedureGet the `taproot-leaf-scripts` field of a `psbt-input` struct.
psbt-input-redeem-script
procedureGet the `redeem-script` field of a `psbt-input` struct.
psbt-input-witness-script
procedureGet the `witness-script` field of a `psbt-input` struct.
psbt-input-bip32-derivations
procedureGet the `bip32-derivations` field of a `psbt-input` struct.
psbt-input-taproot-bip32-derivations
procedureGet the `taproot-bip32-derivations` field of a `psbt-input` struct.
psbt-input-unknowns
procedureGet the `unknowns` field of a `psbt-input` struct.
psbt-output
procedurePSBT output map subset supported by this package.
psbt-output?
procedureTest if a value is a `psbt-output` struct.
psbt-output-bip32-derivations
procedureGet the `bip32-derivations` field of a `psbt-output` struct.
psbt-output-taproot-bip32-derivations
procedureGet the `taproot-bip32-derivations` field of a `psbt-output` struct.
psbt-output-unknowns
procedureGet the `unknowns` field of a `psbt-output` struct.
psbt
procedurePartially Signed Bitcoin Transaction record.
psbt?
procedureTest if a value is a `psbt` struct.
psbt-unsigned-tx
procedureGet the `unsigned-tx` field of a `psbt` struct.
psbt-inputs
procedureGet the `inputs` field of a `psbt` struct.
psbt-outputs
procedureGet the `outputs` field of a `psbt` struct.
psbt-unknowns
procedureGet the `unknowns` field of a `psbt` struct.
compact-size-encode
procedureEncode a Bitcoin CompactSize unsigned integer.
compact-size-decode
procedureDecode a CompactSize integer from a bytevector. Returns `(value . next-offset)`.
transaction-has-witness?
procedureReturn true when any transaction input has witness stack items.
transaction-serialize
procedureSerialize a transaction to Bitcoin wire bytes. Includes witness data by default when present. Pass `#f` to omit witnesses for txid/base serialization.
transaction-parse
procedureParse Bitcoin wire bytes into a transaction record.
transaction-base-serialize
procedureSerialize a transaction without SegWit marker, flag, or witnesses.
transaction-txid
procedureReturn the transaction ID bytevector for a transaction.
transaction-wtxid
procedureReturn the witness transaction ID bytevector for a transaction.
transaction-sighash-legacy
procedureCompute a legacy pre-SegWit signature hash for one input. Currently supports `SIGHASH_ALL`.
transaction-sighash-segwit-v0
procedureCompute a BIP143 SegWit v0 signature hash for one input. Currently supports `SIGHASH_ALL`.
transaction-sighash-taproot-keypath
procedureCompute a BIP341 Taproot key-path signature hash. Supports key-path spends without annex or script-path extension for `SIGHASH_DEFAULT` and `SIGHASH_ALL`.
transaction-sighash-taproot-scriptpath
procedureCompute a BIP341/BIP342 Taproot script-path signature hash. Supports script-path spends without annex or non-default code separator for `SIGHASH_DEFAULT` and `SIGHASH_ALL`.
transaction-sign-p2pkh-input
procedureSign one legacy P2PKH input and return a transaction with scriptSig data.
transaction-sign-p2wpkh-input
procedureSign one P2WPKH input and return a transaction with witness data.
transaction-sign-p2tr-keypath-input
procedureSign one Taproot key-path input and return a transaction with witness data. This signs BIP86-style key-path spends without script tree commitments.
psbt-create
procedureCreate an empty PSBT from an unsigned transaction.
psbt-serialize
procedureSerialize a PSBT v0 record.
psbt-parse
procedureParse PSBT v0 bytes into a PSBT record.
psbt-annotate-input
procedureAttach BIP32 derivation metadata to a PSBT input after script matching.
psbt-annotate-input-scripts
procedureAttach redeem or witness scripts to a PSBT input map.
psbt-annotate-output
procedureAttach BIP32 derivation metadata to a PSBT output after script matching.
psbt-sign-p2pkh-input
procedureAdd a legacy P2PKH partial signature to a PSBT input. The input must contain the previous transaction as a non-witness UTXO.
psbt-sign-p2wpkh-input
procedureAdd a P2WPKH partial signature to a PSBT input. The input must contain a witness UTXO.
psbt-sign-p2wsh-input
procedureAdd a P2WSH partial signature for a single-key checksig witness script.
psbt-sign-p2tr-keypath-input
procedureAdd a Taproot key-path signature to a PSBT input.
psbt-sign-p2tr-scriptpath-input
procedureAdd a Taproot script-path signature for a single-key checksig leaf.
psbt-sign-standard-input
procedureSign a standard P2PKH, P2WPKH, or key-path P2TR PSBT input.
psbt-finalize-p2pkh-input
procedureFinalize a signed P2PKH PSBT input.
psbt-finalize-p2wpkh-input
procedureFinalize a signed P2WPKH PSBT input.
psbt-finalize-p2wsh-input
procedureFinalize a signed P2WSH single-key checksig PSBT input.
psbt-finalize-p2tr-keypath-input
procedureFinalize a signed Taproot key-path PSBT input.
psbt-finalize-p2tr-scriptpath-input
procedureFinalize a signed Taproot script-path PSBT input.
psbt-finalize-standard-input
procedureFinalize a standard P2PKH, P2WPKH, or key-path P2TR PSBT input.
psbt-extract-transaction
procedureExtract the final transaction from a fully-finalized PSBT.