[ad_1]
A Taproot tree is a Merkle (binary) tree of (Faucet)scripts. Each node (an intermediate state within the means of hashing the leaves as much as the basis) has at most 2 little one nodes and each leaf script (on the backside of the tree) is hashed earlier than being hashed once more with the concatenation of its hash and its sibling’s hash.
A Miniscript tree does not do any hashing as it’s simply restructuring a single (presumably very massive) script into fragments. The root of the Miniscript tree is the entire expression. Each subexpression is a node within the tree. The leaves are the expressions which do not have subexpressions, like pk()
or older()
. A node on the tree can have greater than 2 kids. For instance, a node of the Miniscript tree might comprise a thresh()
which incorporates greater than 2 subexpressions (e.g. a 2-of-3 threshold would comprise three subexpressions). A node might additionally solely have 1 little one (e.g. if it incorporates one of many Miniscript wrappers a:
, d:
or l:
).
The Taproot tree can be constructed on the Coverage stage quite than the Miniscript stage as every (Faucet)script on the leaves of the Taproot tree could also be represented as a person Miniscript (Miniscript solely encodes a subset of Script in its entirety). But when we take into consideration how a Taproot tree of insurance policies may be constructed, if the “root” (highest stage) of the Coverage tree contained a or(A,B,C)
that is simply deconstructed right into a Taproot tree with leaves A, B and C. If the Coverage root contained an and
the entire Coverage may have to enter a single leaf however there are potential exceptions (if there are disjunctions beneath it e.g. and(or(A,B),C)
is equal to or(and(A,C),and(B,C))
. If the Coverage root contained a thresh
(e.g. 2-of-3) it could possibly be reconstructed as an or()
of three 2-of-2s as defined on this weblog put up for 2-of-3 threshold signature.
Because of particular person(s) for answering my questions on IRC. Any errors are my very own.
[ad_2]