Update the SMT implementation from the current 3o-style node commitment to the v6a construction from rsmt6a.py.
Scope:
- No backwards compatibility required; this is a coordinated pre-production rollover.
- Leaf hash stays unchanged: it still commits to the full key and value.
- Inclusion proof shape stays unchanged: bitmap/depth set + sibling hashes.
- Internal node hash changes to also commit to the node's canonical region/prefix.
Implementation notes:
- Old 3o node commitment was effectively:
H_node(depth, left_hash, right_hash)
- New v6a node commitment is:
H_node(depth, region, left_hash, right_hash)
region is the canonical prefix for that node at depth, using this repo's existing key bit order, endian-ness, and packing conventions.
- Use the existing Go encoding rules.
- During inclusion proof verification, no extra proof field is needed. Recompute
region = prefix(proven_key, depth) at each sibling-combine step.
- Ensure tree construction stores/derives the canonical region for every internal node.
Acceptance:
- Update existing root and inclusion-proof tests to v6a hashes.
- Add shared interop vectors generated with this implementation and verify vectors from the JS, Java, and Rust SDKs.
- Include cases for empty tree, one leaf, shallow split, deep split, and multi-leaf tree.
Update the SMT implementation from the current 3o-style node commitment to the v6a construction from
rsmt6a.py.Scope:
Implementation notes:
H_node(depth, left_hash, right_hash)H_node(depth, region, left_hash, right_hash)regionis the canonical prefix for that node atdepth, using this repo's existing key bit order, endian-ness, and packing conventions.region = prefix(proven_key, depth)at each sibling-combine step.Acceptance: