#[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_RETURNs.

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

Detects whether conversion is a non-nested segwit

Detects whether conversion is a taproot conversion

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.