Struct elements_miniscript::descriptor::Sh [−][src]
pub struct Sh<Pk: MiniscriptKey> { /* fields omitted */ }
Expand description
A Legacy p2sh Descriptor
Implementations
Get the Inner
Create a new p2sh descriptor with the raw miniscript
Create a new p2sh sortedmulti descriptor with threshold k
and Vec of pks
.
Create a new p2sh wrapped wsh descriptor with the raw miniscript
Create a new p2sh wrapped wsh sortedmulti descriptor from threshold
k
and Vec of pks
Trait Implementations
impl<Pk: MiniscriptKey> DescriptorTrait<Pk> for Sh<Pk> where
Pk: FromStr,
Pk::Hash: FromStr,
<Pk as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Hash as FromStr>::Err: ToString,
impl<Pk: MiniscriptKey> DescriptorTrait<Pk> for Sh<Pk> where
Pk: FromStr,
Pk::Hash: FromStr,
<Pk as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Hash as FromStr>::Err: ToString,
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
fn address(&self, params: &'static AddressParams) -> Result<Address, Error> where
Pk: ToPublicKey,
fn address(&self, params: &'static AddressParams) -> 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
Computes the scriptpubkey of the descriptor
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
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
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
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
Get the scriptCode
of a transaction output. Read more
impl<Pk: MiniscriptKey> ElementsTrait<Pk> for Sh<Pk> where
Pk: FromStr,
Pk::Hash: FromStr,
<Pk as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Hash as FromStr>::Err: ToString,
impl<Pk: MiniscriptKey> ElementsTrait<Pk> for Sh<Pk> where
Pk: FromStr,
Pk::Hash: FromStr,
<Pk as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Hash as FromStr>::Err: ToString,
fn blind_addr(
&self,
blinder: Option<PublicKey>,
params: &'static AddressParams
) -> Result<Address, Error> where
Pk: ToPublicKey,
fn blind_addr(
&self,
blinder: Option<PublicKey>,
params: &'static AddressParams
) -> Result<Address, Error> where
Pk: ToPublicKey,
Compute a blinded address
Run a predicate on every key in the descriptor, returning whether the predicate returned true for every key Read more
fn for_any_key<'a, F>(&'a self, pred: F) -> bool where
Pk: 'a,
F: FnMut(ForEach<'a, Pk>) -> bool,
<Pk as MiniscriptKey>::Hash: 'a,
fn for_any_key<'a, F>(&'a self, pred: F) -> bool where
Pk: 'a,
F: FnMut(ForEach<'a, Pk>) -> bool,
<Pk as MiniscriptKey>::Hash: 'a,
Run a predicate on every key in the descriptor, returning whether the predicate returned true for any key Read more
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
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
fn translate_pk_infallible<Fpk, Fpkh>(
&self,
translatefpk: Fpk,
translatefpkh: Fpkh
) -> Self::Output where
Fpk: FnMut(&P) -> Q,
Fpkh: FnMut(&<P as MiniscriptKey>::Hash) -> <Q as MiniscriptKey>::Hash,
fn translate_pk_infallible<Fpk, Fpkh>(
&self,
translatefpk: Fpk,
translatefpkh: Fpkh
) -> Self::Output where
Fpk: FnMut(&P) -> Q,
Fpkh: FnMut(&<P as MiniscriptKey>::Hash) -> <Q as MiniscriptKey>::Hash,
Calls translate_pk
with conversion functions that cannot fail
Auto Trait Implementations
impl<Pk> RefUnwindSafe for Sh<Pk> where
Pk: RefUnwindSafe,
<Pk as MiniscriptKey>::Hash: RefUnwindSafe,
impl<Pk> UnwindSafe for Sh<Pk> where
Pk: RefUnwindSafe + UnwindSafe,
<Pk as MiniscriptKey>::Hash: RefUnwindSafe + UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<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>,
Translate a struct from one generic to another where the translation for Pk is provided by translatefpk Read more
impl<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>,
Translate a struct from one generic to another where the translation for Pk is provided by translatefpk Read more
impl<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>,
Translate a struct from one generic to another where the translation for Pk is provided by translatefpk Read more