unicitynetwork / unicitynetwork/state-transition-sdk-java
Switch SMT inclusion verification from version 3o to 6a
Open
- Dominant language
- Java
- Stars
- 3
- Forks
- 0
- Avg merge
- 5h 14m
- Merged PRs (30d)
- 1
Description
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)
regionis the canonical prefix for that node atdepth, 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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.