ConstAdd BIP-32 derivation info to an input. Calls Go: psbt.Updater.AddInBip32Derivation() from btcutil/psbt.
Add a full previous transaction for a non-segwit input. Calls Go: psbt.Updater.AddInNonWitnessUtxo() from btcutil/psbt.
Add a P2SH redeem script to an input. Calls Go: psbt.Updater.AddInRedeemScript() from btcutil/psbt.
Set the sighash type for an input. Calls Go: psbt.Updater.AddInSighashType() from btcutil/psbt.
Add a witness script to an input. Calls Go: psbt.Updater.AddInWitnessScript() from btcutil/psbt.
Add a witness UTXO (value + pkScript) for a segwit input. Calls Go: psbt.Updater.AddInWitnessUtxo() from btcutil/psbt.
Add BIP-32 derivation info to an output. Calls Go: psbt.Updater.AddOutBip32Derivation() from btcutil/psbt.
Add a P2SH redeem script to an output. Calls Go: psbt.Updater.AddOutRedeemScript() from btcutil/psbt.
Add a witness script to an output. Calls Go: psbt.Updater.AddOutWitnessScript() from btcutil/psbt.
Return every unknown TLV entry from a PSBT, flattened across all three levels (global / input / output) into a single stream.
Create a new PSBT from inputs and outputs. Calls Go: psbt.New() from btcutil/psbt.
Array of { txid, vout, sequence? }.
Array of { value, script }.
Optionalversion: numberOptionallockTime: numberBase64-encoded PSBT.
Decode a base64-encoded PSBT and return structured info including all
per-input and per-output fields (partial sigs, BIP-32 derivation,
taproot fields, etc.) plus the unsigned transaction as unsignedTx.
Calls Go: psbt.NewFromRawBytes() from btcutil/psbt.
Decode the 78-byte PSBT-format byte slice back to the base58
xpub/xprv string. Wraps psbt.DecodeExtendedKey.
Encode a PSBT (the encode-input shape PsbtData) back to a
base64-encoded PSBT string. Round-trips with decode(). Empty PSBTs
(zero inputs / zero outputs) are accepted — useful when building
one from scratch.
Calls Go: btcpsbt.Packet.Serialize() via direct construction.
Encode an xpub/xprv string to the 78-byte PSBT-format byte slice
(i.e. the checksum-less base58 decoding) used in the
PSBT_GLOBAL_XPUB key. Wraps psbt.EncodeExtendedKey.
Extract the final signed transaction from a completed PSBT. Calls Go: psbt.Extract() from btcutil/psbt.
Finalize a specific input (create final scriptSig/witness). Calls Go: psbt.Finalize() from btcutil/psbt.
Convert a base64 PSBT to raw bytes. Calls Go: psbt.Packet.Serialize() from btcutil/psbt.
Create a new PSBT from an unsigned raw transaction. Calls Go: psbt.NewFromUnsignedTx() from btcutil/psbt.
Get the transaction fee in satoshis (requires UTXO info on all inputs). Calls Go: psbt.Packet.GetTxFee() from btcutil/psbt.
Sort inputs and outputs in-place per BIP-69. Calls Go: psbt.InPlaceSort() from btcutil/psbt.
Verify all inputs have UTXO information attached. Throws on error. Calls Go: psbt.InputsReadyToSign() from btcutil/psbt.
Check if all inputs are finalized and ready to extract. Calls Go: psbt.Packet.IsComplete() from btcutil/psbt.
Try to finalize a specific input. Returns whether it was finalized. Calls Go: psbt.MaybeFinalize() from btcutil/psbt.
Try to finalize all inputs at once. Calls Go: psbt.MaybeFinalizeAll() from btcutil/psbt.
Validate PSBT format per BIP-174. Throws on error. Calls Go: psbt.Packet.SanityCheck() from btcutil/psbt.
Attach a signature to an input. Returns the updated PSBT and the sign outcome (0=success, 1=already finalized, -1=invalid). Calls Go: psbt.Updater.Sign() from btcutil/psbt.
Sum all input UTXO values in satoshis. Calls Go: psbt.SumUtxoInputValues() from btcutil/psbt.
Convert raw PSBT bytes to base64. Calls Go: psbt.Packet.B64Encode() from btcutil/psbt.
Partially Signed Bitcoin Transaction (BIP-174) utilities.
Mutating functions (addIn*, addOut*, sign, finalize*) take a base64 PSBT, apply the change, and return a new base64 PSBT. Chain calls to build up a transaction: