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 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 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 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
sourceimpl ConvertInfo
impl ConvertInfo
Trait Implementations
sourceimpl Clone for ConvertInfo
impl Clone for ConvertInfo
sourcefn clone(&self) -> ConvertInfo
fn clone(&self) -> ConvertInfo
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ConvertInfo
impl Debug for ConvertInfo
sourceimpl Display for ConvertInfo
impl Display for ConvertInfo
sourceimpl Hash for ConvertInfo
impl Hash for ConvertInfo
sourceimpl Ord for ConvertInfo
impl Ord for ConvertInfo
sourceimpl PartialEq<ConvertInfo> for ConvertInfo
impl PartialEq<ConvertInfo> for ConvertInfo
sourceimpl PartialOrd<ConvertInfo> for ConvertInfo
impl PartialOrd<ConvertInfo> for ConvertInfo
sourcefn partial_cmp(&self, other: &ConvertInfo) -> Option<Ordering>
fn partial_cmp(&self, other: &ConvertInfo) -> 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
impl Copy for ConvertInfo
impl Eq for ConvertInfo
impl StructuralEq for ConvertInfo
impl StructuralPartialEq for ConvertInfo
Auto Trait Implementations
impl RefUnwindSafe for ConvertInfo
impl Send for ConvertInfo
impl Sync for ConvertInfo
impl Unpin for ConvertInfo
impl UnwindSafe for ConvertInfo
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more