pub struct Pkh<Pk: MiniscriptKey> { /* private fields */ }Expand description
A bare PkH descriptor at top level
Implementations§
Source§impl<Pk: MiniscriptKey> Pkh<Pk>
impl<Pk: MiniscriptKey> Pkh<Pk>
Sourcepub fn into_inner(self) -> Pk
pub fn into_inner(self) -> Pk
Get the inner key
Sourcepub fn max_weight_to_satisfy(&self) -> Weight
pub fn max_weight_to_satisfy(&self) -> Weight
Computes an upper bound on the difference between a non-satisfied
TxIn’s segwit_weight and a satisfied TxIn’s segwit_weight
Since this method uses segwit_weight instead of legacy_weight,
if you want to include only legacy inputs in your transaction,
you should remove 1WU from each input’s max_weight_to_satisfy
for a more accurate estimate.
Assumes all ECDSA signatures are 73 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) -> usize
👎Deprecated since 10.0.0: Use max_weight_to_satisfy instead. The method to count bytes was redesigned and the results will differ from max_weight_to_satisfy. For more details check rust-bitcoin/rust-miniscript#476.
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> Pkh<Pk>
impl<Pk: MiniscriptKey + ToPublicKey> Pkh<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 Pkh<DefiniteDescriptorKey>
impl Pkh<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 Pkh<Pk>
impl<Pk: MiniscriptKey> Debug for Pkh<Pk>
Source§impl<Pk: MiniscriptKey> Display for Pkh<Pk>
impl<Pk: MiniscriptKey> Display for Pkh<Pk>
Source§impl<Pk: MiniscriptKey> ForEachKey<Pk> for Pkh<Pk>
impl<Pk: MiniscriptKey> ForEachKey<Pk> for Pkh<Pk>
Source§impl<Pk: MiniscriptKey> From<Pkh<Pk>> for Descriptor<Pk>
impl<Pk: MiniscriptKey> From<Pkh<Pk>> for Descriptor<Pk>
Source§impl<Pk: FromStrKey> FromStr for Pkh<Pk>
impl<Pk: FromStrKey> FromStr for Pkh<Pk>
Source§impl<Pk: FromStrKey> FromTree for Pkh<Pk>
impl<Pk: FromStrKey> FromTree for Pkh<Pk>
Source§impl<Pk: MiniscriptKey> Liftable<Pk> for Pkh<Pk>
impl<Pk: MiniscriptKey> Liftable<Pk> for Pkh<Pk>
Source§impl<Pk: Ord + MiniscriptKey> Ord for Pkh<Pk>
impl<Pk: Ord + MiniscriptKey> Ord for Pkh<Pk>
Source§impl<Pk: PartialOrd + MiniscriptKey> PartialOrd for Pkh<Pk>
impl<Pk: PartialOrd + MiniscriptKey> PartialOrd for Pkh<Pk>
Source§impl<P, Q> TranslatePk<P, Q> for Pkh<P>where
P: MiniscriptKey,
Q: MiniscriptKey,
impl<P, Q> TranslatePk<P, Q> for Pkh<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.