---
eip: 1186
label: EIP-1186
title: RPC-Method to get Merkle Proofs - eth_getProof
status: Stagnant
type: Standards Track
category: Interface
created: 2018-06-24
requires: 1474
official: https://eips.ethereum.org/EIPS/eip-1186
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1186.md
canonical: https://eips.huatuo.xyz/eip-1186/
lang: en
tldr: "Defines the eth_getProof JSON-RPC method, which returns an account's state plus Merkle proofs so anyone holding a trusted state root can verify it without trusting the node."
tags: [json-rpc, merkle, proof, light-client, state]
---

# EIP-1186: RPC-Method to get Merkle Proofs - eth_getProof

> One of the great features of Ethereum is the fact, that you can verify all data of the state. But in order to allow verification of accounts outside the client, we need an additional function delivering us the required proof. These proofs are important to secure Layer2-Technologies.

**TL;DR:** Defines the eth_getProof JSON-RPC method, which returns an account's state plus Merkle proofs so anyone holding a trusted state root can verify it without trusting the node.

## What problem does it solve?

Normal RPC calls like `eth_getBalance` or `eth_getStorageAt` return a value and ask you to trust the node. Ethereum's state is stored in a Merkle Patricia trie, so every value *could* be proven against the `stateRoot` in a block header, but the standard RPC offered no way to get that proof.

EIP-1186 adds `eth_getProof`. With it, a mobile app, an IoT device, a bridge or a Layer 2 can ask an untrusted node for data and check the answer itself, as long as it knows a trusted block header.

## How it works

**Parameters**

1. The account address (20 bytes).
2. An array of storage keys (32 bytes each) to prove.
3. A block number or tag such as `"latest"`.

**Result**

| Field | Meaning |
| --- | --- |
| `balance`, `nonce` | Account values |
| `codeHash` | Hash of the account's code |
| `storageHash` | Root of the account's storage trie |
| `accountProof` | RLP-encoded trie nodes from the `stateRoot` down to the account, following `keccak256(address)` |
| `storageProof` | For each requested key: `key`, `value`, and `proof` nodes from `storageHash` down, following `keccak256(key)` |

To verify, you take the block's `stateRoot`, walk `accountProof` to recover the account record `[nonce, balance, storageHash, codeHash]`, then walk each storage proof starting from that `storageHash`.

Proofs also work for values that do **not** exist: the proof follows the path as far as it goes and shows that it ends in an empty branch slot or a leaf for a different path.

## Sample code

Requesting a proof with ethers v6:

```ts
import { JsonRpcProvider, zeroPadValue } from "ethers";

const provider = new JsonRpcProvider(process.env.RPC_URL);

const slot0 = zeroPadValue("0x00", 32);
const proof = await provider.send("eth_getProof", [
  "0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", // account
  [slot0],                                       // storage keys
  "latest",
]);

console.log(proof.balance, proof.nonce, proof.storageHash);
console.log("account proof nodes:", proof.accountProof.length);
console.log("slot 0 =", proof.storageProof[0].value);
```

Raw JSON-RPC request:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_getProof",
  "params": ["0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", ["0x0000000000000000000000000000000000000000000000000000000000000000"], "latest"]
}
```

To actually verify, feed `accountProof` and the header's `stateRoot` into a Merkle Patricia trie proof verifier (for example from a trie library in your language).

## Things to know

- **Status: Stagnant** as an EIP, yet `eth_getProof` is widely implemented by execution clients and used by bridges, light clients and storage-proof tooling.
- A proof is only as trustworthy as the block header you check it against. Get the `stateRoot` from a source you trust, not from the same node.
- For an account without code, `codeHash` is the hash of empty bytes, `0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470`.
- Many nodes only keep recent state, so proofs for old blocks may require an archive node.
- The spec suggested a block hash parameter as a possible improvement; [EIP-1898](/eip-1898/) added that style of block identifier to state-reading RPC methods in general.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-1186
