Merkle Tree & SPV Verification
Alter any letter in the base transactions and observe how the cryptographic mutation cascades upwards, corrupting the Root. Use the SPV buttons to understand how a light client (mobile wallet) proves transaction inclusion without downloading the entire block.
Verification Console
What a Merkle tree is and why Bitcoin uses it
A Merkle tree is a structure that summarises a list of data into a single 32-byte fingerprint, the Merkle root. In Bitcoin, every block stores that root in its header: it is the cryptographic summary of all the transactions the block contains.
It is built in pairs. Each transaction becomes a leaf by applying SHA-256 twice; leaves are then joined two by two, each pair is hashed again, and the process repeats until a single value remains. If the number of items is odd, the last one is duplicated. Changing a single byte of any transaction changes the root, so tampering is detected immediately.
How to use the lab
Edit the content of a leaf and watch the change propagate upwards to the root. Then try SPV mode: pick a transaction and see which sibling hashes are needed to prove it belongs to the block.
Why it matters: SPV verification
A light wallet does not download the whole block. It only needs the block headers and a Merkle proof: a handful of hashes (on the order of log2 of the number of transactions) that let it recompute the root and compare it with the one in the header. That is how a payment can be checked with very little data.
Note
This lab is educational and simplifies some details, such as byte order and edge cases. Do not use it to verify real transactions.