Loading…
Loading…
Build a small Merkle tree, check a proof with SHA-256, and learn what a proof like this shows about a platform's reserves and what it leaves open. The lesson is educational and is not financial advice.
Eight fictional customers, each with a fictional balance. Each line is hashed into a leaf, the leaves are joined in pairs and hashed again, level by level, until one hash is left: the root. Change a balance and watch which hashes change.
A proof for one customer is the list of sibling hashes on the way to the root. Load a sample, or paste your own line, proof and root. Then the browser hashes the line, combines it with each sibling in turn and compares the result with the root. Edit the line (for example the balance) and the check fails.
A Merkle tree turns a long list of records into one short fingerprint. Each record (a leaf) is hashed. The hashes are joined in pairs and hashed again, level by level, until one hash is left: the root. If any record changes, every hash above it changes, and so does the root.
To show that one record is part of the list, a publisher does not have to show the whole list. It shows the record and the sibling hashes on the path to the root, about as many as the number of levels. For a list of one million records that is 20 hashes. You hash your own record, combine it with each sibling in turn and compare the result with the published root. If they match, your record is included in the list that the root stands for, with exactly the values you checked.
The leaf hash is SHA-256 of a 0x00 byte followed by the line. An inner hash is SHA-256 of a 0x01 byte followed by the left and the right hash. The different first bytes keep a leaf hash and an inner hash from being mistaken for each other. A node without a partner at the end of a level moves up unchanged; copying it instead would let two different lists produce the same root. All calculations run in your browser with its SHA-256 function, and nothing you type is sent anywhere.
Real proofs of reserves differ from this demo in the line format, the hash function and the extra data they add, and some use other methods, such as zero-knowledge proofs. This tool therefore cannot check the actual proof of any platform. Read the method that the platform publishes. For what Squaby recorded about the proofs of reserves of the exchanges it reviews, see the research article on proof of reserves. This lesson is educational; see the Disclaimer.
Keep verifying claims independently before you act. A matching proof is one piece of evidence, not a guarantee.