Skip to content

Switch SMT inclusion verification from version 3o to 6a #75

Description

@ristik

Update the SMT code 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.
  • This repo does not need to generate or verify append-only consistency proofs.

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.
  • During inclusion proof verification, no extra proof field is needed. Recompute region = prefix(proven_key, depth) at each sibling-combine step.

Acceptance:

  • Update root/inclusion verification tests to v6a hashes.
  • Verify shared interop vectors generated by aggregator-go, JS, Rust, and Java.
  • Generate Java vectors for the other repos to verify.
  • Include cases for empty tree, one leaf, shallow split, deep split, and multi-leaf tree.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
In Dev

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions