Proof of Reserves Explained: How a Merkle Tree Works, a Worked Example You Can Verify and What It Cannot Prove

How exchange proof of reserves and Merkle sum trees work, with a computed eight-account example, a verification path, a code sample and what it cannot prove.

Every few weeks a crypto exchange makes news for an outflow, a hack, a delisting or a stablecoin that slips off its peg, and the question that follows is always the same: does the platform really hold what it says it holds? The industry’s most common answer is a “proof of reserves” report, often built on a data structure called a Merkle tree. The idea is powerful and widely misunderstood. A proof of reserves can show that a specific user’s balance is counted in a published liability total, and it can show that an exchange controls certain wallets.

It cannot, by itself, show that the exchange is solvent. This guide explains the mechanics step by step, with a small worked example that the blog computed itself, shows how a user can check their own balance, and lists the questions that separate a meaningful report from a marketing page. It does not rate or accuse any exchange, and every number in the worked example is made up for illustration.

For a broader framework on who controls assets and authorizes transfers, see how bank digital asset custody works.

Key takeaways

  • Two halves, not one. A credible proof of reserves has an assets side (which blockchain addresses the exchange controls and what they hold) and a liabilities side (how much the exchange owes its customers). Reserves matter only in comparison with liabilities.
  • A Merkle tree commits to the whole customer list without publishing it. The exchange publishes one root value. Each user can later receive a short “proof path” and check that their own balance is included in that root.
  • A “sum tree” also commits to totals. Each node carries the sum of the balances beneath it, so the root shows total customer liabilities and a tampered or omitted balance changes the root.
  • What it proves is narrow. At one moment, for the listed assets, the exchange’s disclosed customer balances add up to a stated total and your balance is included. It does not prove the list is complete, that nothing is borrowed against the assets or that the exchange can meet all obligations tomorrow.
  • User checks matter. The protection of a Merkle proof depends on customers actually verifying their inclusion. If few do, an omitted account can go unnoticed.

Why proof of reserves exists

A centralized exchange is a custodian. When you deposit coins, you usually receive a balance in the exchange’s database, and the exchange holds the actual assets in wallets it controls. If the exchange uses customer assets for something else, such as lending, trading or covering losses, the database can still show your balance while the assets are gone. Traditional finance addresses that risk with regulation, segregation rules, audits and, in some jurisdictions, deposit protection. Crypto exchanges operate under a patchwork of regimes, and some users prefer a check they can run themselves. Proof of reserves is the attempt to give them one.

The risk is not theoretical for users, and recent KCEX Blog coverage of an exchange hot-wallet incident and a custodian data breach shows that custody can fail in ways unrelated to solvency. That is worth keeping in mind: proof of reserves is aimed at one failure mode (assets missing relative to liabilities), not at every operational risk.

The assets side: proving control of wallets

To show what it holds, an exchange publishes the blockchain addresses of its wallets, and the public can look up their balances on a block explorer because blockchains are transparent. What an observer cannot tell from an address alone is who controls it. Anyone can publish an address they do not own. The standard remedy is a signed message: the holder of the private key signs a challenge string, for example a message containing a date and the word “KCEX-demo,” and anyone can verify the signature against the public address. A valid signature shows that the party presenting it controls the key at the time of signing.

Limitations on this side include the following:

  • Snapshots in time. Balances at the snapshot moment can differ from balances before or after. Assets can be moved in temporarily for a snapshot and out again, if nothing prevents it.
  • Encumbered assets. An address showing a balance does not reveal whether those coins are pledged as collateral or lent out under a separate arrangement.
  • Completeness. Listing some wallets does not prove there are no others; for the assets side it is only necessary that the listed ones are enough to cover the liabilities.
  • Off-chain assets. Fiat balances, assets at third-party custodians and exchange-issued tokens are not visible on a public blockchain and need other kinds of evidence, such as an auditor’s attestation.

The liabilities side: what Merkle trees add

The liabilities side is the hard part, because the exchange’s customer list and balances are private. The exchange cannot publish them without exposing user data. A Merkle tree, named after the cryptographer Ralph Merkle, gets around that by letting the exchange commit publicly to the whole list with one short value.

Hashes in one paragraph

A cryptographic hash function such as SHA-256 turns any input into a fixed-length fingerprint. The same input always gives the same output; a tiny change gives a completely different output; and it is not feasible to work backward from the fingerprint to the input. That is enough to build a tree.

Building a tree, step by step

  1. Make a leaf for each customer. Combine an identifier and the balance and hash it. Real systems use salted or pseudonymous identifiers so that outsiders cannot guess who is who.
  2. Pair up neighbors and hash each pair to form a parent node. In a sum tree, the parent’s hash input also includes both children’s balances, and the parent carries the sum.
  3. Repeat until one node remains. That node is the root. It depends on every leaf: change any customer’s balance, add an account or remove one, and the root changes.
  4. Publish the root (hash and total). The tree itself and the individual balances stay private.
  5. Give each customer a proof path. This is the list of sibling nodes needed to recompute the root from that customer’s leaf, usually only a handful of values even for millions of customers because the tree is logarithmic in depth.

