pub struct TaprootInputFields {
pub tap_key_sig: Option<String>,
pub tap_script_sigs: Vec<(String, String)>,
pub tap_leaf_scripts: Vec<TapLeafScript>,
pub tap_bip32_derivations: Vec<TapBip32Derivation>,
pub tap_internal_key: Option<String>,
pub tap_merkle_root: Option<String>,
}Expand description
BIP 371 Taproot fields for a single PSBT input.
Fields§
§tap_key_sig: Option<String>Schnorr signature for key-path spending (PSBT_IN_TAP_KEY_SIG).
Must be 64 bytes (without sighash type) or 65 bytes (with sighash type).
tap_script_sigs: Vec<(String, String)>Script-path Schnorr signatures: (control_block_hex, sig_hex) pairs
(PSBT_IN_TAP_SCRIPT_SIG).
tap_leaf_scripts: Vec<TapLeafScript>Tapscript leaves in the spend path (PSBT_IN_TAP_LEAF_SCRIPT).
tap_bip32_derivations: Vec<TapBip32Derivation>BIP 32 derivation paths for Taproot keys
(PSBT_IN_TAP_BIP32_DERIVATION).
tap_internal_key: Option<String>x-only internal key (PSBT_IN_TAP_INTERNAL_KEY).
tap_merkle_root: Option<String>Taproot Merkle root (PSBT_IN_TAP_MERKLE_ROOT).
None indicates a key-path-only output (no script tree).
Implementations§
Source§impl TaprootInputFields
impl TaprootInputFields
Sourcepub fn with_key_sig(self, sig: String) -> Result<Self, TaprootPsbtError>
pub fn with_key_sig(self, sig: String) -> Result<Self, TaprootPsbtError>
Attach a key-path Schnorr signature.
The signature must be exactly 64 bytes (without explicit sighash type) or 65 bytes (with an appended sighash type byte).
Sourcepub fn with_internal_key(self, key: String) -> Result<Self, TaprootPsbtError>
pub fn with_internal_key(self, key: String) -> Result<Self, TaprootPsbtError>
Attach the x-only internal key.
Must be exactly 32 bytes (64 hex chars).
Sourcepub fn with_merkle_root(self, root: String) -> Result<Self, TaprootPsbtError>
pub fn with_merkle_root(self, root: String) -> Result<Self, TaprootPsbtError>
Attach the Taproot Merkle root.
Must be exactly 32 bytes (64 hex chars).
Sourcepub fn add_leaf_script(&mut self, leaf: TapLeafScript)
pub fn add_leaf_script(&mut self, leaf: TapLeafScript)
Append a Tapscript leaf.
Sourcepub fn add_bip32_derivation(&mut self, deriv: TapBip32Derivation)
pub fn add_bip32_derivation(&mut self, deriv: TapBip32Derivation)
Append a BIP 32 derivation record.
Sourcepub fn is_key_path_signed(&self) -> bool
pub fn is_key_path_signed(&self) -> bool
Returns true when a key-path Schnorr signature is present.
Sourcepub fn is_script_path_signed(&self) -> bool
pub fn is_script_path_signed(&self) -> bool
Returns true when at least one script-path signature is present.
Sourcepub fn is_finalized(&self) -> bool
pub fn is_finalized(&self) -> bool
Returns true when the input is finalised via either key-path or
script-path signing.
Sourcepub fn validate(&self) -> Result<(), TaprootPsbtError>
pub fn validate(&self) -> Result<(), TaprootPsbtError>
Validate all Taproot fields.
Trait Implementations§
Source§impl Clone for TaprootInputFields
impl Clone for TaprootInputFields
Source§fn clone(&self) -> TaprootInputFields
fn clone(&self) -> TaprootInputFields
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more