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_el_pref(&self, f: &mut Formatter<'_, '_>) -> Result
pub fn to_string_no_el_pref(&self, f: &mut Formatter<'_, '_>) -> Result
Get the descriptor without the checksum and no el prefix
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) -> 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 script pubkey for this descriptor.
Sourcepub fn inner_script(&self) -> Script
pub fn inner_script(&self) -> Script
Obtains the underlying miniscript for this descriptor.
Sourcepub fn ecdsa_sighash_script_code(&self) -> Script
pub fn ecdsa_sighash_script_code(&self) -> Script
Obtains the pre bip-340 signature script code 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> 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, Ext: Extension> From<Wpkh<Pk>> for Descriptor<Pk, Ext>
impl<Pk: MiniscriptKey, Ext: Extension> From<Wpkh<Pk>> for Descriptor<Pk, Ext>
Source§impl<Pk> FromStr for Wpkh<Pk>where
Pk: FromStrKey,
impl<Pk> FromStr for Wpkh<Pk>where
Pk: FromStrKey,
Source§impl<Pk> FromTree for Wpkh<Pk>where
Pk: FromStrKey,
impl<Pk> FromTree for Wpkh<Pk>where
Pk: FromStrKey,
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: PartialOrd + MiniscriptKey> PartialOrd for Wpkh<Pk>
impl<Pk: PartialOrd + MiniscriptKey> PartialOrd for Wpkh<Pk>
Source§impl<P: MiniscriptKey, Q: MiniscriptKey> TranslatePk<P, Q> for Wpkh<P>
impl<P: MiniscriptKey, Q: MiniscriptKey> TranslatePk<P, Q> for Wpkh<P>
Source§fn translate_pk<T, E>(&self, t: &mut T) -> Result<Self::Output, E>where
T: Translator<P, Q, E>,
fn translate_pk<T, E>(&self, t: &mut T) -> Result<Self::Output, E>where
T: Translator<P, Q, E>,
Translator
.