Skip to content

Implement Merkle proof verification in the merkle module #740

Description

@Kingsman-99

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

  • verifyProof(leaf: string, proof: string[], root: string): boolean is exported
  • The function hashes the leaf, iterates the proof siblings in order, and returns true only when the final hash equals root
  • Both left-sibling and right-sibling proof steps are supported
  • Unit tests pass

Context

  • Target file: src/merkle.ts
  • Reuse the same hash function already used for tree construction

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions