Interactive Merkle tree builder and proof verification tool
A Merkle tree is a binary tree of hashes used to efficiently summarize and verify large datasets. Each leaf node contains the hash of a data block, and each parent node contains the hash of its two children. This structure allows for efficient verification of data integrity and membership proofs.
Each leaf represents one data item (transaction, file chunk, etc.). The hash of the data becomes the leaf's hash value.
Each parent hash is calculated by hashing together its two children: Hash(Left + Right)
The root hash summarizes the entire tree. Any change to a leaf changes the root, making tampering immediately detectable.
A proof shows that specific data exists in the tree by providing the hash path from leaf to root, without revealing other data.
💡 Why This Matters: Bitcoin uses Merkle trees to store all transactions in a block. The block header stores only the Merkle root, but you can verify any transaction exists without downloading the entire block!
A Merkle proof proves that data exists in the tree by showing the minimum path from leaf to root:
Example Tree with 4 transactions:
Root Hash
|
Hash(L+R) Hash(L+R)
| \ | \
TX1 TX2 TX3 TX4
To prove TX1 exists: You only need: Hash(TX2) and Hash(TX3+TX4)
This is much smaller than sending all transactions! ⚡
Hash(current + sibling)| Feature | Hash Chain | Merkle Tree |
|---|---|---|
| Linear? | ✅ Yes (blocks chain) | ❌ No (tree structure) |
| Proof Size | ❌ O(n) - large | ✅ O(log n) - small |
| Verify Single Item | ❌ Need all items | ✅ Merkle proof only |
| Used in | Bitcoin blocks | Block contents, Ethereum state |
Type these commands in the on-screen console:
merkle build [data...] - Create tree from data itemsmerkle verify [index] - Generate proof for specific leafmerkle check [proof] - Verify Merkle proofmerkle export - Download tree as JSONmerkle clear - Reset treerain effect blocks - Trigger block formation animation