2D companion to the 3D Merkle tree scene: the identical batch-ledger model and FNV-1a hashing, read off a flat tree diagram instead of a rendered cube grid. Every batch record is hashed into a leaf. Each internal node's hash is the hash of its two children concatenated, all the way up to a single root hash:
leaf[i] = H(record[i])
node[p] = H( node[2p+1] || node[2p+2] )
root = node[0]
This is exactly how a pharmaceutical batch ledger (or a Bitcoin block, or Git's object store) proves data integrity: the root hash is a single fingerprint of every record beneath it.
- Tamper — mutates one batch's data. Its leaf hash changes completely (the avalanche effect: one flipped character flips roughly half the output bits), and that change cascades up every ancestor to the root — only log₂(n) hashes are recomputed, pulsed in orange.
- Merkle proof — to prove batch #k is untampered, a verifier only needs the log₂(n) sibling hashes on the path to the root, not the other n−1 records. Toggle the checkbox to highlight that proof path against a naive full re-scan of every leaf.
- Hash function — a real, deterministic FNV-1a mix (32-bit), matching the "hash → fixed-size digest, tiny input change → unrelated output" property that SHA-256 provides in production blockchains.
Real-world relevance: this Merkle-proof mechanism is what lets a pharmacist verify a single drug batch's authenticity against a blockchain root hash published by the manufacturer, without downloading the entire supply-chain ledger.