Skip to content

feat: implement merkle_check in Noir with comprehensive tests#6

Merged
olivmath merged 2 commits into
mainfrom
claude/implement-merkle-proof-check-01WdQeabxStQ7VCA2nnQK7Fc
Dec 6, 2025
Merged

feat: implement merkle_check in Noir with comprehensive tests#6
olivmath merged 2 commits into
mainfrom
claude/implement-merkle-proof-check-01WdQeabxStQ7VCA2nnQK7Fc

Conversation

@olivmath
Copy link
Copy Markdown
Owner

@olivmath olivmath commented Dec 6, 2025

Add merkle proof verification functionality in Noir:

  • merkle_check function to verify proofs and compute root
  • Support for generic hash functions via HashFn type
  • Comprehensive tests for even, odd, and power-of-2 leaf counts
  • Uses Keccak256 for testing (matching Rust reference implementation)

The function iterates through proof nodes and applies hashing based on node side (LEFT/RIGHT) to reconstruct the Merkle root from a leaf.

Add merkle proof verification functionality in Noir:
- merkle_check function to verify proofs and compute root
- Support for generic hash functions via HashFn type
- Comprehensive tests for even, odd, and power-of-2 leaf counts
- Uses Keccak256 for testing (matching Rust reference implementation)

The function iterates through proof nodes and applies hashing based on
node side (LEFT/RIGHT) to reconstruct the Merkle root from a leaf.
@olivmath olivmath self-assigned this Dec 6, 2025
Rename the function to merkle_proof_check for consistency with existing
documentation and examples. Add comprehensive documentation:
- Rename function from merkle_check to merkle_proof_check
- Update all tests to use new function name
- Add new example showing low-level API usage
- Update README to list new example

This ensures consistency across the codebase and makes the function
name match what's already documented in README and used in examples.
@olivmath olivmath merged commit 26c8cb3 into main Dec 6, 2025
5 checks passed
@olivmath olivmath deleted the claude/implement-merkle-proof-check-01WdQeabxStQ7VCA2nnQK7Fc branch December 6, 2025 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants