Struct psbt::Psbt

source · []
pub struct Psbt {
    pub unsigned_tx: Transaction,
    pub version: u32,
    pub xpub: BTreeMap<ExtendedPubKey, (Fingerprint, DerivationPath)>,
    pub proprietary: BTreeMap<ProprietaryKey<u8>, Vec<u8, Global>>,
    pub unknown: BTreeMap<Key, Vec<u8, Global>>,
    pub inputs: Vec<Input, Global>,
    pub outputs: Vec<Output, Global>,
}
Expand description

A Partially Signed Transaction.

Fields

unsigned_tx: Transaction

The unsigned transaction, scriptSigs and witnesses for each input must be empty.

version: u32

The version number of this PSBT. If omitted, the version number is 0.

xpub: BTreeMap<ExtendedPubKey, (Fingerprint, DerivationPath)>

A global map from extended public keys to the used key fingerprint and derivation path as defined by BIP 32

proprietary: BTreeMap<ProprietaryKey<u8>, Vec<u8, Global>>

Global proprietary key-value pairs.

unknown: BTreeMap<Key, Vec<u8, Global>>

Unknown global key-value pairs.

inputs: Vec<Input, Global>

The corresponding key-value map for each input in the unsigned transaction.

outputs: Vec<Output, Global>

The corresponding key-value map for each output in the unsigned transaction.

Implementations

Create a PartiallySignedTransaction from an unsigned transaction, error if not unsigned

Extract the Transaction from a PartiallySignedTransaction by filling in the available signature information in place.

Combines this PartiallySignedTransaction with other PSBT as described by BIP 174.

In accordance with BIP 174 this function is commutative i.e., A.combine(B) == B.combine(A)

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Decode an object with a well-defined format

Formats the value using the given formatter. Read more

Encode an object with a well-defined format. Returns the number of bytes written on success. Read more

Returns fee for a transaction, or returns error reporting resolver problem or wrong transaction structure Read more

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Finalize the psbt. This function takes in a mutable reference to psbt and populates the final_witness and final_scriptsig for all miniscript inputs. Read more

Same as PsbtExt::finalize_mut, but does not mutate the input psbt and returns a new psbt Read more

Same as PsbtExt::finalize_mut, but allows for malleable satisfactions

Same as PsbtExt::finalize, but allows for malleable satisfactions

Same as PsbtExt::finalize_mut, but only tries to finalize a single input leaving other inputs as is. Use this when not all of inputs that you are trying to satisfy are miniscripts Read more

Same as PsbtExt::finalize_inp_mut, but does not mutate the psbt and returns a new one Read more

Same as PsbtExt::finalize_inp_mut, but allows for malleable satisfactions

Same as PsbtExt::finalize_inp, but allows for malleable satisfactions

Psbt extractor as defined in BIP174 that takes in a psbt reference and outputs a extracted bitcoin::Transaction Also does the interpreter sanity check Will error if the final ScriptSig or final Witness are missing or the interpreter check fails. Read more

Update an psbt with the derived descriptor information. If the descriptor is Read more

Get the sighash message(data to sign) at input index idx based on the sighash flag specified in the Psbt sighash field. If the input sighash flag psbt field is None the SchnorrSighashType::Default is chosen for for taproot spends, otherwise EcdsaSignatureHashType::All is chosen. If the utxo at idx is a taproot output, returns a PsbtSighashMsg::TapSighash variant. If the utxo at idx is a pre-taproot output, returns a PsbtSighashMsg::EcdsaSighash variant. The tapleaf_hash parameter can be used to specify which tapleaf script hash has to be computed. If tapleaf_hash is None, and the output is taproot output, the key spend hash is computed. This parameter must be set to None while computing sighash for pre-taproot outputs. The function also updates the sighash cache with transaction computed during sighash computation of this input Read more

Signs all PSBT inputs using all known keys provided by SecretProvider. This includes signing legacy, segwit and taproot inputs; including inputs coming from P2PK, P2PKH, P2WPKH, P2WPKH-in-P2SH, bare scripts, P2SH, P2WSH, P2WSH-in-P2SH and P2TR outputs with both key- and script- spending paths. Supports all consensus sighash types. Read more

Returns transaction with empty scriptSig and witness

Returns transaction ID for an unsigned transaction. For SegWit transactions this is equal to the signed transaction id. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.