Enum wallet::descriptor::Category [−][src]
#[non_exhaustive] #[repr(u8)] pub enum Category { Bare, Hashed, Nested, SegWit, Taproot, }
Descriptor category specifies way how the scriptPubkey
is structured
Variants (Non-exhaustive)
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
)
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 sigScript
containing copy of [LockScript
] in
redeemScript
field
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 RedeemScript
in sigScript
transaction
input field, while the original public key or WitnessScript
are
stored in witness
. scriptPubkey
contains a normal P2SH
composed agains the redeemScript
from sigScript
(P2SH-P2WPKH and P2SH-P2WSH variants).
This type works with only with witness version v0, i.e. not applicable for Taproot.
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 [LockScript
] or the public
key
Native Taproot descriptors: taproot
Implementations
impl Category
[src]
impl Category
[src]pub fn is_witness(self) -> bool
[src]
pub fn into_outer_category(self) -> ContentType
[src]
Trait Implementations
impl Deduce for Category
[src]
impl Deduce for Category
[src]fn deduce(
pubkey_script: &PubkeyScript,
has_witness: Option<bool>
) -> Result<Category, DeductionError>
[src]
pubkey_script: &PubkeyScript,
has_witness: Option<bool>
) -> Result<Category, DeductionError>
impl<Pk> From<Descriptor<Pk>> for Category where
Pk: MiniscriptKey,
[src]
impl<Pk> From<Descriptor<Pk>> for Category where
Pk: MiniscriptKey,
[src]fn from(descriptor: Descriptor<Pk>) -> Self
[src]
impl PartialOrd<Category> for Category
[src]
impl PartialOrd<Category> for Category
[src]impl StrictDecode for Category
[src]
impl StrictDecode for Category
[src]impl StrictEncode for Category
[src]
impl StrictEncode for Category
[src]impl StructuralEq for Category
[src]
impl StructuralEq for Category
[src]impl StructuralPartialEq for Category
[src]
impl StructuralPartialEq for Category
[src]Auto Trait Implementations
impl RefUnwindSafe for Category
impl RefUnwindSafe for Category
impl UnwindSafe for Category
impl UnwindSafe for Category