Struct miniscript::descriptor::Wpkh
source · pub struct Wpkh<Pk: MiniscriptKey> { /* private fields */ }
Expand description
A bare Wpkh descriptor at top level
Implementations§
source§impl<Pk: MiniscriptKey> Wpkh<Pk>
impl<Pk: MiniscriptKey> Wpkh<Pk>
sourcepub fn into_inner(self) -> Pk
pub fn into_inner(self) -> Pk
Get the inner key
sourcepub fn to_string_no_checksum(&self) -> String
👎Deprecated since 8.0.0: use format!(“{:#}”) instead
pub fn to_string_no_checksum(&self) -> String
Get the descriptor without the checksum
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) -> usize
pub fn max_weight_to_satisfy(&self) -> usize
Computes an upper bound on the difference between a non-satisfied
TxIn
’s segwit_weight
and a satisfied TxIn
’s segwit_weight
Assumes all ec-signatures are 73 bytes, including push opcode and sighash suffix.
sourcepub fn max_satisfaction_weight(&self) -> usize
pub fn max_satisfaction_weight(&self) -> usize
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.
source§impl<Pk: MiniscriptKey + ToPublicKey> Wpkh<Pk>
impl<Pk: MiniscriptKey + ToPublicKey> Wpkh<Pk>
sourcepub fn script_pubkey(&self) -> ScriptBuf
pub fn script_pubkey(&self) -> ScriptBuf
Obtains the corresponding script pubkey for this descriptor.
sourcepub fn address(&self, network: Network) -> Address
pub fn address(&self, network: Network) -> Address
Obtains the corresponding script pubkey for this descriptor.
sourcepub fn inner_script(&self) -> ScriptBuf
pub fn inner_script(&self) -> ScriptBuf
Obtains the underlying miniscript for this descriptor.
sourcepub fn ecdsa_sighash_script_code(&self) -> ScriptBuf
pub fn ecdsa_sighash_script_code(&self) -> ScriptBuf
Obtains the pre bip-340 signature script code for this descriptor.
sourcepub fn get_satisfaction<S>(
&self,
satisfier: S
) -> Result<(Vec<Vec<u8>>, ScriptBuf), Error>where
S: Satisfier<Pk>,
pub fn get_satisfaction<S>( &self, satisfier: S ) -> Result<(Vec<Vec<u8>>, ScriptBuf), 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>>, ScriptBuf), Error>where
S: Satisfier<Pk>,
pub fn get_satisfaction_mall<S>( &self, satisfier: S ) -> Result<(Vec<Vec<u8>>, ScriptBuf), 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
.
source§impl Wpkh<DefiniteDescriptorKey>
impl Wpkh<DefiniteDescriptorKey>
sourcepub fn plan_satisfaction<P>(
&self,
provider: &P
) -> Satisfaction<Placeholder<DefiniteDescriptorKey>>where
P: AssetProvider<DefiniteDescriptorKey>,
pub fn plan_satisfaction<P>( &self, provider: &P ) -> Satisfaction<Placeholder<DefiniteDescriptorKey>>where P: AssetProvider<DefiniteDescriptorKey>,
Returns a plan if the provided assets are sufficient to produce a non-malleable satisfaction
sourcepub fn plan_satisfaction_mall<P>(
&self,
provider: &P
) -> Satisfaction<Placeholder<DefiniteDescriptorKey>>where
P: AssetProvider<DefiniteDescriptorKey>,
pub fn plan_satisfaction_mall<P>( &self, provider: &P ) -> Satisfaction<Placeholder<DefiniteDescriptorKey>>where P: AssetProvider<DefiniteDescriptorKey>,
Returns a plan if the provided assets are sufficient to produce a malleable satisfaction
Trait Implementations§
source§impl<Pk: MiniscriptKey> Debug for Wpkh<Pk>
impl<Pk: MiniscriptKey> Debug for Wpkh<Pk>
source§impl<Pk: MiniscriptKey> Display for Wpkh<Pk>
impl<Pk: MiniscriptKey> Display for Wpkh<Pk>
source§impl<Pk: MiniscriptKey> ForEachKey<Pk> for Wpkh<Pk>
impl<Pk: MiniscriptKey> ForEachKey<Pk> for Wpkh<Pk>
source§impl<Pk: MiniscriptKey> From<Wpkh<Pk>> for Descriptor<Pk>
impl<Pk: MiniscriptKey> From<Wpkh<Pk>> for Descriptor<Pk>
source§impl<Pk> FromStr for Wpkh<Pk>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,
impl<Pk> FromStr for Wpkh<Pk>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,
source§impl<Pk> FromTree for Wpkh<Pk>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,
impl<Pk> FromTree for Wpkh<Pk>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,
source§impl<Pk: MiniscriptKey> Liftable<Pk> for Wpkh<Pk>
impl<Pk: MiniscriptKey> Liftable<Pk> for Wpkh<Pk>
source§impl<Pk: Ord + MiniscriptKey> Ord for Wpkh<Pk>
impl<Pk: Ord + MiniscriptKey> Ord for Wpkh<Pk>
source§impl<Pk: PartialEq + MiniscriptKey> PartialEq<Wpkh<Pk>> for Wpkh<Pk>
impl<Pk: PartialEq + MiniscriptKey> PartialEq<Wpkh<Pk>> for Wpkh<Pk>
source§impl<Pk: PartialOrd + MiniscriptKey> PartialOrd<Wpkh<Pk>> for Wpkh<Pk>
impl<Pk: PartialOrd + MiniscriptKey> PartialOrd<Wpkh<Pk>> for Wpkh<Pk>
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<P, Q> TranslatePk<P, Q> for Wpkh<P>where
P: MiniscriptKey,
Q: MiniscriptKey,
impl<P, Q> TranslatePk<P, Q> for Wpkh<P>where P: MiniscriptKey, Q: MiniscriptKey,
source§fn translate_pk<T, E>(&self, t: &mut T) -> Result<Self::Output, TranslateErr<E>>where
T: Translator<P, Q, E>,
fn translate_pk<T, E>(&self, t: &mut T) -> Result<Self::Output, TranslateErr<E>>where T: Translator<P, Q, E>,
Translator
.