Coral Merkle Tree
Four reef records must reach another ocean lab unchanged. Build a tree of tiny fingerprints so one changed shell can be found without checking the whole sea.
π§ Before we start
Firefly Hash Ring used a stable fingerprint to place each name. Today we combine fingerprints into a Merkle tree. One fingerprint at the top summarizes everything below it; if one record changes, only its path to the top changes.
Build the fingerprint program
Tap the instruction blocks in order. Start with each record, then combine upward until one root represents the whole reef.
Grow the tree upward
Build the two parent fingerprints, then combine those parents into one root. Each parent summarizes exactly what hangs below it.
Find the changed shell
The copied reef has a different top root. Compare halves, discard the matching half, then inspect only the mismatching pair.
both say wave-6
bubble-4 β bubble-9
Debug the stale root
Record C was repaired, but its old parent and root fingerprints remain. Choose the update rule that makes the whole tree truthful again.
π What you learned
- A fingerprint is a small, stable summary of some data.
- A Merkle tree combines neighboring fingerprints from leaves up to one root.
- The root fingerprint summarizes every record below it.
- Matching branches can be skipped while searching for a change.
- A changed leaf makes only its ancestors stale.
- Refreshing the changed path keeps the tree correct without rebuilding untouched branches.