pub struct Sh<Pk: MiniscriptKey> { /* private fields */ }
Expand description
A Legacy p2sh Descriptor
Implementations§
Source§impl<Pk: MiniscriptKey> Sh<Pk>
impl<Pk: MiniscriptKey> Sh<Pk>
Sourcepub fn into_inner(self) -> ShInner<Pk>
pub fn into_inner(self) -> ShInner<Pk>
Get the Inner
Sourcepub fn new(ms: Miniscript<Pk, Legacy>) -> Result<Self, Error>
pub fn new(ms: Miniscript<Pk, Legacy>) -> Result<Self, Error>
Create a new p2sh descriptor with the raw miniscript
Sourcepub fn new_sortedmulti(k: usize, pks: Vec<Pk>) -> Result<Self, Error>
pub fn new_sortedmulti(k: usize, pks: Vec<Pk>) -> Result<Self, Error>
Create a new p2sh sortedmulti descriptor with threshold k
and Vec of pks
.
Sourcepub fn new_wsh(ms: Miniscript<Pk, Segwitv0>) -> Result<Self, Error>
pub fn new_wsh(ms: Miniscript<Pk, Segwitv0>) -> Result<Self, Error>
Create a new p2sh wrapped wsh descriptor with the raw miniscript
Sourcepub fn new_with_wsh(wsh: Wsh<Pk>) -> Self
pub fn new_with_wsh(wsh: Wsh<Pk>) -> Self
Create a new p2sh wrapper for the given wsh descriptor
Sourcepub fn new_wsh_sortedmulti(k: usize, pks: Vec<Pk>) -> Result<Self, Error>
pub fn new_wsh_sortedmulti(k: usize, pks: Vec<Pk>) -> Result<Self, Error>
Create a new p2sh wrapped wsh sortedmulti descriptor from threshold
k
and Vec of pks
Sourcepub fn new_with_wpkh(wpkh: Wpkh<Pk>) -> Self
pub fn new_with_wpkh(wpkh: Wpkh<Pk>) -> Self
Create a new p2sh wrapper for the given wpkh descriptor
Source§impl<Pk: MiniscriptKey + ToPublicKey> Sh<Pk>
impl<Pk: MiniscriptKey + ToPublicKey> Sh<Pk>
Sourcepub fn spk(&self) -> Script
pub fn spk(&self) -> Script
Obtain the corresponding script pubkey for this descriptor
Non failing verion of DescriptorTrait::script_pubkey
for this descriptor
Sourcepub fn addr(&self, network: Network) -> Address
pub fn addr(&self, network: Network) -> Address
Obtain the corresponding script pubkey for this descriptor
Non failing verion of DescriptorTrait::address
for this descriptor
Sourcepub fn inner_script(&self) -> Script
pub fn inner_script(&self) -> Script
Obtain the underlying miniscript for this descriptor
Non failing verion of DescriptorTrait::explicit_script
for this descriptor
Sourcepub fn ecdsa_sighash_script_code(&self) -> Script
pub fn ecdsa_sighash_script_code(&self) -> Script
Obtain the pre bip-340 signature script code for this descriptor
Non failing verion of DescriptorTrait::script_code
for this descriptor
Trait Implementations§
Source§impl<Pk: MiniscriptKey> Debug for Sh<Pk>
impl<Pk: MiniscriptKey> Debug for Sh<Pk>
Source§impl<Pk: MiniscriptKey> DescriptorTrait<Pk> for Sh<Pk>
impl<Pk: MiniscriptKey> DescriptorTrait<Pk> for Sh<Pk>
Source§fn sanity_check(&self) -> Result<(), Error>
fn sanity_check(&self) -> Result<(), Error>
Source§fn address(&self, network: Network) -> Result<Address, Error>where
Pk: ToPublicKey,
fn address(&self, network: Network) -> Result<Address, Error>where
Pk: ToPublicKey,
Source§fn script_pubkey(&self) -> Scriptwhere
Pk: ToPublicKey,
fn script_pubkey(&self) -> Scriptwhere
Pk: ToPublicKey,
Source§fn unsigned_script_sig(&self) -> Scriptwhere
Pk: ToPublicKey,
fn unsigned_script_sig(&self) -> Scriptwhere
Pk: ToPublicKey,
Source§fn explicit_script(&self) -> Result<Script, Error>where
Pk: ToPublicKey,
fn explicit_script(&self) -> Result<Script, Error>where
Pk: ToPublicKey,
Bare
, Pkh
and Wpkh
this
is the scriptPubkey; for ShWpkh
and Sh
this is the redeemScript;
for the others it is the witness script.
For Tr
descriptors, this will error as there is no underlying scriptSource§fn 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>,
Source§fn get_satisfaction_mall<S>(
&self,
satisfier: S,
) -> Result<(Vec<Vec<u8>>, Script), Error>where
Pk: ToPublicKey,
S: Satisfier<Pk>,
fn get_satisfaction_mall<S>(
&self,
satisfier: S,
) -> Result<(Vec<Vec<u8>>, Script), Error>where
Pk: ToPublicKey,
S: Satisfier<Pk>,
Source§fn max_satisfaction_weight(&self) -> Result<usize, Error>
fn max_satisfaction_weight(&self) -> Result<usize, Error>
Source§fn script_code(&self) -> Result<Script, Error>where
Pk: ToPublicKey,
fn script_code(&self) -> Result<Script, Error>where
Pk: ToPublicKey,
scriptCode
of a transaction output. Read moreSource§impl<Pk: MiniscriptKey> Display for Sh<Pk>
impl<Pk: MiniscriptKey> Display for Sh<Pk>
Source§impl<Pk: MiniscriptKey> ForEachKey<Pk> for Sh<Pk>
impl<Pk: MiniscriptKey> ForEachKey<Pk> for Sh<Pk>
Source§impl<Pk: MiniscriptKey> From<Sh<Pk>> for Descriptor<Pk>
impl<Pk: MiniscriptKey> From<Sh<Pk>> for Descriptor<Pk>
Source§impl<Pk: MiniscriptKey> Liftable<Pk> for Sh<Pk>
impl<Pk: MiniscriptKey> Liftable<Pk> for Sh<Pk>
Source§impl<Pk: Ord + MiniscriptKey> Ord for Sh<Pk>
impl<Pk: Ord + MiniscriptKey> Ord for Sh<Pk>
Source§impl<Pk: PartialOrd + MiniscriptKey> PartialOrd for Sh<Pk>
impl<Pk: PartialOrd + MiniscriptKey> PartialOrd for Sh<Pk>
Source§impl<Pk: MiniscriptKey> PreTaprootDescriptorTrait<Pk> for Sh<Pk>
impl<Pk: MiniscriptKey> PreTaprootDescriptorTrait<Pk> for Sh<Pk>
Source§fn explicit_script(&self) -> Scriptwhere
Pk: ToPublicKey,
fn explicit_script(&self) -> Scriptwhere
Pk: ToPublicKey,
DescriptorTrait::explicit_script
, but a non failing version.
All PreTaproot descriptors have a unique explicit scriptSource§fn script_code(&self) -> Scriptwhere
Pk: ToPublicKey,
fn script_code(&self) -> Scriptwhere
Pk: ToPublicKey,
DescriptorTrait::script_code
, but a non failing version.
All PreTaproot descriptors have a script code