Struct sapio_miniscript::descriptor::Pkh
source · [−]pub struct Pkh<Pk: MiniscriptKey> { /* private fields */ }
Expand description
A bare PkH descriptor at top level
Implementations
sourceimpl<Pk: MiniscriptKey> Pkh<Pk>
impl<Pk: MiniscriptKey> Pkh<Pk>
Trait Implementations
sourceimpl<Pk: Clone + MiniscriptKey> Clone for Pkh<Pk>
impl<Pk: Clone + MiniscriptKey> Clone for Pkh<Pk>
sourceimpl<Pk: MiniscriptKey> Debug for Pkh<Pk>
impl<Pk: MiniscriptKey> Debug for Pkh<Pk>
sourceimpl<Pk: MiniscriptKey> DescriptorTrait<Pk> for Pkh<Pk>
impl<Pk: MiniscriptKey> DescriptorTrait<Pk> for Pkh<Pk>
sourcefn 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 Read more
sourcefn 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 Some descriptors like pk() don’t have any address. Read more
sourcefn script_pubkey(&self) -> Script where
Pk: ToPublicKey,
fn script_pubkey(&self) -> Script where
Pk: ToPublicKey,
Computes the scriptpubkey of the descriptor
sourcefn unsigned_script_sig(&self) -> Script where
Pk: ToPublicKey,
fn unsigned_script_sig(&self) -> Script where
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. Read more
sourcefn explicit_script(&self) -> Script where
Pk: ToPublicKey,
fn explicit_script(&self) -> Script 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. Read more
sourcefn 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 witness and scriptSig to spend an output controlled by the given descriptor if it possible to construct one using the satisfier S. Read more
sourcefn 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. Returns Error when the descriptor is impossible to safisfy (ex: sh(OP_FALSE)) Read more
sourcefn script_code(&self) -> Script where
Pk: ToPublicKey,
fn script_code(&self) -> Script where
Pk: ToPublicKey,
Get the scriptCode
of a transaction output. Read more
sourceimpl<Pk: MiniscriptKey> Display for Pkh<Pk>
impl<Pk: MiniscriptKey> Display for Pkh<Pk>
sourceimpl<Pk: MiniscriptKey> ForEachKey<Pk> for Pkh<Pk>
impl<Pk: MiniscriptKey> ForEachKey<Pk> for Pkh<Pk>
sourceimpl<Pk> FromStr for Pkh<Pk> where
Pk: MiniscriptKey + FromStr,
Pk::Hash: FromStr,
<Pk as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Hash as FromStr>::Err: ToString,
impl<Pk> FromStr for Pkh<Pk> where
Pk: MiniscriptKey + FromStr,
Pk::Hash: FromStr,
<Pk as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Hash as FromStr>::Err: ToString,
sourceimpl<Pk> FromTree for Pkh<Pk> where
Pk: MiniscriptKey + FromStr,
Pk::Hash: FromStr,
<Pk as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Hash as FromStr>::Err: ToString,
impl<Pk> FromTree for Pkh<Pk> where
Pk: MiniscriptKey + FromStr,
Pk::Hash: FromStr,
<Pk as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Hash as FromStr>::Err: ToString,
sourceimpl<Pk: MiniscriptKey> Liftable<Pk> for Pkh<Pk>
impl<Pk: MiniscriptKey> Liftable<Pk> for Pkh<Pk>
sourceimpl<Pk: Ord + MiniscriptKey> Ord for Pkh<Pk>
impl<Pk: Ord + MiniscriptKey> Ord for Pkh<Pk>
sourceimpl<Pk: PartialOrd + MiniscriptKey> PartialOrd<Pkh<Pk>> for Pkh<Pk>
impl<Pk: PartialOrd + MiniscriptKey> PartialOrd<Pkh<Pk>> for Pkh<Pk>
sourcefn partial_cmp(&self, other: &Pkh<Pk>) -> Option<Ordering>
fn partial_cmp(&self, other: &Pkh<Pk>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<P: MiniscriptKey, Q: MiniscriptKey> TranslatePk<P, Q> for Pkh<P>
impl<P: MiniscriptKey, Q: MiniscriptKey> TranslatePk<P, Q> for Pkh<P>
sourcefn translate_pk<Fpk, Fpkh, E>(
&self,
translatefpk: Fpk,
_translatefpkh: Fpkh
) -> Result<Self::Output, E> where
Fpk: FnMut(&P) -> Result<Q, E>,
Fpkh: FnMut(&P::Hash) -> Result<Q::Hash, E>,
Q: MiniscriptKey,
fn translate_pk<Fpk, Fpkh, E>(
&self,
translatefpk: Fpk,
_translatefpkh: Fpkh
) -> Result<Self::Output, E> where
Fpk: FnMut(&P) -> Result<Q, E>,
Fpkh: FnMut(&P::Hash) -> Result<Q::Hash, E>,
Q: MiniscriptKey,
Translate a struct from one Generic to another where the translation for Pk is provided by translatefpk, and translation for PkH is provided by translatefpkh Read more
impl<Pk: Eq + MiniscriptKey> Eq for Pkh<Pk>
impl<Pk: MiniscriptKey> StructuralEq for Pkh<Pk>
impl<Pk: MiniscriptKey> StructuralPartialEq for Pkh<Pk>
Auto Trait Implementations
impl<Pk> RefUnwindSafe for Pkh<Pk> where
Pk: RefUnwindSafe,
impl<Pk> Send for Pkh<Pk> where
Pk: Send,
impl<Pk> Sync for Pkh<Pk> where
Pk: Sync,
impl<Pk> Unpin for Pkh<Pk> where
Pk: Unpin,
impl<Pk> UnwindSafe for Pkh<Pk> where
Pk: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<P, Q, T> TranslatePk1<P, Q> for T where
P: MiniscriptKey,
Q: MiniscriptKey<Hash = <P as MiniscriptKey>::Hash>,
T: TranslatePk<P, Q>,
impl<P, Q, T> TranslatePk1<P, Q> for T where
P: MiniscriptKey,
Q: MiniscriptKey<Hash = <P as MiniscriptKey>::Hash>,
T: TranslatePk<P, Q>,
sourcefn translate_pk1<Fpk, E>(
&self,
translatefpk: Fpk
) -> Result<<Self as TranslatePk<P, Q>>::Output, E> where
Fpk: FnMut(&P) -> Result<Q, E>,
fn translate_pk1<Fpk, E>(
&self,
translatefpk: Fpk
) -> Result<<Self as TranslatePk<P, Q>>::Output, E> where
Fpk: FnMut(&P) -> Result<Q, E>,
Translate a struct from one generic to another where the translation for Pk is provided by translatefpk Read more
sourcefn translate_pk1_infallible<Fpk: FnMut(&P) -> Q>(
&self,
translatefpk: Fpk
) -> <Self as TranslatePk<P, Q>>::Output
fn translate_pk1_infallible<Fpk: FnMut(&P) -> Q>(
&self,
translatefpk: Fpk
) -> <Self as TranslatePk<P, Q>>::Output
Translate a struct from one generic to another where the translation for Pk is provided by translatefpk Read more
sourceimpl<P, Q, T> TranslatePk2<P, Q> for T where
P: MiniscriptKey<Hash = P>,
Q: MiniscriptKey,
T: TranslatePk<P, Q>,
impl<P, Q, T> TranslatePk2<P, Q> for T where
P: MiniscriptKey<Hash = P>,
Q: MiniscriptKey,
T: TranslatePk<P, Q>,
sourcefn translate_pk2<Fpk: Fn(&P) -> Result<Q, E>, E>(
&self,
translatefpk: Fpk
) -> Result<<Self as TranslatePk<P, Q>>::Output, E>
fn translate_pk2<Fpk: Fn(&P) -> Result<Q, E>, E>(
&self,
translatefpk: Fpk
) -> Result<<Self as TranslatePk<P, Q>>::Output, E>
Translate a struct from one generic to another where the translation for Pk is provided by translatefpk Read more
sourcefn translate_pk2_infallible<Fpk: Fn(&P) -> Q>(
&self,
translatefpk: Fpk
) -> <Self as TranslatePk<P, Q>>::Output
fn translate_pk2_infallible<Fpk: Fn(&P) -> Q>(
&self,
translatefpk: Fpk
) -> <Self as TranslatePk<P, Q>>::Output
Translate a struct from one generic to another where the translation for Pk is provided by translatefpk Read more
sourceimpl<P, Q, T> TranslatePk3<P, Q> for T where
P: MiniscriptKey + ToPublicKey,
Q: MiniscriptKey<Hash = Hash>,
T: TranslatePk<P, Q>,
impl<P, Q, T> TranslatePk3<P, Q> for T where
P: MiniscriptKey + ToPublicKey,
Q: MiniscriptKey<Hash = Hash>,
T: TranslatePk<P, Q>,
sourcefn translate_pk3<Fpk, E>(
&self,
translatefpk: Fpk
) -> Result<<Self as TranslatePk<P, Q>>::Output, E> where
Fpk: FnMut(&P) -> Result<Q, E>,
fn translate_pk3<Fpk, E>(
&self,
translatefpk: Fpk
) -> Result<<Self as TranslatePk<P, Q>>::Output, E> where
Fpk: FnMut(&P) -> Result<Q, E>,
Translate a struct from one generic to another where the translation for Pk is provided by translatefpk Read more
sourcefn translate_pk3_infallible<Fpk: FnMut(&P) -> Q>(
&self,
translatefpk: Fpk
) -> <Self as TranslatePk<P, Q>>::Output
fn translate_pk3_infallible<Fpk: FnMut(&P) -> Q>(
&self,
translatefpk: Fpk
) -> <Self as TranslatePk<P, Q>>::Output
Translate a struct from one generic to another where the translation for Pk is provided by translatefpk Read more