FIG. 03 · Live

Merkle Proof Verifier

Merkle trees let anyone prove that a record belongs to a log using a handful of hashes instead of the whole log. Hashes here are real SHA-256 values computed by your browser’s Web Crypto API.

  • SHA-256
  • RFC 6962
  • Web Crypto

All computation happens on this device. Text you type is never uploaded.

Leaves

FIG. 03.1
Presets

    Leaves are hashed as SHA-256(0x00 ‖ data) and inner nodes as SHA-256(0x01 ‖ left ‖ right), so a leaf can never be passed off as an inner node.

    Odd node rule

    Duplicating the last node lets two different leaf lists share one root; promoting it does not.

    Merkle tree

    FIG. 03.2

    Select a leaf to see its proof path. Select any hash to copy the full 64-character value.

    • Proof path
    • Sibling hash
    • Verified root
    • Changed since seal
    • Unchanged
    Root

    Tamper lab

    FIG. 03.3

    Seal the current root, then edit any leaf. Every hash that changes turns crimson all the way to the root; untouched subtrees stay green.

    No baseline sealed yet.

    Inclusion proof

    FIG. 03.4

    Select a leaf in the tree to generate its proof.

     

    Independent verifier

    FIG. 03.5

    The verifier only sees this JSON: the leaf, its index, the claimed root and the sibling hashes. It rebuilds the root from scratch and never looks at the tree above.

    Reconstruction

      Computed root
      Claimed root

      How it works

      Methodology

      1. Leaves are UTF-8 strings. Each level pairs nodes left to right and hashes each pair; with the promote rule a lone last node moves up unchanged, which reproduces the RFC 6962 tree shape exactly.
      2. An inclusion proof is the list of sibling hashes from the leaf to the root, each tagged with the side it sits on. For N leaves it holds at most ⌈log₂ N⌉ hashes.
      3. The verifier checks two things: that the hashes rebuild the claimed root, and that the sibling sides agree with the leaf index and tree size, so a proof cannot be replayed for a different position.
      4. Unit tests compare every root against an independent RFC 6962 implementation for 1 to 16 leaves and check that modified leaves, swapped siblings and wrong roots are rejected.