Tool · Hashing
Merkle tree builder
Many transaction IDs become one 32-byte root
What it does
The tree starts with the six real transaction IDs of mainnet block 130,827, and its root matches that block’s header. Switch to toy txids, edit any leaf, add or remove leaves (up to 16), and the tree redraws.
How to read it
- Each node is SHA256d of the two nodes below it. The labels are the first few hex digits; click any node for its full hash and how it was made.
- When a level has an odd number of nodes, the last one is paired with a copy of itself (the dashed box).
- Click a leaf to see its inclusion proof: the violet path climbs to the root, and the amber boxes are the sibling hashes the proof must carry. A proof for one of 6 transactions needs 3 hashes, not all 6 txids.
- Tamper with a leaf (the lightning button changes one hex digit): every hash on its path turns red up to the root, and the root no longer matches the header.
Pearl specifics
- Same tree as Bitcoin: txids in internal byte order, SHA256d pairs, odd nodes duplicated. Hashes are shown byte-reversed, as explorers print them.
- The root goes into the 108-byte header, so the block hash commits to every transaction. Change one and the header, the block hash and the link from the next block all break.
Under the hood
Runs entirely in your browser. Trees and proofs come from src/lib/merkle.ts. The six txids of block 130,827
come from the Pearl Blockbook, and the site’s build checks that they hash to the Merkle root in that block’s real
header; the library’s unit tests cover single-leaf and odd-level trees.