Skip to content

[P2] Audit: Build Merkle tree of event commitments for batch proofs #855

Description

@Calebux

Parent Issue

#827

Summary

Organize event commitments into a Merkle tree so users can prove membership of individual events without revealing the full log.

Details

  • Each new commitment is appended as a leaf to a Merkle tree
  • Contract stores only the Merkle root (updated incrementally)
  • User can generate a Merkle proof for any leaf (event) they know
  • Verifier checks: MerkleVerify(root, leaf, proof) == true
  • Tree is append-only (no deletions)

Affected Code

  • New: contracts/contracts/subscription_logging/src/merkle.rs
  • shared/src/crypto/merkle.ts — client-side proof generation
  • backend/src/services/blockchain-service.ts — maintain local copy of tree

Acceptance Criteria

  • Merkle root is updated on-chain with each new commitment
  • User can generate proof for any past event
  • Proof verification works on-chain and off-chain
  • Tree handles 10,000+ leaves efficiently

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programprivacyPrivacy-preserving features

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions