pub enum PreTaprootDescriptor<Pk: MiniscriptKey> {
Bare(Bare<Pk>),
Pkh(Pkh<Pk>),
Wpkh(Wpkh<Pk>),
Sh(Sh<Pk>),
Wsh(Wsh<Pk>),
}
Expand description
Script descriptor
Variants§
Bare(Bare<Pk>)
Bare descriptor
Pkh(Pkh<Pk>)
Pay-to-PubKey-Hash
Wpkh(Wpkh<Pk>)
Pay-to-Witness-PubKey-Hash
Sh(Sh<Pk>)
Pay-to-ScriptHash(includes nested wsh/wpkh/sorted multi)
Wsh(Wsh<Pk>)
Pay-to-Witness-ScriptHash with Segwitv0 context
Trait Implementations§
source§impl<Pk: Clone + MiniscriptKey> Clone for PreTaprootDescriptor<Pk>
impl<Pk: Clone + MiniscriptKey> Clone for PreTaprootDescriptor<Pk>
source§fn clone(&self) -> PreTaprootDescriptor<Pk>
fn clone(&self) -> PreTaprootDescriptor<Pk>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<Pk: MiniscriptKey> Debug for PreTaprootDescriptor<Pk>
impl<Pk: MiniscriptKey> Debug for PreTaprootDescriptor<Pk>
source§impl<Pk: MiniscriptKey> DescriptorTrait<Pk> for PreTaprootDescriptor<Pk>
impl<Pk: MiniscriptKey> DescriptorTrait<Pk> for PreTaprootDescriptor<Pk>
source§fn sanity_check(&self) -> Result<(), Error>
fn sanity_check(&self) -> Result<(), Error>
Whether the descriptor is safe Checks whether all the spend paths in the descriptor are possible on the bitcoin network under the current standardness and consensus rules Also checks whether the descriptor requires signauture on all spend paths And whether the script is malleable. In general, all the guarantees of miniscript hold only for safe scripts. All the analysis guarantees of miniscript only hold safe scripts. The signer may not be able to find satisfactions even if one exists
source§fn address(&self, network: Network) -> Result<Address, Error>where
Pk: ToPublicKey,
fn address(&self, network: Network) -> Result<Address, Error>where
Pk: ToPublicKey,
Computes the Bitcoin address of the descriptor, if one exists
source§fn script_pubkey(&self) -> Scriptwhere
Pk: ToPublicKey,
fn script_pubkey(&self) -> Scriptwhere
Pk: ToPublicKey,
Computes the scriptpubkey of the descriptor
source§fn unsigned_script_sig(&self) -> Scriptwhere
Pk: ToPublicKey,
fn unsigned_script_sig(&self) -> Scriptwhere
Pk: ToPublicKey,
Computes the scriptSig that will be in place for an unsigned input spending an output with this descriptor. For pre-segwit descriptors, which use the scriptSig for signatures, this returns the empty script.
This is used in Segwit transactions to produce an unsigned transaction whose txid will not change during signing (since only the witness data will change).
source§fn explicit_script(&self) -> Result<Script, Error>where
Pk: ToPublicKey,
fn explicit_script(&self) -> Result<Script, Error>where
Pk: ToPublicKey,
Computes the “witness script” of the descriptor, i.e. the underlying
script before any hashing is done. For Bare
, Pkh
and Wpkh
this
is the scriptPubkey; for ShWpkh
and Sh
this is the redeemScript;
for the others it is the witness script.
Errors:
- When the descriptor is Tr
source§fn get_satisfaction<S>(
&self,
satisfier: S
) -> Result<(Vec<Vec<u8>>, Script), Error>where
Pk: ToPublicKey,
S: Satisfier<Pk>,
fn get_satisfaction<S>(
&self,
satisfier: S
) -> Result<(Vec<Vec<u8>>, Script), Error>where
Pk: ToPublicKey,
S: Satisfier<Pk>,
Returns satisfying non-malleable witness and scriptSig to spend an output controlled by the given descriptor if it possible to construct one using the satisfier S.
source§fn get_satisfaction_mall<S>(
&self,
satisfier: S
) -> Result<(Vec<Vec<u8>>, Script), Error>where
Pk: ToPublicKey,
S: Satisfier<Pk>,
fn get_satisfaction_mall<S>(
&self,
satisfier: S
) -> Result<(Vec<Vec<u8>>, Script), Error>where
Pk: ToPublicKey,
S: Satisfier<Pk>,
Returns a possilbly mallable satisfying non-malleable witness and scriptSig to spend an output controlled by the given descriptor if it possible to construct one using the satisfier S.
source§fn max_satisfaction_weight(&self) -> Result<usize, Error>
fn max_satisfaction_weight(&self) -> Result<usize, Error>
Computes an upper bound on the weight of a satisfying witness to the transaction. Assumes all signatures are 73 bytes, including push opcode and sighash suffix. Includes the weight of the VarInts encoding the scriptSig and witness stack length.
source§fn script_code(&self) -> Result<Script, Error>where
Pk: ToPublicKey,
fn script_code(&self) -> Result<Script, Error>where
Pk: ToPublicKey,
Get the scriptCode
of a transaction output.
The scriptCode
is the Script of the previous transaction output being serialized in the
sighash when evaluating a CHECKSIG
& co. OP code.
Returns Error for Tr descriptors
source§impl<Pk: MiniscriptKey> Display for PreTaprootDescriptor<Pk>
impl<Pk: MiniscriptKey> Display for PreTaprootDescriptor<Pk>
source§impl<Pk> FromStr for PreTaprootDescriptor<Pk>
impl<Pk> FromStr for PreTaprootDescriptor<Pk>
source§impl<Pk> FromTree for PreTaprootDescriptor<Pk>
impl<Pk> FromTree for PreTaprootDescriptor<Pk>
source§impl<Pk: Hash + MiniscriptKey> Hash for PreTaprootDescriptor<Pk>
impl<Pk: Hash + MiniscriptKey> Hash for PreTaprootDescriptor<Pk>
source§impl<Pk: Ord + MiniscriptKey> Ord for PreTaprootDescriptor<Pk>
impl<Pk: Ord + MiniscriptKey> Ord for PreTaprootDescriptor<Pk>
source§fn cmp(&self, other: &PreTaprootDescriptor<Pk>) -> Ordering
fn cmp(&self, other: &PreTaprootDescriptor<Pk>) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl<Pk: PartialEq + MiniscriptKey> PartialEq for PreTaprootDescriptor<Pk>
impl<Pk: PartialEq + MiniscriptKey> PartialEq for PreTaprootDescriptor<Pk>
source§fn eq(&self, other: &PreTaprootDescriptor<Pk>) -> bool
fn eq(&self, other: &PreTaprootDescriptor<Pk>) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<Pk: PartialOrd + MiniscriptKey> PartialOrd for PreTaprootDescriptor<Pk>
impl<Pk: PartialOrd + MiniscriptKey> PartialOrd for PreTaprootDescriptor<Pk>
source§fn partial_cmp(&self, other: &PreTaprootDescriptor<Pk>) -> Option<Ordering>
fn partial_cmp(&self, other: &PreTaprootDescriptor<Pk>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more