A worked example the blog computed

The following toy tree uses eight invented accounts and a simple scheme: each leaf is SHA-256 of the text “id|balance”, and each parent is SHA-256 of “left-hash|left-sum|right-hash|right-sum”, with the sum of the two balances. It is a teaching sketch, not any exchange’s actual scheme, and balances are in made-up units. Hashes are shown truncated to the first 16 hexadecimal characters for readability; the real values are 64 characters.

AccountBalanceLeaf hash (first 16 hex)
user-A120ce9c97df9cca673e
user-B4597d054efe0ce8b16
user-C3002d4d5fa37f9de166
user-D15f50e14a7c19c44c1
user-E804980ffa71ddc11e3
user-F240f965719c8ffb5c7b
user-G5fe1392c80be73a71
user-H1950789b2ef65e76450

Pairing the leaves produces four nodes at the next level, then two, then the root:

LevelNodes (hash first 16 hex, sum)
14c8ab89d7f654073 (165); 4384ab943c753fb0 (315); cf6643c909060026 (320); 28c4ad2349532409 (200)
28c6ad92088e43c69 (480); 015cb935ecf08404 (520)
Rootf2e6fea16693f473… (1,000)

The root’s total, 1,000, equals the sum of the eight balances: 120 + 45 + 300 + 15 + 80 + 240 + 5 + 195 = 1,000. The exchange publishes the root hash and the total of 1,000.

How user-C checks the balance

User-C’s balance of 300 is the third leaf. To verify it, user-C receives three sibling values: the leaf of user-D (hash f50e14a7c19c44c1, balance 15, on the right), the level-1 node covering users A and B (hash 4c8ab89d7f654073, sum 165, on the left) and the level-2 node covering the right half of the tree (hash 015cb935ecf08404, sum 520, on the right). User-C then recomputes: hash the leaf; combine with D’s leaf; combine the result with the A-B node; combine that with the right-half node. If the final hash equals the published root hash and the final sum is 1,000, then user-C’s balance is counted in the total. The blog ran this check and it passes.

What happens if a balance is understated

Suppose the exchange wanted to understate its liabilities by recording user-C as 30 instead of 300. The total would fall from 1,000 to 730 and the root hash would change completely (in the blog’s run, the first 16 characters become 5cc8bbc8e1c17edc). If the exchange then publishes the 730 root but gives user-C a proof computed on a balance of 300, the proof does not reach the published root, and user-C would see a mismatch. If the exchange gives user-C a proof consistent with 30, user-C can see the balance is wrong. The only way the cheat survives is if user-C never checks. That is the central point of the scheme: it turns an unverifiable private ledger into something each customer can audit for their own entry.

Code to try it yourself

The short Python script below reproduces the leaf and parent calculation. It uses only the standard library, hashlib, and prints the root.

import hashlib
def h(s): return hashlib.sha256(s.encode()).hexdigest()
users = [("user-A",120),("user-B",45),("user-C",300),("user-D",15),
         ("user-E",80),("user-F",240),("user-G",5),("user-H",195)]
level = [(h(f"{u}|{b}"), b) for u, b in users]
while len(level) > 1:
    level = [(h(f"{l[0]}|{l[1]}|{r[0]}|{r[1]}"), l[1] + r[1])
             for l, r in zip(level[0::2], level[1::2])]
print(level[0])

Change a balance and rerun it to see the root change. Real implementations add salts, handle odd numbers of leaves, use multiple asset types and often include “zero-knowledge” proofs to show that no balance is negative. Those refinements matter, and the next section explains why.

Scale and privacy: how big is a proof path?

A Merkle proof stays short even when the customer list is huge, because each level of the tree halves the number of nodes. A tree over 8 leaves has 3 levels above the leaves, which is why user-C’s proof above has three sibling values. A tree over 1,000,000 leaves needs 20 levels (2 to the power of 20 is 1,048,576), so a proof of 20 sibling values is enough; for 10,000,000 customers it is 24 (2 to the power of 24 is 16,777,216). Those depth figures are the blog’s own arithmetic. In practice, that means a user can verify inclusion with a few kilobytes of data and one pass of hashing.

Privacy needs a separate fix. If a leaf were simply a hash of “user-C|300”, an attacker who knew a user’s account name and could guess the balance could confirm the guess by hashing it. Real schemes therefore add a secret random value (a salt or nonce) to each leaf, or derive the identifier from a private key, so that the published tree reveals no individual balances. A scheme should also say how the tree is padded when the number of accounts is not a power of two, for example by adding zero-balance dummy leaves, because that choice affects both the proof path and what an observer can infer about the number of customers.

One more point concerns sums and multiple assets. An exchange holds many coins, and a single sum across them would be meaningless. Reports therefore build a tree per asset, or a tree whose leaves carry a vector of balances, and publish a root and total for each asset. When you read a report, the question to ask is not “is there a root?” but “is there a root and a matching wallet balance for every asset I hold?”

What a Merkle proof does not prove

  • Completeness of the customer list. The tree commits to the leaves the exchange included. If it leaves out an account entirely, the root is internally consistent and that customer has nothing to verify. Detection depends on customers who expect to find themselves in the tree and cannot.
  • No negative balances. A simple sum tree can be gamed by inserting a negative-balance leaf that cancels others and lowers the total. Better designs prove that all balances are non-negative, which is where range proofs and zero-knowledge techniques come in. When reading a report, check whether it says how negative balances are prevented.
  • Solvency. Liabilities total X and wallets hold Y at a snapshot; if Y is at least X, the snapshot looks fine. But the exchange may also owe money to lenders, counterparties or creditors that are not in the customer tree. A reserve report generally says nothing about those other liabilities.
  • Ongoing conduct. A snapshot on one day says little about the days around it. Frequent, consistent reports are more informative than rare ones.
  • Quality of the assets. Reserves held in the exchange’s own token or in illiquid assets count as reserves on a page but may not be worth their face value under stress.
  • Independence. A report compiled and published by the exchange itself is weaker evidence than one with an independent auditor’s attestation that describes its scope and procedures.

How to read a proof of reserves report

  1. Is there both assets and liabilities? A page that lists wallet balances only is not a proof of solvency.
  2. Is the reserve ratio shown per asset? Totals can hide shortfalls in one coin if another is in surplus. Compare each asset’s wallet balance with that asset’s customer liabilities.
  3. Can you verify your own balance? Look for a tool or instructions that let you check your leaf against the published root. If you cannot, the report asks for trust, not verification.
  4. Who verified it? An independent firm’s scope statement, date, method and limitations matter more than a logo.
  5. When was the snapshot, and how often is it repeated? A single snapshot is weaker than a regular schedule.
  6. What is excluded? Look for statements about loans, margin, derivatives and off-chain liabilities, and for whether staked or locked assets are counted.
  7. Are wallet ownership proofs included? Signed messages or similar evidence are the minimum for claiming control of an address.
  8. Do the numbers move sensibly? Large unexplained jumps between reports should prompt questions.

What users can do beyond checking a proof

  • Keep only what you need on any exchange. Proof of reserves lowers one risk; holding assets in your own wallet removes counterparty risk for those assets.
  • Read the platform’s withdrawal and incident policies. Operational incidents, as the recent Binance wallet incident coverage on this blog shows, often hinge on how a platform handles withdrawals, not on reserves.
  • Diversify custodians for larger balances. A single point of failure is a risk regardless of reports.
  • Follow regulatory status. Licensing regimes with segregation and capital rules, such as those described in the blog’s article on Australia’s proposed digital asset platform rules, address risks that a reserve snapshot cannot.
  • Be skeptical of marketing. A “100% reserves” claim without a method, scope and independent review is a claim, not a proof.

Frequently asked questions

Does proof of reserves mean an exchange is safe?

No. It addresses whether disclosed customer liabilities are matched by disclosed assets at one moment. It does not cover hacks, operational failures, undisclosed liabilities or future conduct.

What is a Merkle tree in simple terms?

A way to combine many data items into a single short fingerprint, the root, such that changing any item changes the root, and any one item can be shown to belong to it with a small proof.

What is the difference between a Merkle tree and a Merkle sum tree?

A sum tree carries a running total at each node, so the root commits to both the data and the total of the balances, which is what a liabilities report needs.

Can an exchange fake a proof of reserves?

It can try, for example by omitting accounts, borrowing assets for a snapshot or inserting negative balances. Good designs, independent audits, repeated snapshots and user verification make this harder, but no report removes the risk.

Should I verify my own balance?

If the exchange offers a verification tool, yes. The scheme’s protection against omitted or understated balances relies on customers checking their own entries.

Sources and research limits

The explanation of hashing and Merkle trees is standard computer-science background; see the Merkle tree entry on Wikipedia and the Python hashlib documentation. The worked example, its numbers and its output were computed by the blog with the script shown above; the accounts and balances are invented, and the scheme is a simplified teaching model, not the method of any specific exchange. The blog did not review any particular exchange’s proof of reserves report for this guide. This article is educational and is not investment or security advice.

Disclaimer: This content was generated with the assistance of artificial intelligence (AI) and has been reviewed by our editorial team. It is intended for informational purposes only and should not be construed as financial, investment, or legal advice. Cryptocurrency investments involve significant risk.
KCEX BLOGKCEX BLOG
Previous 9 hours ago
Next 2026-11-19 22:31

Related Posts

SHARE
TOP