pub enum Body {
Children(Vec<Node>),
Variable {
k: u8,
children: Vec<Node>,
},
MultiKeys {
k: u8,
indices: Vec<u8>,
},
Tr {
is_nums: bool,
key_index: u8,
tree: Option<Box<Node>>,
},
KeyArg {
index: u8,
},
Hash256Body([u8; 32]),
Hash160Body([u8; 20]),
Timelock(u32),
Empty,
}Variants§
Children(Vec<Node>)
No body fields beyond N child nodes (Class 1 fixed-arity).
Variable
Variable-arity body for Tag::Thresh only (post-v0.30 Phase C).
Encodes k + N child Nodes. Multi-family tags use Body::MultiKeys
per SPEC v0.30 §4.
MultiKeys
Multi-family body (Tag::Multi, SortedMulti, MultiA,
SortedMultiA): k-of-n with raw kiw-width key indices, NOT full
child Nodes. Per SPEC v0.30 §4: wire layout is
tag | (k-1)(5) | (n-1)(5) | n × index(kiw).
Fields
Tr
Tr’s body: NUMS flag, key index, optional tap-script-tree root.
Per SPEC v0.30 §7: wire shape is
Tag::Tr | is_nums(1) | [key_index(kiw) iff !is_nums] | has_tree(1) | [tree iff has_tree].
When is_nums = true, the internal key is the BIP-341 NUMS H-point
50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0
and key_index is unused on the wire (encoder writes 0 by convention;
decoder ignores). When is_nums = false, key_index is a 0..n
placeholder index encoded at kiw bits.
Fields
KeyArg
Single key-arg (Pkh, Wpkh, PkK, PkH, multi-family children).
Wire bit-width for index is determined by the parent Descriptor’s
key_index_width(); not carried in the AST.
Hash256Body([u8; 32])
256-bit hash literal (Sha256, Hash256).
Hash160Body([u8; 20])
160-bit hash literal (Hash160, Ripemd160, RawPkH).
Timelock(u32)
32-bit Bitcoin-native u32 (After, Older).
Empty
No body (False, True).