The Zcash ArboretumIronwood Guide PDF

5 The note commitment tree

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.

5.1 The Merkle hash and the tree

Remark 5.1 (Requirement R2).

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).

Definition 5.2 (Note commitment tree).

Let

𝖬𝖾𝗋𝗄𝗅𝖾𝖣𝖾𝗉𝗍𝗁𝖮𝗋𝖼𝗁𝖺𝗋𝖽:=32,𝖴𝗇𝖼𝗈𝗆𝗆𝗂𝗍𝗍𝖾𝖽𝖮𝗋𝖼𝗁𝖺𝗋𝖽:=2∈𝔽p𝖯𝖺𝗅𝗅𝖺𝗌

(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 𝖬𝖾𝗋𝗄𝗅𝖾𝖣𝖾𝗉𝗍𝗁𝖮𝗋𝖼𝗁𝖺𝗋𝖽=32, hence with 232 leaf positions. Its layers are numbered from layer 0, the root, to layer 32, the leaves; layer h has 2h nodes Mih∈𝔽p𝖯𝖺𝗅𝗅𝖺𝗌, 0≤i<2h.

  1. 1.

    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 Mi32 for the least unused index i, and i is the note position 𝗉𝗈𝗌 of that commitment. Every pool’s tree has no appended leaf before the first block of the chain.

  2. 2.

    Leaves. After n appends, the leaf Mi32 is the value appended at position i for 0≤i<n, and Mi32:=𝖴𝗇𝖼𝗈𝗆𝗆𝗂𝗍𝗍𝖾𝖽𝖮𝗋𝖼𝗁𝖺𝗋𝖽=2 for n≤i<232.

  3. 3.

    Internal nodes. For 0≤h<32 and 0≤i<2h,

    Mih:=𝖬𝖾𝗋𝗄𝗅𝖾𝖢𝖱𝖧⁢(h,M2⁢ih+1,M2⁢i+1h+1),

    with 𝖬𝖾𝗋𝗄𝗅𝖾𝖢𝖱𝖧 the Merkle hash constructed below; the root is M00.

(Protocol specification, §“Note Commitment Trees”, §“Merkle Path Validity”, §“Note Commitments” and §“Transactions and Treestates”.)

Construction 5.3 (Merkle hash).

Let D:=z.cash:Orchard-MerkleCRH. The Merkle hash

𝖬𝖾𝗋𝗄𝗅𝖾𝖢𝖱𝖧:{0,…,31}×𝔽p𝖯𝖺𝗅𝗅𝖺𝗌×𝔽p𝖯𝖺𝗅𝗅𝖺𝗌→𝔽p𝖯𝖺𝗅𝗅𝖺𝗌

is

𝖬𝖾𝗋𝗄𝗅𝖾𝖢𝖱𝖧⁢(l,𝑙𝑒𝑓𝑡,𝑟𝑖𝑔ℎ𝑡):={0if ⁢η=⊥,ηotherwise,

where

η:=𝖲𝗂𝗇𝗌𝖾𝗆𝗂𝗅𝗅𝖺𝖧𝖺𝗌𝗁⁢(D,LE10⁢(31−l)⁢‖LE255⁢(𝑙𝑒𝑓𝑡)‖⁢LE255⁢(𝑟𝑖𝑔ℎ𝑡))∈𝔽p𝖯𝖺𝗅𝗅𝖺𝗌∪{⊥},

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 255 𝖬𝖾𝗋𝗄𝗅𝖾𝖧𝖺𝗌𝗁𝖫𝖾𝗇𝗀𝗍𝗁𝖮𝗋𝖼𝗁𝖺𝗋𝖽 (§“𝖬𝖾𝗋𝗄𝗅𝖾𝖢𝖱𝖧𝖮𝗋𝖼𝗁𝖺𝗋𝖽 Hash Function” and §“Constants”).

The prefix LE10⁢(31−l)=LE10⁢(𝖬𝖾𝗋𝗄𝗅𝖾𝖣𝖾𝗉𝗍𝗁𝖮𝗋𝖼𝗁𝖺𝗋𝖽−1−l) is defined because 31<210. It encodes 0 for the combination of two leaves into a node of layer l=31, and 31 for the combination that yields the root, l=0. Every message has the single length 10+255+255=520 bits, 52 chunks of k=10 bits, within the bound of c=253 chunks of §2.4 (Table 4). The encoding LE255 is injective on 𝔽p𝖯𝖺𝗅𝗅𝖺𝗌 because p𝖯𝖺𝗅𝗅𝖺𝗌<2255 (§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 520 bits yielding ⊥ can feasibly be found (§“𝖬𝖾𝗋𝗄𝗅𝖾𝖢𝖱𝖧𝖮𝗋𝖼𝗁𝖺𝗋𝖽 Hash Function”, security requirements). For the domain D and 520-bit messages these are parts (i) and (iii) of Proposition 2.24, under Assumptions 2.22 and 2.8.

Remark 5.4 (Nodes as field elements).

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 𝔽p𝖯𝖺𝗅𝗅𝖺𝗌 (Math Guide, §“Base fields, scalar fields, and the Pasta cycle”). A node that is one element of 𝔽p𝖯𝖺𝗅𝗅𝖺𝗌 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 32 layers.

Remark 5.5 (Dropping the y-coordinate).

A node serves only as a digest, never to recover a point, and 𝖤𝗑𝗍𝗋𝖺𝖼𝗍ℙ⁢(P)=𝖤𝗑𝗍𝗋𝖺𝖼𝗍ℙ⁢(P′) only if P′=P or P′=−P (Lemma 2.4). A collision of 𝖲𝗂𝗇𝗌𝖾𝗆𝗂𝗅𝗅𝖺𝖧𝖺𝗌𝗁⁢(D,⋅) on 520-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.

Remark 5.6 (Layer separation).

The prefix LE10⁢(31−l) separates the inputs of different layers (protocol specification, §“𝖬𝖾𝗋𝗄𝗅𝖾𝖢𝖱𝖧𝖮𝗋𝖼𝗁𝖺𝗋𝖽 Hash Function”, note). The 32 layer functions 𝖬𝖾𝗋𝗄𝗅𝖾𝖢𝖱𝖧⁢(l,⋅,⋅) evaluate one instance 𝖲𝗂𝗇𝗌𝖾𝗆𝗂𝗅𝗅𝖺𝖧𝖺𝗌𝗁⁢(D,⋅) 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”).

Lemma 5.7 (Uncommitted leaves).

No point P of the Pallas group satisfies 𝖤𝗑𝗍𝗋𝖺𝖼𝗍ℙ⁢(P)=2. Consequently 𝖴𝗇𝖼𝗈𝗆𝗆𝗂𝗍𝗍𝖾𝖽𝖮𝗋𝖼𝗁𝖺𝗋𝖽=2 equals the extracted commitment 𝖼𝗆𝗑=𝖤𝗑𝗍𝗋𝖺𝖼𝗍ℙ⊥⁢(𝖼𝗆) of no note, and a leaf position holding 2 holds the commitment of no note.

Proof.

By definition 𝖤𝗑𝗍𝗋𝖺𝖼𝗍ℙ⁢(𝒪)=0≠2 in 𝔽p𝖯𝖺𝗅𝗅𝖺𝗌. A point (x,y)≠𝒪 with x=2 on the curve y2=x3+5 over 𝔽p𝖯𝖺𝗅𝗅𝖺𝗌 would satisfy y2=23+5=13. By Euler’s criterion 13(p𝖯𝖺𝗅𝗅𝖺𝗌−1)/2≡−1(modp𝖯𝖺𝗅𝗅𝖺𝗌) (Math Guide, §“Quadratic residues and the Euler criterion”, Example “13 is a non-square in both Pasta fields”), so 13 is a non-square modulo p𝖯𝖺𝗅𝗅𝖺𝗌 and no such y exists. Only the base-field modulus p𝖯𝖺𝗅𝗅𝖺𝗌 enters. For the consequence, 𝖼𝗆𝗑 is ⊥ when 𝖼𝗆=⊥ and otherwise 𝖤𝗑𝗍𝗋𝖺𝖼𝗍ℙ of a point, so it is not 2. 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 2𝖬𝖾𝗋𝗄𝗅𝖾𝖣𝖾𝗉𝗍𝗁𝖮𝗋𝖼𝗁𝖺𝗋𝖽=232 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.

5.2 Anchors

Definition 5.8 (Treestate and anchor).

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 M00 of the pool’s tree in the block’s final treestate, an element of 𝔽p𝖯𝖺𝗅𝗅𝖺𝗌; 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.

Proposition 5.9 (Membership soundness).

Let 𝑟𝑡 be the anchor of a block in a pool, n the number of leaves appended to the pool’s tree through that block, and L0,…,L232−1 the leaves of the tree that 𝑟𝑡 roots, so that Li=𝖴𝗇𝖼𝗈𝗆𝗆𝗂𝗍𝗍𝖾𝖽𝖮𝗋𝖼𝗁𝖺𝗋𝖽 for i≥n. For v,s0,…,s31∈𝔽p𝖯𝖺𝗅𝗅𝖺𝗌 and 𝗉𝗈𝗌=∑t=031bt⁢2t with bt∈{0,1}, let

a0:=v,at+1:={𝖬𝖾𝗋𝗄𝗅𝖾𝖢𝖱𝖧⁢(31−t,at,st)if ⁢bt=0,𝖬𝖾𝗋𝗄𝗅𝖾𝖢𝖱𝖧⁢(31−t,st,at)if ⁢bt=1(0≤t<32). (2)

The triple (v,𝗉𝗈𝗌,(s0,…,s31)) is a valid path to 𝑟𝑡 if a32=𝑟𝑡. This is the path verification of the Crypto Guide (§“Authentication paths and membership proofs”, Definition “Path verification”), with level-t compression 𝖬𝖾𝗋𝗄𝗅𝖾𝖢𝖱𝖧⁢(31−t,⋅,⋅) and the bits of 𝗉𝗈𝗌 as direction bits; “Authentication paths” (§5.3) constructs the path of an appended leaf.

  1. (i)

    From a valid path to 𝑟𝑡 with v≠L𝗉𝗈𝗌 and the leaves L0,…,Ln−1 one computes efficiently either two distinct 520-bit messages with a common 10-bit prefix and equal values of 𝖲𝗂𝗇𝗌𝖾𝗆𝗂𝗅𝗅𝖺𝖧𝖺𝗌𝗁⁢(D,⋅), for D=z.cash:Orchard-MerkleCRH, or a 520-bit message on which 𝖲𝗂𝗇𝗌𝖾𝗆𝗂𝗅𝗅𝖺𝖧𝖺𝗌𝗁⁢(D,⋅) returns ⊥.

  2. (ii)

    Under Assumptions 2.22 and 2.8, an efficient adversary, even one that chooses the appended leaves, outputs a valid path to 𝑟𝑡 with v≠L𝗉𝗈𝗌 with at most negligible probability.

  3. (iii)

    In particular, if v=𝖤𝗑𝗍𝗋𝖺𝖼𝗍ℙ⁢(P) for a point P of the Pallas group, as the extracted commitment 𝖼𝗆𝗑≠⊥ of every note is, then, except with negligible probability, 𝗉𝗈𝗌<n and v is the value appended at position 𝗉𝗈𝗌, in the anchoring block or earlier.

Proof.

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 jt:=⌊𝗉𝗈𝗌/2t⌋, and write j⊕1 for the integer j with its lowest bit complemented. The genuine chain is a¯t:=Mjt32−t for 0≤t≤32, with genuine siblings s¯t:=Mjt⊕132−t for 0≤t<32. Since jt=2⁢jt+1+bt, the node a¯t+1=Mjt+131−t is 𝖬𝖾𝗋𝗄𝗅𝖾𝖢𝖱𝖧⁢(31−t,⋅,⋅) of its two children, of which a¯t is the left one if bt=0 and the right one if bt=1, the other being s¯t. The genuine chain therefore satisfies (2) with s¯t in place of st, and a¯0=L𝗉𝗈𝗌, a¯32=M00=𝑟𝑡 (Crypto Guide, §“Authentication paths and membership proofs”, Proposition “Completeness”, whose induction this is). The fold on the given path has a0=v≠a¯0 and a32=𝑟𝑡=a¯32. Let t∗ be the least t≥1 with at=a¯t; it exists, and at∗−1≠a¯t∗−1 by minimality. At level t∗−1 both chains evaluate 𝖬𝖾𝗋𝗄𝗅𝖾𝖢𝖱𝖧⁢(32−t∗,⋅,⋅) with the running value on the side fixed by bt∗−1: the first on at∗−1 and st∗−1, the second on a¯t∗−1 and s¯t∗−1. The two 520-bit messages hashed there share the prefix LE10⁢(31−(32−t∗))=LE10⁢(t∗−1), 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, LE255 being injective on 𝔽p𝖯𝖺𝗅𝗅𝖺𝗌, and their values under 𝖬𝖾𝗋𝗄𝗅𝖾𝖢𝖱𝖧, at∗=a¯t∗, agree. If 𝖲𝗂𝗇𝗌𝖾𝗆𝗂𝗅𝗅𝖺𝖧𝖺𝗌𝗁⁢(D,⋅) returns ⊥ on either message, that message is the second output. Otherwise both values of 𝖬𝖾𝗋𝗄𝗅𝖾𝖢𝖱𝖧 are values of 𝖲𝗂𝗇𝗌𝖾𝗆𝗂𝗅𝗅𝖺𝖧𝖺𝗌𝗁⁢(D,⋅), and the pair is the first output. The genuine chain is computed from L0,…,Ln−1 by the recurrence of the tree. A node whose leaves all lie at positions at least n depends only on its layer, so the computation takes a number of evaluations of 𝖬𝖾𝗋𝗄𝗅𝖾𝖢𝖱𝖧 linear in n+32; the fold takes 32 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 v≠L𝗉𝗈𝗌 with probability ϵ therefore yields an algorithm that outputs, with probability ϵ, a collision of 𝖲𝗂𝗇𝗌𝖾𝗆𝗂𝗅𝗅𝖺𝖧𝖺𝗌𝗁⁢(D,⋅) on 520-bit messages or a 520-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 𝗉𝗈𝗌≥n, then L𝗉𝗈𝗌=2, and v≠2 by Lemma 5.7, so the path is one with v≠L𝗉𝗈𝗌, which (ii) excludes except with negligible probability. Otherwise 𝗉𝗈𝗌<n, and outside the same event v=L𝗉𝗈𝗌, the value appended at position 𝗉𝗈𝗌; the n leaves of the tree that 𝑟𝑡 roots are those appended through the anchoring block. □

Remark 5.10 (Old anchors).

Appending leaves changes the final treestates of later blocks and of no earlier one. Once a block B 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 B remains in the chain, and Proposition 5.9 applies to it at any later time. A valid path to the anchor of B for an extracted note commitment shows that the commitment was appended in B 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).

Definition 5.11 (Reorganisation).

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 d blocks below a tip of height H, the block at height H−d, is removed only by a reorganisation that replaces at least d+1 blocks, since a reorganisation that replaces k blocks removes the blocks at heights H−k+1 to H (ZIP 315, “Rationale for anchor selection”; ZIP 218, “Anchor selection depth”).

The block target spacing, the intended mean interval between consecutive blocks, is 25 seconds (ZIP 218, “Block target spacing”).

Remark 5.12 (Recommended anchor depth).

ZIP 315 recommends that a transaction built when the tip is at height H use as its anchor the final treestate of the block at height H−3, three blocks below the tip (ZIP 315, “Anchor selection”); ZIP 218 recommends the same depth of 3 blocks (“Anchor selection depth”). At the 25-second target spacing this depth is 3×25=75 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.

Remark 5.13 (Anchor choice as public data).

The anchor is published with the bundle. Call the set {0,…,n−1} 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”).

5.3 Authentication paths

Construction 5.14 (Authentication path).

Let the pool’s tree hold n 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 𝗉𝗈𝗌<n. Write 𝗉𝗈𝗌=∑t=031bt⁢2t with bt∈{0,1}, and jt:=⌊𝗉𝗈𝗌/2t⌋. Levels t=0,…,31 count from the leaves: the level-t route node is Mjt32−t, a left child if bt=0 and a right child if bt=1. The authentication path of 𝗉𝗈𝗌 is

(s0,…,s31)∈𝔽p𝖯𝖺𝗅𝗅𝖺𝗌32,st:=Mjt⊕132−t,

the sibling of the level-t route node in the tree of size n, with j⊕1 the integer j with its lowest bit complemented. Verification of (v,𝗉𝗈𝗌,(s0,…,s31)) against 𝑟𝑡 is the fold (2): the level-t step evaluates 𝖬𝖾𝗋𝗄𝗅𝖾𝖢𝖱𝖧⁢(31−t,⋅,⋅), whose message carries the prefix LE10⁢(t), with the running value on the left if bt=0 and on the right if bt=1; verification accepts if and only if a32=𝑟𝑡, 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 st is the node M𝖬𝖾𝗋𝗄𝗅𝖾𝖲𝗂𝖻𝗅𝗂𝗇𝗀⁢(h,𝗉𝗈𝗌)h with h=32−t.

The genuine path of an appended leaf is accepted: the fold on (L𝗉𝗈𝗌,𝗉𝗈𝗌,(s0,…,s31)) reproduces the route nodes, at=Mjt32−t for every t, and ends at M00=𝑟𝑡 (Crypto Guide, §“Authentication paths and membership proofs”, Proposition “Completeness”, whose induction applies with the level-t compression 𝖬𝖾𝗋𝗄𝗅𝖾𝖢𝖱𝖧⁢(31−t,⋅,⋅), 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.

Lemma 5.15 (Authentication paths from public data).

Let the tree hold n leaves, let 𝗉𝗈𝗌<n, and let

𝖤𝗆𝗉𝗍𝗒0 :=𝖴𝗇𝖼𝗈𝗆𝗆𝗂𝗍𝗍𝖾𝖽𝖮𝗋𝖼𝗁𝖺𝗋𝖽=2,
𝖤𝗆𝗉𝗍𝗒t+1 :=𝖬𝖾𝗋𝗄𝗅𝖾𝖢𝖱𝖧⁢(31−t,𝖤𝗆𝗉𝗍𝗒t,𝖤𝗆𝗉𝗍𝗒t)(0≤t<32).

For each level t the entry st of the authentication path of 𝗉𝗈𝗌 is as follows.

  1. (i)

    If bt=1, then st is the root of the complete subtree over the positions [(jt−1)⁢ 2t,jt⁢ 2t), all below 𝗉𝗈𝗌; it is a function of the leaves at those positions alone, and the same in every tree of size greater than 𝗉𝗈𝗌.

  2. (ii)

    If bt=0, then st is the root of the subtree over the positions [(jt+1)⁢ 2t,(jt+2)⁢ 2t), a function of the leaves appended in that range, with 𝖴𝗇𝖼𝗈𝗆𝗆𝗂𝗍𝗍𝖾𝖽𝖮𝗋𝖼𝗁𝖺𝗋𝖽 at its unused positions; it equals 𝖤𝗆𝗉𝗍𝗒t when (jt+1)⁢ 2t≥n.

Hence the authentication path is a deterministic function of 𝗉𝗈𝗌 and of the first n 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.

Proof.

By the recurrence of the tree, the node Mih is a function of the leaves at positions [i⁢ 232−h,(i+1)⁢ 232−h), by induction on 32−h. Apply this with h=32−t and i=jt⊕1, which equals jt−1 when bt=1 and jt+1 when bt=0, since bt is the parity of jt. When bt=1 the range ends at jt⁢ 2t≤𝗉𝗈𝗌<n, 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 n, every leaf in it is 2, and its root is 𝖤𝗆𝗉𝗍𝗒t by induction on t: a level-(t+1) node over an unused range is 𝖬𝖾𝗋𝗄𝗅𝖾𝖢𝖱𝖧⁢(31−t,⋅,⋅) of two level-t nodes over unused ranges. Positions below n hold the appended values 𝖼𝗆𝗑, published in the chain. □

Refer to caption
Figure 2: A depth-3 instance of the note commitment tree of §5.1; the protocol’s tree has depth 32. Leaves L0 to L5 are appended (n=6); positions 6 and 7 hold 𝖴𝗇𝖼𝗈𝗆𝗆𝗂𝗍𝗍𝖾𝖽𝖮𝗋𝖼𝗁𝖺𝗋𝖽=2, so D=𝖤𝗆𝗉𝗍𝗒1. The consumed note’s leaf is L2, at position 2 with bits b0=0, b1=1, b2=0. Its authentication path is (s0,s1,s2)=(L3,A,F), each entry the sibling of the route node at its level. The bold fold L2→B→E→R evaluates 𝖬𝖾𝗋𝗄𝗅𝖾𝖢𝖱𝖧 at each level with the prefix LE10⁢(t), shown as tag t, and the running value on the side given by bt; it ends at the root R, the anchor. By Lemma 5.15, the entry A, left of the route, is the root of a complete subtree and the same at every later anchor; the entry F, right of the route and the root over positions 4 to 7, is a function of the leaves appended at the anchor, with 2 at unused positions, and changes when L6 or L7 is appended; the entry L3, right of the route but already appended, is fixed at every later anchor. The boxed subtree enters the path only through its root F. Every entry is computed from 𝗉𝗈𝗌 and the first n leaves.

Figure 2 shows the construction and Lemma 5.15 on a tree of depth 3.

Remark 5.16 (Scope of hiding).

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 n 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 n alone does not measure it. What an Action reveals is stated in Theorem 12.12 (“Privacy”, §12.4).