Reading Ethereum State Without Trusting the RPC - eth_getProof Step by Step
A wallet, an indexer or a bridge relayer usually learns a balance or a storage value by asking an RPC node. The node’s answer is a claim: a compromised or misconfigured provider can return any number. Ethereum lets the reader check the claim instead. Every block header commits to the whole state through its stateRoot, and eth_getProof (EIP-1186) returns the trie nodes that connect one account, and some of its storage slots, to that root.
This article verifies such an answer step by step on mainnet: the WETH contract at block 26,543,450, with its decimals slot, one balanceOf entry and an empty slot. The same proof is then checked on chain with OpenZeppelin’s TrieProof and Blockhash libraries, with Foundry tests that show two mistakes a verifier can make and the check that stops them.
This article has been made with the help of Claude Code and several custom skills
What you need to know first
The article assumes the following:
- Keccak-256. The hash function Ethereum uses everywhere, written
keccak256; it differs from the standardised SHA3-256 by its padding. - Merkle tree. Items hashed in pairs up to a single root, so that a short proof shows one item belongs to the set. The Merkle DAG article covers the general structure.
- RLP. Recursive Length Prefix, Ethereum’s serialisation of byte strings and lists: a short prefix gives the type and length, then the content follows.
- Storage slots. A contract’s storage is a map from 32-byte slots to 32-byte values. State variables take slots in declaration order, and a mapping entry
m[k]at declared slotplives atkeccak256(abi.encode(k, p)). The ABI encoding article coversabi.encode. - Block header and block hash. A header lists the block’s fields (parent hash, state root, timestamp…); the block hash is
keccak256of the header’s RLP encoding.
An RPC answer is a claim
A provider that answers eth_getBalance or eth_getStorageAt gives a value and nothing that ties it to the chain. eth_getProof adds the evidence. Its answer is still produced by the provider, so three things must be checked separately:
- The root. The state root must come from a block the reader already trusts, not from the same provider’s word.
- The account. The account proof must lead from that root to the account, and the account’s four fields must match the claim.
- The slots. Each storage proof must lead from the account’s own storage root to the slot, and the value must match the claim.
A failure at any step means the answer is wrong or the proof is broken; the reader cannot tell which, and does not need to.
flowchart LR
T["Trusted block hash"] -->|"keccak256(RLP(header))"| H["Header"]
H -->|"field index 3"| S["stateRoot"]
S -->|"accountProof along keccak256(address)"| A["Account: nonce, balance,<br/>storageRoot, codeHash"]
A -->|"storageProof along keccak256(slot)"| V["Slot value"]
What eth_getProof returns
EIP-1186, created in June 2018, defines the method. Its status, Stagnant, refers to the EIP process: the method itself is served by the providers used in this article. It takes an address, a list of 32-byte storage keys and a block. Its answer has these fields:
| Field | Content |
|---|---|
balance, nonce, codeHash |
The account’s fields, as claimed by the provider. |
storageHash |
The root of the account’s storage trie, also claimed. |
accountProof |
RLP-encoded trie nodes from the state root along the path of keccak256(address). |
storageProof[] |
For each key: the key, the claimed value, and the nodes from storageHash along keccak256(key). |
The EIP lists the account’s four fields as “specified in the yellow paper [nonce, balance, storageHash, codeHash]”. The EIP’s list of returned fields does not include the address, although some providers add it, as PublicNode does here; the answer never includes the header. A verifier supplies both itself.
The tries behind a state root
The state and each account’s storage are Merkle Patricia tries, defined in appendices C and D of the Ethereum Yellow Paper. Unlike a binary Merkle tree, a node has up to 16 children, one per hexadecimal digit of the key, and runs of digits where nothing branches are compressed into a single node. A verifier needs four of their rules.
Keys are hashed
A trie is walked along its key, one hexadecimal digit (a nibble) per level, high nibble first. In the state trie the key is keccak256(address); in a storage trie it is keccak256(slot), with the slot written as 32 bytes. Hashing spreads the keys evenly over the trie and makes every path 64 nibbles long, whatever the original key. For a mapping entry the slot is already a hash, keccak256(abi.encode(k, p)), and the trie key hashes it a second time.
Three node kinds
Every node is an RLP list:
- a branch has 17 items: one child per nibble value, and a value slot that the state and storage tries do not use, since every key has the same length;
- an extension has 2 items: a run of nibbles shared by all keys below it, and one child;
- a leaf has 2 items: the rest of the key, and the value.
Extensions and leaves store their nibbles in hex-prefix form: the first nibble says whether the node is a leaf and whether the number of nibbles is odd. Because hashed keys spread evenly, the upper levels are full branches and extensions are rare; none appears on the paths of the example below.
Embedded nodes
A child is referenced by the keccak256 hash of its RLP encoding, except when that encoding is shorter than 32 bytes: then the child is written inline in its parent. A proof array therefore lists only hashed nodes, and an inline child is found inside its parent’s bytes. go-ethereum’s Prove follows this rule: it emits a node only if its encoding is 32 bytes or longer, or if it is the root. A verifier must accept inline children and compare them as bytes, not look them up by hash.
Values and absence
The account value is RLP([nonce, balance, storageRoot, codeHash]), integers big-endian with leading zeros removed. A storage value is the slot’s 32-byte value with its leading zero bytes removed, then RLP-encoded: 18 is stored as the single byte 0x12. A slot that holds zero is not stored at all.
A proof can therefore also show that a key is absent. The proof follows the key’s path as far as it exists and stops at the last matching node. EIP-1186 names two endings: a branch whose child for the next nibble is empty, or a leaf “pointing to a different relative-path”. An absent account has nonce 0, balance 0, no code and no storage; an absent slot reads 0.
Step by step on mainnet: WETH at block 26,543,450
The example reads three slots of the WETH9 contract (0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2) at block 26,543,450, mined on 2 December 2026 at 15:51:59 UTC. WETH9’s verified source declares name, symbol, decimals, balanceOf and allowance in that order, so:
- slot 2 holds
decimals; balanceOf[pair]lives atkeccak256(abi.encode(pair, 3)), here for the Uniswap V2 USDC/WETH pair0xB4e16d0168e52d35CaCD2c6185b44281Ec28C9Dc, whosetoken0()andtoken1()returned USDC and WETH when queried from PublicNode on 2 December 2026;- slot 5 is beyond the declared variables and empty.
The block and the proof were fetched from PublicNode’s free endpoint, which refuses state older than about 100 blocks without a token; older blocks need an archive node. The scripts below never contact the network.
Step 1: anchor the state root
The reader needs a block hash from a source other than the provider. Here Etherscan’s API, a second provider, returned the same hash and state root for the block as PublicNode. In production the anchor would be one’s own node, a light client, or a hash already recorded on chain.
The RPC returns the header as JSON, so the off-chain verifier rebuilds its RLP encoding from the fields, in the order the current fork defines (21 fields since Prague, ending with requestsHash), and hashes it. A contract receives the RLP bytes themselves and reads the field it needs by position, which keeps working when a fork appends fields.
| Value | Result |
|---|---|
| RLP of the header | 649 bytes, 21 fields |
keccak256(RLP(header)) |
0x0993a51606a5738c247c5c0254f97bc0e3e9ddfd1e7f7eeb3224f8964b30fb20, equal to the trusted hash |
stateRoot, field index 3 (the fourth field, after parent hash, ommers hash and beneficiary) |
0x34a0f1aecd382f6ad075bbe6dfd836be4a3e304bd1954894bc203c89f97b9f8b |
Only after this match is the state root usable. A provider that lies about the state must also produce another header with the trusted hash, which needs a Keccak-256 second preimage.
Step 2: the account proof
The account key is keccak256(address) = 0x8679e8ed…7a3002. The walk reads it one nibble at a time:
- node 1 is the root: its hash equals the state root, and its child number
8, the key’s first nibble, holds0x1d255b22…, the hash of node 2; - node 2’s child
6, the second nibble, holds the hash of node 3, and node 3’s child7the hash of node 4; - the walk continues this way through node 8;
- node 9 is a leaf whose stored path,
a65bd257638c…, equals the 56 nibbles of the key still unread.
flowchart TB
R["stateRoot 0x34a0f1ae…"] -->|"keccak256(node 1) = stateRoot"| N1["node 1: branch"]
N1 -->|"nibble 8: hash of node 2"| N2["node 2: branch"]
N2 -->|"nibble 6: hash of node 3"| N3["node 3: branch"]
N3 -->|"nibbles 7, 9, e, 8, e"| N8["nodes 4 to 8: branches"]
N8 -->|"nibble d: hash of node 9"| L["node 9: leaf, path a65bd257638c… (56 nibbles)"]
L --> A["[nonce, balance, storageRoot, codeHash]"]
The 9 nodes:
| Node | Kind | Size | Nibbles consumed |
|---|---|---|---|
| 1 to 6 | branch, 16 children | 532 bytes each | 1 each |
| 7 | branch, 11 children | 372 bytes | 1 |
| 8 | branch, 3 children | 115 bytes | 1 |
| 9 | leaf | 115 bytes | the remaining 56 |
Eight branches consume eight nibbles, and the leaf holds the remaining 56, for the full 64. The upper branches are full because the state trie holds a very large number of accounts; lower down, the branches thin out. The leaf decodes to:
| Field | Value |
|---|---|
| nonce | 1 |
| balance | 2,357,004.255612169694731212 ETH (2357004255612169694731212 wei) |
| storageRoot | 0x50aae2382f3d7e4abaa2103ba9b1c33ee4e9ac75a52905285731aeb3e13dd5b2 |
| codeHash | 0xd0a06b12ac47863b5c7be4185c2deaad1c61557033f56c7d4ea74429cbb25e23 |
All four match the provider’s claimed nonce, balance, storageHash and codeHash. The balance is WETH’s ETH reserve, the ether deposited against the tokens.
Step 3: the storage proofs
Each storage proof is walked from the proven storageRoot of step 2, not from the claimed storageHash. The two are equal here, but only the proven one is evidence.
| Slot | Trie key, keccak256(slot) |
Nodes | Result |
|---|---|---|---|
2 (decimals) |
0x405787fa12a823e0… |
7: 6 branches and a leaf of 33 bytes | value 18 |
balanceOf[pair], slot 0xb374801a…d666c0 |
0x78d312e00df8ea13… |
7: 6 branches and a leaf of 44 bytes | 4,992,563,741,402,177,492,304 wei, about 4,992.56 WETH |
| 5 (empty) | 0x036b6384b5eca791… |
7: 6 branches and a leaf of 67 bytes | absent: value 0 |
Storage proofs are shorter than the account proof because WETH’s storage trie holds far fewer keys than the state trie.
The empty slot’s proof ends on a leaf that belongs to another slot. The six branches consume the key’s first six nibbles, 036b63; the key continues with 84b5eca7…, but the leaf’s stored path starts 775c12dd…. The two differ at the first nibble.
The leaf sits exactly where the key’s path leads, and it is hashed into its parent, so the provider cannot swap it for another leaf. Since a trie holds at most one leaf on a path, no leaf for slot 5 can exist below that point. That is EIP-1186’s second form of absence, and it proves that slot 5 holds zero at this block.
flowchart LR
B["branches 1 to 6<br/>consume 0 3 6 b 6 3"] --> L["leaf: stored path 7 7 5 c 1 2 …<br/>(another slot)"]
K["key of slot 5 continues: 8 4 b 5 e c …"] -. "first nibble differs: 8 vs 7" .-> L
What a broken input gives
The same script checks two errors that a verifier must catch:
- An unhashed key. Walking the storage trie with the raw slot
2instead ofkeccak256(2)leads to a branch child that the proof does not contain, and the walk stops with an error. - Another root. Walking the account proof from a value that is not this block’s state root (the script uses the parent block’s hash) fails at the first node: the node’s hash is not that value.
Implementation: verify_weth.py in the verification directory, 11 checks, with the trie code in mpt.py (19 self-tests) and the stored answers in data/.
Verifying on chain with OpenZeppelin
A contract that reads another chain’s state, or a past state of its own chain, follows the same three steps. OpenZeppelin Contracts provides two of the pieces. Blockhash, added in 5.4.0, covers the anchor; TrieProof, added in 5.6.0 and derived from Optimism’s MerkleTrie, covers the walk. The example contract StateReader combines them. Its function signature and library bindings are:
using RLP for bytes;
using RLP for Memory.Slice;
function readSlot(
uint256 blockNumber, // block whose state is read
bytes calldata header, // RLP of that block's header
address account,
bytes[] calldata accountProof, // eth_getProof accountProof
bytes32 slot,
bytes[] calldata storageProof // eth_getProof storageProof[i].proof
) external view returns (uint256)
The RLP helpers in the body come from OpenZeppelin’s RLP library, and the 32-byte hashes are wrapped with abi.encodePacked because TrieProof takes its key as bytes. The body:
bytes32 trusted = Blockhash.blockHash(blockNumber);
if (trusted == bytes32(0)) revert UnknownBlock(blockNumber);
if (keccak256(header) != trusted) revert HeaderMismatch(trusted, keccak256(header));
bytes32 stateRoot = header.decodeList()[3].readBytes32();
bytes memory accountKey = abi.encodePacked(keccak256(abi.encodePacked(account)));
bytes memory acct = TrieProof.traverse(stateRoot, accountKey, accountProof);
Memory.Slice[] memory fields = acct.decodeList();
if (fields.length != 4) revert BadAccount(fields.length);
bytes32 storageRoot = fields[2].readBytes32();
bytes memory slotKey = abi.encodePacked(keccak256(abi.encode(slot)));
bytes memory value = TrieProof.traverse(storageRoot, slotKey, storageProof);
return value.decodeUint256();
In the Foundry test the WETH block’s hash is installed with vm.setBlockhash, and the contract reads decimals = 18 and the pair’s balance from the same mainnet proof as above.
The anchor: a window, then zero
Blockhash.blockHash(n) uses the BLOCKHASH opcode for the last 256 blocks and, beyond that, the EIP-2935 history contract at 0x0000F90827F1C53a10cb7A02335B175320002935, live since Prague (7 May 2025), which keeps 8,191 block hashes, about a day. Outside that window the library “gracefully handles future blocks and blocks beyond the history window by returning zero, consistent with the EVM’s native BLOCKHASH behavior”. It does not revert.
A zero hash never equals keccak256 of a header, so the header check would fail anyway; the explicit check turns that failure into a clear error. The design consequence is larger: with these two sources alone, an on-chain reader can only check a block within about a day of its own block. Older state needs a hash stored on chain earlier, a chain of headers back through the parent hashes, or a proof from an EIP-4788 beacon root through the beacon state’s history accumulators, the route EIP-2935 itself names for “proof against any ancestor since merge”.
TrieProof proves inclusion only
TrieProof returns the value at the end of the path or an error code. An absent key ends in an error, not in zero. In the test, the valid absence proof of slot 5, which ends on another key’s leaf, makes the reverting walk fail and the non-reverting walk return an error code.
For the other form of absence, an empty branch child, a reading of the code shows tryTraverse itself reverting while it decodes the empty child; this case was not run. A contract that must accept an empty slot as zero, such as a balance that was never set, cannot do it with this library alone. It needs a verifier that returns absence as a result: the StateProofVerifier used by Aave, described below, returns a SlotValue with an exists flag and a value of 0 for an absent slot.
TrieProof also expands the key it receives into nibbles as given, so the caller must pass keccak256(address) or keccak256(slot), not the address or the slot.
Two mistakes and the check that stops them
The test builds a fake storage trie of two entries, in which slot 2 holds 1000 instead of WETH’s 18, and computes its root and a proof for slot 2. A second contract, NaiveStorageReader, takes the storage root as a parameter instead of proving it.
| Case | What happens |
|---|---|
| Mistake: the storage root is chosen by the caller | NaiveStorageReader accepts the fake root and proof, and reads decimals = 1000. |
| Check: the storage root comes from the account proof | StateReader, given the same fake proof, walks it from WETH’s proven storage root; the first node’s hash does not match and the call reverts. |
| Mistake: the mapping slot is used as the trie key without the second hash | tryTraverse returns an error code (see Keys are hashed). |
flowchart LR
subgraph naive ["NaiveStorageReader"]
F["storage root chosen by the caller<br/>(fake trie)"] --> P1["storage proof"] --> V1["value 1000: accepted"]
end
subgraph chained ["StateReader"]
BH["block hash"] --> HD["header"] --> SR["stateRoot"] --> AP["account proof"] --> ST["proven storageRoot"] --> P2["same fake proof"] --> V2["hash mismatch: revert"]
end
The first mistake is the most serious: an attacker who chooses the root can build a trie with any value in it. The storage root must come out of the account proof, which comes out of the anchored state root.
Implementation: src/StateReader.sol and test/StateReader.t.sol, 8 tests passing with solc 0.8.28 and Foundry 1.5.0; the fake trie is test 7, the chained check test 8 and the single hash test 4. The test file is generated by gen_test.py from the stored answers.
Where contracts use it
Aave’s governance v3 reads voting power from storage proofs, and splits the three links between contracts:
DataWarehouse.processStorageRoottakes an account, a block hash, the header and an account proof. It checks the header against the given hash, walks the account proof, requires the account to exist, and stores the storage root under the pair(account, blockHash).- Storage proofs are later checked against a stored root, looked up by the same pair.
- The walks use
MerklePatriciaProofVerifier, copied from Lido’s curve-merkle-oracle, which handles embedded nodes.
The DataWarehouse itself accepts a header for any block hash it is given: anyone can craft a header with a state root of their choice and store a root under that header’s hash. That is safe only if every reader looks roots up with a hash it trusts. On the governance side, GovernanceCore.activateVoting records blockhash(block.number - 1) when a vote starts, which is the trusted hash. The lesson for a reviewer is to follow the block hash from the place it is taken to every place a stored root is read with it; this article did not trace the voting machine’s side (see Gaps).
Conclusion
Checking an eth_getProof answer takes three links, and each one must start from the previous one:
- The anchor: a block hash from a source the reader trusts, matched by
keccak256of the header’s RLP; the state root is field index 3 of that header. - The account: the account proof walked along
keccak256(address)from that state root, with all four fields compared. - The slots: each storage proof walked along
keccak256(slot)from the proven storage root, with absence accepted as zero where the application allows it.
On mainnet WETH, the 9-node account proof and the storage proofs of 7 nodes each check decimals, a balanceOf entry and an empty slot against a block hash confirmed by two providers. On chain, OpenZeppelin’s Blockhash and TrieProof cover the anchor and the walk, with two limits a design must plan for: a one-day window for block hashes, and no proofs of absence.

Annex
Key Terms
| Term | Definition |
|---|---|
| State root | The root hash of the state trie, stored in every block header as stateRoot. |
| Storage root | The root hash of one account’s storage trie, the third field of the account. |
| Merkle Patricia trie | Ethereum’s authenticated key-value structure: a radix-16 trie whose nodes are referenced by their Keccak-256 hash. |
| Branch node | A 17-item node: one child per nibble value and a value slot. |
| Extension node | A 2-item node holding a shared run of nibbles and one child. |
| Leaf node | A 2-item node holding the rest of the key and the value. |
| Hex-prefix encoding | The encoding of a node’s nibbles whose first nibble flags a leaf and an odd length. |
| Embedded node | A child whose RLP is shorter than 32 bytes, written inline in its parent instead of by hash. |
| Account proof | The nodes from the state root to an account’s leaf, or to the point where its path ends. |
| Storage proof | The nodes from a storage root to a slot’s leaf, or to the point where its path ends. |
| Proof of absence | A proof that ends where the key’s path stops: an empty branch child, a leaf for a different path, or an extension whose nibbles differ from the key’s. |
| Trust anchor | The block hash a verifier accepts without proof: own node, light client, or on-chain record. |
| EIP-2935 | The system contract, live since Prague, that keeps the last 8,191 block hashes in state. |
TrieProof |
OpenZeppelin’s library for Merkle Patricia inclusion proofs, added in 5.6.0. |
Blockhash |
OpenZeppelin’s library returning a block hash from BLOCKHASH or EIP-2935, or zero outside their window. |
Security Implementation Checklist
These rows apply to an off-chain client or a contract that accepts state proofs.
Anchor
Every later check inherits the anchor’s trust.
| Check | Security requirement | Failure mode if violated |
|---|---|---|
| ☐ | The block hash comes from a source independent of the proof’s provider. | The provider forges the header and the state behind it. |
| ☐ | The header hash is recomputed from the RLP bytes given, and the state root is read from that RLP by position. | A header parsed from a fixed field list breaks at the next fork, or a parsed root differs from the hashed one. |
| ☐ | A zero hash from BLOCKHASH, EIP-2935 or Blockhash is rejected explicitly. |
The failure reads as a bad proof, and the window limit goes unnoticed. |
| ☐ | A design that stores roots by block hash checks where the hash comes from before using a stored root. | A root stored under an arbitrary hash is used as if anchored. |
Walk
A walk that accepts the wrong nodes accepts forged values.
| Check | Security requirement | Failure mode if violated |
|---|---|---|
| ☐ | Account keys are keccak256(address); storage keys are keccak256(slot as 32 bytes), and mapping slots are hashed once more. |
Valid values fail, or a verifier is built that never matches real proofs. |
| ☐ | Storage proofs start from the storage root proven in the account, never from a parameter. | A fake trie proves any value. |
| ☐ | Nodes of 32 bytes or more are checked by hash; shorter children are compared inline. | Embedded nodes break honest proofs, or unchecked nodes are accepted. |
| ☐ | The path is consumed exactly and no proof element is left over. | Extra or truncated proofs are accepted. |
Values
The value at the end of the path still has to be read correctly.
| Check | Security requirement | Failure mode if violated |
|---|---|---|
| ☐ | The account decodes to exactly four items. | A malformed account is read with shifted fields. |
| ☐ | Absence is handled as a real answer: zero where the application allows it, rejection otherwise. | Honest zero values block the protocol, or broken proofs are read as zero. |
| ☐ | Slot values are decoded as RLP integers with leading zeros removed. | A value is misread by a byte offset. |
Timeline
Events up to 2 December 2026.
| Date | Event | Why it matters here | Source |
|---|---|---|---|
| 24 June 2018 | EIP-1186 (eth_getProof) created |
The RPC method that returns account and storage proofs | EIP-1186 |
| 4 February 2025 | Yellow Paper, Shanghai version | Appendices C and D define hex-prefix and the trie | Yellow Paper |
| 7 May 2025 | Prague activates EIP-2935 on mainnet | Block hashes readable on chain for 8,191 blocks | EIP-2935 |
| 17 July 2025 | OpenZeppelin Contracts 5.4.0 adds Blockhash |
A library for the anchor | CHANGELOG |
| 25 February 2026 | OpenZeppelin Contracts 5.6.0 adds TrieProof |
A library for the walk, inclusion only | CHANGELOG |
| 2 December 2026 | Worked example at block 26,543,450 | Live proof verified off chain and on chain | This article |
Frequently Asked Questions
Q: Why not trust the stateRoot returned with the block by the same provider?
Because the provider that lies about a balance can lie about the root as well, and build a trie that matches. The root is trusted only through a block hash obtained elsewhere and matched by the header’s keccak256.
Q: Why are slots hashed before the walk, and mapping slots hashed twice?
The trie key is always keccak256 of the slot, which spreads keys evenly and fixes every path at 64 nibbles. A mapping entry’s slot is already keccak256(abi.encode(k, p)), so its trie key is the hash of that hash. Passing the slot itself as the key walks a path that does not exist.
Q: How can a proof show that a slot is empty?
A zero slot is not stored. The proof follows the slot’s path until it can go no further: a branch with an empty child for the next nibble, a leaf whose remaining path is another key’s, or an extension whose nibbles differ from the key’s. Either shows that no leaf for this key exists, so the value is zero. Slot 5 of WETH ends on another key’s leaf.
Q: Can a contract verify a proof for any past block?
Not with block hashes alone. BLOCKHASH covers 256 blocks and EIP-2935 8,191, about a day; OpenZeppelin’s Blockhash returns zero beyond that. Older state needs a block hash recorded on chain within the window, a chain of headers linked by their parent hashes back from a recent one, or a proof from an EIP-4788 beacon root through the beacon state’s history accumulators.
Q: Does OpenZeppelin’s TrieProof check everything a verifier needs?
It checks the walk: node hashes, inline nodes, the path and leftover elements. It does not anchor the root, does not derive keys, and does not prove absence. The calling contract adds the header check, the key hashing and the root chaining, as StateReader does.
Gaps
The sources leave the following points open.
| Gap | Why it matters | What to read or verify |
|---|---|---|
| The header field order was taken from the block’s JSON fields and confirmed only by the hash match at one block, mined after the Osaka (Fusaka) upgrade with the 21 fields Prague defined. | A later fork adds fields, and a hard-coded list then fails. | The execution-specs header definition of each fork. |
How long providers keep the state needed for eth_getProof was not measured; PublicNode refuses state older than about 100 blocks without a token. |
An off-chain verifier of old state needs an archive node. | The client’s documentation on archive mode and path-based storage. |
| The Verkle and binary-tree proposals (EIP-6800 and later) are not covered. | A different trie would change the proof format and every verifier. | EIP-6800 and the later state-tree EIPs. |
| Aave’s voting machine was not traced to the point where it looks up a stored root. | The claim that the lookup uses the activation hash is not checked end to end. | VotingMachine and the cross-chain message that carries the block hash. |
TrieProof was exercised on one mainnet proof and one fake trie, not fuzzed. |
Malformed RLP “may still revert”, as its documentation says. | OpenZeppelin’s own tests and fuzzing of TrieProof and RLP. |
References
Specifications
- S. Jentzsch and C. Jentzsch, EIP-1186: RPC-Method to get Merkle Proofs - eth_getProof, created 24 June 2018, status Stagnant.
- EIP-2935: Serve historical block hashes from state (
HISTORY_SERVE_WINDOW= 8191). - G. Wood, Ethereum Yellow Paper, Shanghai version efc5f9a, 4 February 2025, appendices C and D.
Code
- OpenZeppelin Contracts v5.7.0, commit
cab19933c33c2ad1d4c7a84864a3601dddfd16f3:TrieProof.sol,Blockhash.sol,RLP.sol. - go-ethereum, commit
8b8bb43a732d5d3441c646e62352d25bdaccb30f,trie/proof.go(Prove,VerifyProof). - Aave governance v3, commit
497226efad1ca3723074034c8341fb90931fc2b2:DataWarehouse.sol,StateProofVerifier.sol,GovernanceCore.sol. - WETH9, verified source on Etherscan.
Data and verification
- Block 26,543,450 and the
eth_getProofanswer for WETH from PublicNode, fetched 2 December 2026; block hash and state root confirmed through the Etherscan API, whose answer is stored with the verification data. - Verification code of this article: verification/eth-getproof-state-verification-step-by-step (Python verifier, 11 checks; trie code, 19 self-tests; Foundry tests, 8 passing).
Related articles
- When a Merkle Proof Breaks at a Hard Fork: Beacon State Proofs from Deneb to Gloas
- Auditing Merkle Proofs in Solidity - How Airdrops and Bridges Accept Forged Claims
- How Certificate Transparency and Sigstore Keep a Log Honest - Checkpoints, Proofs and Witnesses
- Merkle DAGs(IPFS, GIT) - Overview
- OpenZeppelin v5 Data - Overview
- Ethereum’s Hidden Contracts: The System Contracts Behind Every Block
- SSZ vs RLP: How Ethereum Serialises Data on Each Layer
- Proving That Something Is Not There - Sparse vs Indexed Merkle Trees
- Merkle Tree Variants - What Each Design Changes and Why