Verify Ethereum Account Balance with State Proof

Leo Zhang
7 min readJun 19, 2022

How to check the balance of your Ethereum account?

You could use etherscan.io, or any other web API.

But how to convince yourself the balance shown on the site is correct?

You could download the entire blockchain history data and then check the latest state of your account. But that requires tons of data and can be time-consuming.

One great feature of Ethereum is that, a full node can provide proof for anyone, especially light clients, to verify the balance of any account.

Full nodes are those who have stored the entire blockchain data.

Light clients are clients who don’t have access to the entire blockchain data, but rely on full nodes to query that.

In order for full node to provide proof, Ethereum uses a data structure called Merkle Patricia Trie to store the state of accounts and their storage.

We’ve previously introduced this data structure — Merkle Patricia Trie.

In this blog, I will:

  • Talk about how Merkle Patricia Trie is used to structure and store the account state. And how Merkle proof is created to verify the state of any account.
  • Walk through an example that queries the balance of an account and the Merkle Proof of it from a full node, and verify the Proof using a simple Merkle Patricia Trie implementation that I made for demo purpose.

--

--