pub enum Tag {
Show 36 variants
Wpkh,
Tr,
Wsh,
Sh,
Pkh,
TapTree,
Multi,
SortedMulti,
MultiA,
SortedMultiA,
PkK,
PkH,
Check,
Verify,
Swap,
Alt,
DupIf,
NonZero,
ZeroNotEqual,
AndV,
AndB,
AndOr,
OrB,
OrC,
OrD,
OrI,
Thresh,
After,
Older,
Sha256,
Hash160,
Hash256,
Ripemd160,
RawPkH,
False,
True,
}Expand description
Operator tag identifying a descriptor/Miniscript fragment kind.
Variants§
Wpkh
wpkh — P2WPKH descriptor.
Tr
tr — Taproot descriptor.
Wsh
wsh — P2WSH descriptor.
Sh
sh — P2SH descriptor.
Pkh
pkh — P2PKH descriptor.
TapTree
Taproot tree node.
Multi
multi — k-of-n multisig.
SortedMulti
sortedmulti — sorted-key multisig.
MultiA
multi_a — Tapscript multisig with OP_CHECKSIGADD.
SortedMultiA
sortedmulti_a — sorted-key Tapscript multisig.
PkK
Miniscript pk_k — bare public key check.
PkH
Miniscript pk_h — public-key-hash check.
Check
Miniscript c: wrapper (CHECKSIG).
Verify
Miniscript v: wrapper (VERIFY).
Swap
Miniscript s: wrapper (SWAP).
Alt
Miniscript a: wrapper (TOALTSTACK).
DupIf
Miniscript d: wrapper (DUPIF).
NonZero
Miniscript j: wrapper (NONZERO).
ZeroNotEqual
Miniscript n: wrapper (ZERONOTEQUAL).
AndV
Miniscript and_v.
AndB
Miniscript and_b.
AndOr
Miniscript andor.
OrB
Miniscript or_b.
OrC
Miniscript or_c.
OrD
Miniscript or_d.
OrI
Miniscript or_i.
Thresh
Miniscript thresh.
After
Miniscript after — absolute timelock.
Older
Miniscript older — relative timelock.
Sha256
Miniscript sha256.
Hash160
Miniscript hash160.
Hash256
Miniscript hash256 (primary 0x1F in v0.30; promoted from v0.x extension).
Ripemd160
Miniscript ripemd160 (primary 0x20 in v0.30; promoted from v0.x extension).
RawPkH
Raw public-key hash variant (primary 0x21 in v0.30; promoted from v0.x extension).
False
Miniscript 0 literal (primary 0x22 in v0.30; promoted from v0.x extension).
True
Miniscript 1 literal (primary 0x23 in v0.30; promoted from v0.x extension).
Implementations§
Source§impl Tag
impl Tag
Sourcepub fn write(&self, w: &mut BitWriter)
pub fn write(&self, w: &mut BitWriter)
Encode this tag (6 bits primary, plus 4 more if extension) into w.
Sourcepub fn read(r: &mut BitReader<'_>) -> Result<Self, Error>
pub fn read(r: &mut BitReader<'_>) -> Result<Self, Error>
Decode a tag from r, consuming 6 bits (or 10 for extension).
Per SPEC v0.30 §3.2 + §11.1: 6-bit primary values 0x24..=0x3E are the
reserved range and produce Error::TagOutOfRange { primary }. Primary
value 0x3F is the extension prefix; the decoder consumes the following
4-bit subcode and returns Error::TagOutOfRange { primary: 0x3F }
because no extension variants are allocated in v0.30 (the subcode is
consumed but not reported in the error payload).