Skip to content

feat: Implement Soroban State Archive Compression & Merkle Accumulator Proof Verification Engine #1002

Description

@Mosas2000

Area

Soroban contracts / Backend API

What problem does this solve?

As state commitments grow across multiple bridge operators and Soroban contracts, storing and querying historical Merkle roots for reserve backing proofs causes ledger footprint inflation and RPC query slowdowns. Currently, verifying historical Merkle proofs requires iterating over uncompressed leaf hashes in TimescaleDB or on-chain storage.

Proposed solution

  1. Develop an on-chain compact Merkle Mountain Range (MMR) accumulator contract in Soroban (contracts/soroban/mmr_accumulator).
  2. Implement MMR leaf insertion, peak aggregation, and append-only state compression algorithms.
  3. Build a backend service mmrAccumulator.service.ts to compute append-only proof peaks from historical reserve commitments.
  4. Expose verification endpoints (POST /api/v1/reconciliation/verify-mmr-proof) and Soroban contract method verify_mmr_proof to validate inclusion with logarithmic space complexity ($O(\log N)$).
  5. Write integration test suites verifying proof generation and Soroban contract validation across multi-thousand leaf trees.

Alternatives considered

Keeping flat Merkle tree leaves stored on-chain, but MMR accumulators drastically reduce ledger storage footprint and provide verifiable historical state proofs.

Metadata

Metadata

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions