ACCUMULATOR
v2 structured-leaf set-membership proof. The conditions commit to a Merkle root over a set of element ids; the witness provides the element id (NUMERIC) plus a Merkle inclusion proof (depth ≤ 4). The leaf hash is TaggedHash("LadderAccumulatorLeaf/v1", element_id_LE) — not free attacker bytes. Closes the v0.5 E-001.
| Field | Data Type | Size | Side | Description |
|---|---|---|---|---|
| set_root | HASH256 | 32 B | Conditions | Root of the inner Merkle tree committing the set; tagged-hash domain LadderAccumulatorInterior/v1. |
| element_id | NUMERIC | 1-3 B | Witness | Position of the proven element (0 ≤ id ≤ 65535). The leaf hash is H_tag("LadderAccumulatorLeaf/v1", element_id_LE). |
| proof | MERKLE_PROOF | 0-128 B | Witness | Sibling hashes from leaf to root, packed as `depth × 32` raw bytes (depth ≤ 4). |
Per-rung cap: 1 ACCUMULATOR. Per-tx cap (across all inputs): 2 ACCUMULATORs. Conditions side fixed at ~38 B regardless of set size; witness is `~5 + 5 + (depth × 32)` ≤ 138 B.
Example: depth-2 tree (4 leaves), proving membership of element_id=2:
MERKLE_PROOF grows by 32 B per tree level. Conditions side stays at 38 B regardless of set size.
HASH256(set_root), NUMERIC(element_id), MERKLE_PROOF → otherwise ERRORMAX_ACCUMULATOR_ELEMENT_ID (65535) → ERRORTaggedHash("LadderAccumulatorLeaf/v1", element_id_LE)current = TaggedHash("LadderAccumulatorInterior/v1", min(current, sibling) || max(current, sibling))Sorted pair convention: Children are sorted lexicographically before hashing — no direction bits needed. Domain separation: the inner Merkle tree uses dedicated tagged-hash domains so cross-tree collisions with the outer MLSC tree, the MULTISIG inner tree, or BIP-340 internal nodes are impossible.
{
"type": "ACCUMULATOR",
"fields": [
{ "type": "HASH256", "hex": "a1b2c3d4... set_root, 32 bytes" }
]
}{
"type": "ACCUMULATOR",
"element_id": 5,
"proof": [
"...sibling at level 0 (32-byte hex)...",
"...sibling at level 1..."
]
}