Skip to main content

Module tree

Module tree 

Source
Expand description

Tree (operator AST) per spec §3.6 + §6.

Structs§

Node
A node in the operator AST: a tag plus its body.

Enums§

Body
Body shape for a Node, determined by its Tag.

Constants§

MAX_DECODE_DEPTH
Hard cap on read_node recursion depth. Shared across all recursive tags (Sh, AndV, AndOr, TapTree, Multi, Tr, …) as a generic anti-DOS hardening bound — not a spec-mandated value for non-taproot sites. The value 128 happens to coincide with BIP-341 TAPROOT_CONTROL_MAX_NODE_COUNT, but its role here is just “any depth a real miniscript expression could plausibly reach + headroom”; P2WSH script-size limits cap practical miniscript depth at well under 50.

Functions§

read_node
Decode a Node from the bit stream.
write_node
Encode a Node to the bit stream.