Enum bitcoin_scripts::convert::ConvertInfo
source · #[repr(u8)]
pub enum ConvertInfo {
Bare,
Hashed,
NestedV0,
SegWitV0,
Taproot,
}
Expand description
Descriptor category specifies way how the scriptPubkey
is structured
Variants§
Bare
Bare descriptors: pk
and bare bitcoin_scripts, including OP_RETURN
s.
The script or public key gets right into scriptPubkey
, i.e. as
P2PK (for a public key) or as custom script (mostly used for
OP_RETURN
)
Hashed
Hash-based descriptors: pkh
for public key hashes and BIP-16 sh
for
P2SH bitcoin_scripts.
We hash public key or script and use non-SegWit scriptPubkey
encoding, i.e. P2PKH or P2SH with corresponding non-segwit
transaction input scriptSig
containing copy of crate::LockScript
in redeemScript
field
NestedV0
SegWit descriptors for legacy wallets defined in BIP 141 as P2SH nested
types https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#P2WPKH_nested_in_BIP16_P2SH:
sh(wpkh)
and sh(wsh)
Compatibility variant for SegWit outputs when the SegWit version and
program are encoded as crate::RedeemScript
in scriptSig
transaction input field, while the original public key or
crate::WitnessScript
are stored in witness
. scriptPubkey
contains a normal P2SH composed agains the redeemScript
from
scriptSig
(P2SH-P2WPKH and P2SH-P2WSH variants).
This type works with only with witness version v0, i.e. not applicable for Taproot.
SegWitV0
Native SegWit descriptors: wpkh
for public keys and wsh
for
bitcoin_scripts
We produce either P2WPKH or P2WSH output and use witness field
in transaction input to store the original crate::LockScript
or the
public key
Taproot
Native Taproot descriptors: taproot
Implementations§
source§impl ConvertInfo
impl ConvertInfo
Trait Implementations§
source§impl Clone for ConvertInfo
impl Clone for ConvertInfo
source§fn clone(&self) -> ConvertInfo
fn clone(&self) -> ConvertInfo
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ConvertInfo
impl Debug for ConvertInfo
source§impl Display for ConvertInfo
impl Display for ConvertInfo
source§impl Hash for ConvertInfo
impl Hash for ConvertInfo
source§impl Ord for ConvertInfo
impl Ord for ConvertInfo
source§fn cmp(&self, other: &ConvertInfo) -> Ordering
fn cmp(&self, other: &ConvertInfo) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
source§impl PartialEq<ConvertInfo> for ConvertInfo
impl PartialEq<ConvertInfo> for ConvertInfo
source§fn eq(&self, other: &ConvertInfo) -> bool
fn eq(&self, other: &ConvertInfo) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<ConvertInfo> for ConvertInfo
impl PartialOrd<ConvertInfo> for ConvertInfo
source§fn partial_cmp(&self, other: &ConvertInfo) -> Option<Ordering>
fn partial_cmp(&self, other: &ConvertInfo) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more