Description
merkle.ts builds Merkle trees and produces proofs but does not provide a standalone verifyProof function. Consumers must reconstruct the root themselves, which is error-prone and duplicates logic.
Acceptance Criteria
Context
- Target file:
src/merkle.ts
- Reuse the same hash function already used for tree construction
Description
merkle.tsbuilds Merkle trees and produces proofs but does not provide a standaloneverifyProoffunction. Consumers must reconstruct the root themselves, which is error-prone and duplicates logic.Acceptance Criteria
verifyProof(leaf: string, proof: string[], root: string): booleanis exportedtrueonly when the final hash equalsrootContext
src/merkle.ts