Struct elements_miniscript::descriptor::Tr  
source · pub struct Tr<Pk: MiniscriptKey, Ext: Extension = NoExt> { /* private fields */ }Expand description
A taproot descriptor
Implementations§
source§impl<Pk: MiniscriptKey, Ext: Extension> Tr<Pk, Ext>
 
impl<Pk: MiniscriptKey, Ext: Extension> Tr<Pk, Ext>
sourcepub fn internal_key(&self) -> &Pk
 
pub fn internal_key(&self) -> &Pk
Obtain the internal key of Tr descriptor
sourcepub fn iter_scripts(&self) -> TapTreeIter<'_, Pk, Ext>
 
pub fn iter_scripts(&self) -> TapTreeIter<'_, Pk, Ext>
Iterate over all scripts in merkle tree. If there is no script path, the iterator
yields None
sourcepub fn spend_info(&self) -> Arc<TaprootSpendInfo>where
    Pk: ToPublicKey,
    Ext: ParseableExt,
 
pub fn spend_info(&self) -> Arc<TaprootSpendInfo>where Pk: ToPublicKey, Ext: ParseableExt,
Compute the TaprootSpendInfo associated with this descriptor if spend data is None.
If spend data is already computed (i.e it is not None), this does not recompute it.
TaprootSpendInfo is only required for spending via the script paths.
sourcepub fn sanity_check(&self) -> Result<(), Error>
 
pub fn sanity_check(&self) -> Result<(), Error>
Checks whether the descriptor is safe.
sourcepub fn max_weight_to_satisfy(&self) -> Result<usize, Error>
 
pub fn max_weight_to_satisfy(&self) -> Result<usize, Error>
Computes an upper bound on the difference between a non-satisfied
TxIn’s segwit_weight and a satisfied TxIn’s segwit_weight
Assumes all Schnorr signatures are 66 bytes, including push opcode and sighash suffix.
Errors
When the descriptor is impossible to safisfy (ex: sh(OP_FALSE)).
sourcepub fn max_satisfaction_weight(&self) -> Result<usize, Error>
 👎Deprecated: use max_weight_to_satisfy instead
pub fn max_satisfaction_weight(&self) -> Result<usize, Error>
Computes an upper bound on the weight of a satisfying witness to the transaction.
Assumes all ec-signatures are 73 bytes, including push opcode and sighash suffix. Includes the weight of the VarInts encoding the scriptSig and witness stack length.
Errors
When the descriptor is impossible to safisfy (ex: sh(OP_FALSE)).
source§impl<Pk: MiniscriptKey + ToPublicKey, Ext: ParseableExt> Tr<Pk, Ext>
 
impl<Pk: MiniscriptKey + ToPublicKey, Ext: ParseableExt> Tr<Pk, Ext>
sourcepub fn script_pubkey(&self) -> Script
 
pub fn script_pubkey(&self) -> Script
Obtains the corresponding script pubkey for this descriptor.
sourcepub fn address(
    &self,
    blinder: Option<PublicKey>,
    params: &'static AddressParams
) -> Address
 
pub fn address( &self, blinder: Option<PublicKey>, params: &'static AddressParams ) -> Address
Obtains the corresponding address for this descriptor.
sourcepub fn get_satisfaction<S>(
    &self,
    satisfier: S
) -> Result<(Vec<Vec<u8>>, Script), Error>where
    S: Satisfier<Pk>,
 
pub fn get_satisfaction<S>( &self, satisfier: S ) -> Result<(Vec<Vec<u8>>, Script), Error>where S: Satisfier<Pk>,
Returns satisfying non-malleable witness and scriptSig with minimum
weight to spend an output controlled by the given descriptor if it is
possible to construct one using the satisfier.
sourcepub fn get_satisfaction_mall<S>(
    &self,
    satisfier: S
) -> Result<(Vec<Vec<u8>>, Script), Error>where
    S: Satisfier<Pk>,
 
pub fn get_satisfaction_mall<S>( &self, satisfier: S ) -> Result<(Vec<Vec<u8>>, Script), Error>where S: Satisfier<Pk>,
Returns satisfying, possibly malleable, witness and scriptSig with
minimum weight to spend an output controlled by the given descriptor if
it is possible to construct one using the satisfier.
Trait Implementations§
source§impl<Pk: MiniscriptKey, Ext: Extension> ForEachKey<Pk> for Tr<Pk, Ext>
 
impl<Pk: MiniscriptKey, Ext: Extension> ForEachKey<Pk> for Tr<Pk, Ext>
source§impl<Pk: MiniscriptKey, Ext: Extension> From<Tr<Pk, NoExt>> for Descriptor<Pk, Ext>
 
impl<Pk: MiniscriptKey, Ext: Extension> From<Tr<Pk, NoExt>> for Descriptor<Pk, Ext>
source§impl<Pk, Ext> FromStr for Tr<Pk, Ext>where
    Pk: MiniscriptKey + FromStr,
    Pk::Sha256: FromStr,
    Pk::Hash256: FromStr,
    Pk::Ripemd160: FromStr,
    Pk::Hash160: FromStr,
    <Pk as FromStr>::Err: ToString,
    <<Pk as MiniscriptKey>::Sha256 as FromStr>::Err: ToString,
    <<Pk as MiniscriptKey>::Hash256 as FromStr>::Err: ToString,
    <<Pk as MiniscriptKey>::Ripemd160 as FromStr>::Err: ToString,
    <<Pk as MiniscriptKey>::Hash160 as FromStr>::Err: ToString,
    Ext: Extension,
 
impl<Pk, Ext> FromStr for Tr<Pk, Ext>where Pk: MiniscriptKey + FromStr, Pk::Sha256: FromStr, Pk::Hash256: FromStr, Pk::Ripemd160: FromStr, Pk::Hash160: FromStr, <Pk as FromStr>::Err: ToString, <<Pk as MiniscriptKey>::Sha256 as FromStr>::Err: ToString, <<Pk as MiniscriptKey>::Hash256 as FromStr>::Err: ToString, <<Pk as MiniscriptKey>::Ripemd160 as FromStr>::Err: ToString, <<Pk as MiniscriptKey>::Hash160 as FromStr>::Err: ToString, Ext: Extension,
source§impl<Pk, Ext> FromTree for Tr<Pk, Ext>where
    Pk: MiniscriptKey + FromStr,
    Pk::Sha256: FromStr,
    Pk::Hash256: FromStr,
    Pk::Ripemd160: FromStr,
    Pk::Hash160: FromStr,
    <Pk as FromStr>::Err: ToString,
    <<Pk as MiniscriptKey>::Sha256 as FromStr>::Err: ToString,
    <<Pk as MiniscriptKey>::Hash256 as FromStr>::Err: ToString,
    <<Pk as MiniscriptKey>::Ripemd160 as FromStr>::Err: ToString,
    <<Pk as MiniscriptKey>::Hash160 as FromStr>::Err: ToString,
    Ext: Extension,
 
impl<Pk, Ext> FromTree for Tr<Pk, Ext>where Pk: MiniscriptKey + FromStr, Pk::Sha256: FromStr, Pk::Hash256: FromStr, Pk::Ripemd160: FromStr, Pk::Hash160: FromStr, <Pk as FromStr>::Err: ToString, <<Pk as MiniscriptKey>::Sha256 as FromStr>::Err: ToString, <<Pk as MiniscriptKey>::Hash256 as FromStr>::Err: ToString, <<Pk as MiniscriptKey>::Ripemd160 as FromStr>::Err: ToString, <<Pk as MiniscriptKey>::Hash160 as FromStr>::Err: ToString, Ext: Extension,
source§impl<Pk: MiniscriptKey, Ext: Extension> Ord for Tr<Pk, Ext>
 
impl<Pk: MiniscriptKey, Ext: Extension> Ord for Tr<Pk, Ext>
source§impl<Pk: MiniscriptKey, Ext: Extension> PartialEq<Tr<Pk, Ext>> for Tr<Pk, Ext>
 
impl<Pk: MiniscriptKey, Ext: Extension> PartialEq<Tr<Pk, Ext>> for Tr<Pk, Ext>
source§impl<Pk: MiniscriptKey, Ext: Extension> PartialOrd<Tr<Pk, Ext>> for Tr<Pk, Ext>
 
impl<Pk: MiniscriptKey, Ext: Extension> PartialOrd<Tr<Pk, Ext>> for Tr<Pk, Ext>
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 moresource§impl<PExt, QExt, Pk> TranslateExt<PExt, QExt> for Tr<Pk, PExt>where
    PExt: Extension + TranslateExt<PExt, QExt, Output = QExt>,
    QExt: Extension,
    Pk: MiniscriptKey,
 
impl<PExt, QExt, Pk> TranslateExt<PExt, QExt> for Tr<Pk, PExt>where PExt: Extension + TranslateExt<PExt, QExt, Output = QExt>, QExt: Extension, Pk: MiniscriptKey,
source§fn translate_ext<T, E>(&self, translator: &mut T) -> Result<Self::Output, E>where
    T: ExtTranslator<PExt, QExt, E>,
 
fn translate_ext<T, E>(&self, translator: &mut T) -> Result<Self::Output, E>where T: ExtTranslator<PExt, QExt, E>,
Translator.source§impl<P, Q, Ext> TranslatePk<P, Q> for Tr<P, Ext>where
    P: MiniscriptKey,
    Q: MiniscriptKey,
    Ext: Extension,
 
impl<P, Q, Ext> TranslatePk<P, Q> for Tr<P, Ext>where P: MiniscriptKey, Q: MiniscriptKey, Ext: Extension,
source§fn translate_pk<T, E>(&self, translate: &mut T) -> Result<Self::Output, E>where
    T: Translator<P, Q, E>,
 
fn translate_pk<T, E>(&self, translate: &mut T) -> Result<Self::Output, E>where T: Translator<P, Q, E>,
Translator.