Skip to content
This repository was archived by the owner on Aug 7, 2026. It is now read-only.

feat(mmr): prototype Mountain Merkle Belt benchmarks - #1028

Draft
krushimir wants to merge 10 commits into
krushimir/merkle_frontierfrom
krushimir/mmb
Draft

feat(mmr): prototype Mountain Merkle Belt benchmarks#1028
krushimir wants to merge 10 commits into
krushimir/merkle_frontierfrom
krushimir/mmb

Conversation

@krushimir

@krushimir krushimir commented May 27, 2026

Copy link
Copy Markdown
Collaborator

Note

Draft/WIP, opening for visibility. This is stacked on #984 and extends the MMR/frontier benchmark work with an experimental Merkle Mountain Belt prototype.

Adds an experimental MmrBelt prototype with:

  • paper-aligned belt shape and rightmost merge behavior
  • indexed hash-array storage
  • structured range/belt bagging for the commitment root
  • authenticated belt membership proofs
  • verified summary deltas
  • PartialMmrBelt client-side sync state
  • benchmarks against current MMR and Merkle frontier paths

Current scope covered:

  • recency-biased proof verification
  • append/build/commitment/open/verify benchmarks
  • summary transition verification
  • partial client resync for tracked leaves

Add verified belt summary deltas, PartialMmrBelt client state, live bagging maintenance, and expanded MMR/frontier/MMB benchmark coverage.

Keep the code isolated in the experimental belt module while preserving the existing MMR API surface.
Comment thread miden-crypto/src/merkle/mmr/belt/delta.rs
Comment thread miden-crypto/src/merkle/mmr/belt/delta.rs Outdated
Comment thread miden-crypto/src/merkle/mmr/belt/tests.rs Outdated
Comment thread miden-crypto/src/merkle/mmr/belt/mod.rs
@krushimir

krushimir commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator Author

I reran the MMB benchmarks against the current prototype. The useful signal is split into two parts.

Recency Verification

At 65,536 leaves:

recency k legacy MMR committed peaks Frontier (len, root) MMB (len, root)
1 ~19.43us ~13.35us ~1.58us
4 ~18.84us ~13.28us ~2.37us
16 ~18.85us ~13.30us ~5.48us
64 ~18.85us ~13.71us ~8.63us
128 ~18.83us ~13.26us ~10.54us
512 ~18.82us ~13.26us ~13.30us
1,024 ~18.85us ~13.25us ~14.85us
4,096 ~18.77us ~13.23us ~17.99us
16,384 ~18.80us ~13.20us ~21.06us

This is the strongest positive signal from the prototype: MMB is much faster for newest/recent proofs, roughly competitive around k ~= 512, and worse for older leaves.

Append + Commitment/Root

leaves MMR + commitment Frontier + root MMB live root MMB deferred + root MMB deferred append-only
1,000 ~7.54us ~7.97us ~5.39us ~13.04us ~2.01us
1,023 ~15.51us ~16.58us ~4.03us ~11.63us ~2.14us
1,024 ~7.81us ~8.89us ~5.72us ~12.51us ~2.18us
50,000 ~22.38us ~12.93us ~14.95us ~30.43us ~21.53us
65,535 ~37.67us ~26.50us ~14.67us ~27.53us ~19.42us
65,536 ~19.81us ~13.71us ~22.30us ~32.42us ~26.47us

The append/root numbers are mixed. Live MMB root maintenance helps at merge-heavy MMR boundaries, while deferred root readout is only useful if roots are read less frequently than appends. If a commitment is required after every append, live maintenance is the relevant MMB comparison.

These numbers are useful prototype signals, not a validation of the full MMB paper construction.

Comment thread miden-crypto/src/merkle/mmr/belt/delta.rs

@huitseeker huitseeker left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

THis looks great!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants