This section constructs the note commitment tree of a pool and its Merkle hash, defines the anchors, proves in Proposition 5.9 that a valid authentication path to an anchor exhibits a leaf of the anchored tree unless it yields a collision of the hash’s Sinsemilla instance or an input on which that instance returns , and proves in Lemma 5.15 that the authentication path of a leaf is a function of public data.
Requirement R2 of “Requirements on a shielded payment” (§1.4) asks the consumer of a note of non-zero value to show that the note was previously committed, without identifying it. In the Orchard protocol the claim to be shown is that the extracted commitment of the note (Definition 4.4) is a leaf of the note commitment tree of the note’s pool, and the leaf is not to be disclosed. Membership of a private leaf under a public root is provable in zero knowledge, with the root public and the leaf, its position and its authentication path private (Crypto Guide, §“Privacy-preserving membership via zero-knowledge paths”, Theorem “Privacy-preserving membership”). We construct the tree, its roots, called anchors, and its authentication paths; the relation proved for each Action is the Action statement, defined in “The Action statement” (§9.2).
Let
(protocol specification, §“Constants”). Each pool of the Orchard protocol has its own note commitment tree, an append-only Merkle tree (Crypto Guide, §“Binary Merkle trees” and §“Append-only and incrementally updatable trees”) of fixed depth , hence with leaf positions. Its layers are numbered from layer , the root, to layer , the leaves; layer has nodes , .
Appending. Each Action of the pool in a transaction publishes the extracted commitment of its created note (§4.4). When the transaction enters the chain, each such is appended to the pool’s tree: it occupies the leaf for the least unused index , and is the note position of that commitment. Every pool’s tree has no appended leaf before the first block of the chain.
Leaves. After appends, the leaf is the value appended at position for , and for .
Internal nodes. For and ,
with the Merkle hash constructed below; the root is .
(Protocol specification, §“Note Commitment Trees”, §“Merkle Path Validity”, §“Note Commitments” and §“Transactions and Treestates”.)
Let . The Merkle hash
is
where
with the extracted Sinsemilla hash of §2.4 and field elements encoded through their integer representatives. The protocol specification names the map and the width (§“ Hash Function” and §“Constants”).
The prefix is defined because . It encodes for the combination of two leaves into a node of layer , and for the combination that yields the root, . Every message has the single length bits, chunks of bits, within the bound of chunks of §2.4 (Table 4). The encoding is injective on because (§2.1), so for a fixed layer distinct argument pairs give distinct messages. The protocol specification requires that be collision resistant and that no input of bits yielding can feasibly be found (§“ Hash Function”, security requirements). For the domain and -bit messages these are parts (i) and (iii) of Proposition 2.24, under Assumptions 2.22 and 2.8.
Because ends in , each layer’s output has the type of its inputs, and one hash composes from the leaves to the root. Proofs of the Action statement, defined in “The Action statement” (§9.2), are Halo 2 proofs with the Vesta curve (protocol specification, §“Zero-Knowledge Proving System”), whose scalar field is (Math Guide, §“Base fields, scalar fields, and the Pasta cycle”). A node that is one element of is one value of that proof’s arithmetic, whereas a point-valued node would carry two coordinates and a curve-equation condition at each of the layers.
A node serves only as a digest, never to recover a point, and only if or (Lemma 2.4). A collision of on -bit messages is therefore either a collision of the underlying hash to a point or a pair of messages whose hash points are opposite. Proposition 2.24(i) excludes both, and part (iii) excludes a output, under Assumptions 2.22 and 2.8.
The prefix separates the inputs of different layers (protocol specification, §“ Hash Function”, note). The layer functions evaluate one instance on message sets with distinct prefixes. Every collision that the proof of Proposition 5.9 extracts therefore lies between two messages with the same prefix, and a node computed at one layer is accepted at another only through such a collision or a input (Crypto Guide, §“Layer and domain separation”, Proposition “Separation forces within-domain collisions”).
No point of the Pallas group satisfies . Consequently equals the extracted commitment of no note, and a leaf position holding holds the commitment of no note.
By definition in . A point with on the curve over would satisfy . By Euler’s criterion (Math Guide, §“Quadratic residues and the Euler criterion”, Example “ is a non-square in both Pasta fields”), so is a non-square modulo and no such exists. Only the base-field modulus enters. For the consequence, is when and otherwise of a point, so it is not . The protocol specification states the consequence as the theorem “ is not in the range of ” (§“Sinsemilla commitments”). □
The protocol specification, §“Note Commitment Trees”, and ZIP 258, “Changes to the Protocol Specification”, state the capacity rule: a block must not add Ironwood-pool note commitments that would make the Ironwood-pool note commitment tree exceed its capacity of leaves; the same rule binds the Orchard-pool tree. The Ironwood-pool tree is a tree of its own, built by the construction above with the same depth, the same value at unused positions and the same hash; only the values published by Ironwood-pool Actions are appended to it.
A pool’s treestate comprises its note commitment tree and its nullifier set, constructed in “Nullifier sets” (§6.2). Treestates are chained: the input treestate of the first block is empty; the input treestate of the first transaction of a block is the final treestate of the preceding block, and that of each later transaction the output treestate of the preceding transaction; the final treestate of a block is the output treestate of its last transaction (protocol specification, §“Transactions and Treestates”). The anchor of a block in a pool is the root of the pool’s tree in the block’s final treestate, an element of ; every block has exactly one anchor per pool. A bundle carries one anchor field, in the Ironwood pool and in the Orchard pool, shared by all its Actions; an Action carries no anchor of its own (“Action descriptions and bundles”, §11.1; protocol specification, §“Action Transfers and their Descriptions”).
The protocol specification, §“Action Transfers and their Descriptions”, and ZIP 258, “Changes to the Protocol Specification”, state the anchor rule: whenever a transaction has Ironwood-pool Actions, its field must refer to some earlier block’s final Ironwood-pool treestate, that is, equal the Ironwood-pool anchor of a block that precedes the transaction’s block in the chain. The field is bound likewise to the Orchard pool. The rule sets no bound on how far back that block lies.
Let be the anchor of a block in a pool, the number of leaves appended to the pool’s tree through that block, and the leaves of the tree that roots, so that for . For and with , let
| (2) |
The triple is a valid path to if . This is the path verification of the Crypto Guide (§“Authentication paths and membership proofs”, Definition “Path verification”), with level- compression and the bits of as direction bits; “Authentication paths” (§5.3) constructs the path of an appended leaf.
From a valid path to with and the leaves one computes efficiently either two distinct -bit messages with a common -bit prefix and equal values of , for , or a -bit message on which returns .
In particular, if for a point of the Pallas group, as the extracted commitment of every note is, then, except with negligible probability, and is the value appended at position , in the anchoring block or earlier.
The argument is the Crypto Guide’s Theorem “Soundness of Merkle membership proofs” (§“Soundness: forging a path implies a collision”), with layer-dependent compressions.
(i) Let , and write for the integer with its lowest bit complemented. The genuine chain is for , with genuine siblings for . Since , the node is of its two children, of which is the left one if and the right one if , the other being . The genuine chain therefore satisfies (2) with in place of , and , (Crypto Guide, §“Authentication paths and membership proofs”, Proposition “Completeness”, whose induction this is). The fold on the given path has and . Let be the least with ; it exists, and by minimality. At level both chains evaluate with the running value on the side fixed by : the first on and , the second on and . The two -bit messages hashed there share the prefix , the layer tag of the Crypto Guide’s Proposition “Separation forces within-domain collisions” (§“Layer and domain separation”). They differ in the half that encodes the running value, being injective on , and their values under , , agree. If returns on either message, that message is the second output. Otherwise both values of are values of , and the pair is the first output. The genuine chain is computed from by the recurrence of the tree. A node whose leaves all lie at positions at least depends only on its layer, so the computation takes a number of evaluations of linear in ; the fold takes more.
(ii) The extraction of (i) is deterministic and defined for every list of leaves, so it applies to leaves that an adversary chose. An adversary that outputs a valid path with with probability therefore yields an algorithm that outputs, with probability , a collision of on -bit messages or a -bit message with output . Equal values of other than come from hash points that are equal on distinct messages or opposite (Lemma 2.4). Proposition 2.24, parts (i) and (iii), excludes both outputs except with negligible probability, under Assumptions 2.22 and 2.8; hence is negligible.
(iii) If , then , and by Lemma 5.7, so the path is one with , which (ii) excludes except with negligible probability. Otherwise , and outside the same event , the value appended at position ; the leaves of the tree that roots are those appended through the anchoring block. □
Appending leaves changes the final treestates of later blocks and of no earlier one. Once a block is in the chain, its anchor therefore roots one fixed tree: a valid path to it stays valid after later appends, the anchor stays admissible under the anchor rule while remains in the chain, and Proposition 5.9 applies to it at any later time. A valid path to the anchor of for an extracted note commitment shows that the commitment was appended in or earlier, which is what R2 requires. Excluding a second consumption of a note is not the task of the tree, which is append-only (protocol specification, §“Note Commitment Trees”), but that of the nullifier, constructed in “Nullifiers” (§6).
A reorganisation is the replacement of the chain’s most recent blocks by a competing branch.
With the height of a block as in §1.1, the tip is the last block of the chain. A reorganisation that removes the block whose final treestate a bundle’s anchor refers to leaves the transaction in violation of the anchor rule on the new chain, unless a block of the new chain that precedes the transaction’s block has the same anchor; to be included in the new chain, the transaction must then be rebuilt against an anchor of that chain. The block blocks below a tip of height , the block at height , is removed only by a reorganisation that replaces at least blocks, since a reorganisation that replaces blocks removes the blocks at heights to (ZIP 315, “Rationale for anchor selection”; ZIP 218, “Anchor selection depth”).
The block target spacing, the intended mean interval between consecutive blocks, is seconds (ZIP 218, “Block target spacing”).
ZIP 315 recommends that a transaction built when the tip is at height use as its anchor the final treestate of the block at height , three blocks below the tip (ZIP 315, “Anchor selection”); ZIP 218 recommends the same depth of blocks (“Anchor selection depth”). At the -second target spacing this depth is seconds. The depth is a recommendation to the builder of a transaction, not a consensus rule: the anchor rule admits the final treestate of any earlier block.
The anchor is published with the bundle. Call the set of positions of the leaves appended to the tree that an anchor roots the candidate set of the anchor; by Proposition 5.9(iii), a valid path to the anchor for an extracted note commitment has its position in this set, except with negligible probability. A later anchor roots a tree that contains every appended leaf of an earlier one, so its candidate set is at least as large. An anchor at a depth other than the one that other builders of transactions use distinguishes its builder. These two observations are not ZIP 315’s stated rationale for a fixed depth, which is that too small a depth risks invalidation by a reorganisation, that too large a depth prevents recently received notes from being spent, and that a depth varying with the notes spent leaks information about them (ZIP 315, “Rationale for anchor selection”).
Let the pool’s tree hold leaves, namely the tree that the anchor of a block roots, for a block at or after the one that appended the note’s commitment, so that the note position satisfies . Write with , and . Levels count from the leaves: the level- route node is , a left child if and a right child if . The authentication path of is
the sibling of the level- route node in the tree of size , with the integer with its lowest bit complemented. Verification of against is the fold (2): the level- step evaluates , whose message carries the prefix , with the running value on the left if and on the right if ; verification accepts if and only if , that is, if the triple is a valid path to in the sense of Proposition 5.9. In the protocol specification, §“Merkle Path Validity”, the entry is the node with .
The genuine path of an appended leaf is accepted: the fold on reproduces the route nodes, for every , and ends at (Crypto Guide, §“Authentication paths and membership proofs”, Proposition “Completeness”, whose induction applies with the level- compression , as in the proof of Proposition 5.9). A note’s commitment therefore has a valid path to the anchor of every block from the one that appended it onward.
Let the tree hold leaves, let , and let
For each level the entry of the authentication path of is as follows.
If , then is the root of the complete subtree over the positions , all below ; it is a function of the leaves at those positions alone, and the same in every tree of size greater than .
If , then is the root of the subtree over the positions , a function of the leaves appended in that range, with at its unused positions; it equals when .
Hence the authentication path is a deterministic function of and of the first leaves, which are the values published by the pool’s Actions in the chain through the anchoring block. A holder of the note who has these leaves computes the path without communicating , and verification needs, besides the path, only the public anchor.
By the recurrence of the tree, the node is a function of the leaves at positions , by induction on . Apply this with and , which equals when and when , since is the parity of . When the range ends at , so every position in it is appended, and its leaf is fixed once appended because the tree is append-only. When the range starts at or beyond , every leaf in it is , and its root is by induction on : a level- node over an unused range is of two level- nodes over unused ranges. Positions below hold the appended values , published in the chain. □
The anchor is public. The position, the consumed note’s and its authentication path are not fields of the bundle, and the holder of the note computes the path locally (Lemma 5.15): obtaining the path of a particular position from another party would disclose to that party. The candidate set for the consumed note is the candidate set of the anchor (§5.2), the positions of the appended leaves of the anchored tree. Leaves that an observer knows by other means to be commitments of dummy created notes (§4.4) or of notes already consumed, and other data of the transaction, reduce the effective set, so alone does not measure it. What an Action reveals is stated in Theorem 12.12 (“Privacy”, §12.4).