{"eip":1186,"title":"RPC-Method to get Merkle Proofs - eth_getProof","description":"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.","authors":["Simon Jentzsch \u003csimon.jentzsch@slock.it\u003e","Christoph Jentzsch \u003cchristoph.jentzsch@slock.it\u003e"],"status":"Stagnant","type":"Standards Track","category":"Interface","created":"2018-06-24","requires":[1474],"discussionsTo":"https://github.com/ethereum/EIPs/issues/1186","repo":"EIPs","label":"EIP-1186","officialUrl":"https://eips.ethereum.org/EIPS/eip-1186","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1186.md","url":"https://eips.huatuo.xyz/eip-1186/","tldr":{"en":"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.","ja":"eth_getProof JSON-RPC メソッドを定義する。アカウントの状態と Merkle 証明を返すことで、信頼できる state root を持つ人なら誰でも、ノードを信頼せずに検証できる。","ko":"계정의 상태와 Merkle 증명을 반환하는 eth_getProof JSON-RPC 메서드를 정의해, 신뢰할 수 있는 state root를 가진 누구나 노드를 믿지 않고도 검증할 수 있게 한다.","zh":"定义 eth_getProof JSON-RPC 方法，返回账户状态及 Merkle 证明，使持有可信状态根的任何人都无需信任节点即可验证。"},"tags":["json-rpc","merkle","proof","light-client","state"],"explainers":{"en":{"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"],"related":[1474,1898],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-1186/","markdown":"## What problem does it solve?\n\nNormal 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.\n\nEIP-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.\n\n## How it works\n\n**Parameters**\n\n1. The account address (20 bytes).\n2. An array of storage keys (32 bytes each) to prove.\n3. A block number or tag such as `\"latest\"`.\n\n**Result**\n\n| Field | Meaning |\n| --- | --- |\n| `balance`, `nonce` | Account values |\n| `codeHash` | Hash of the account's code |\n| `storageHash` | Root of the account's storage trie |\n| `accountProof` | RLP-encoded trie nodes from the `stateRoot` down to the account, following `keccak256(address)` |\n| `storageProof` | For each requested key: `key`, `value`, and `proof` nodes from `storageHash` down, following `keccak256(key)` |\n\nTo 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`.\n\nProofs 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.\n\n## Sample code\n\nRequesting a proof with ethers v6:\n\n```ts\nimport { JsonRpcProvider, zeroPadValue } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\n\nconst slot0 = zeroPadValue(\"0x00\", 32);\nconst proof = await provider.send(\"eth_getProof\", [\n  \"0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842\", // account\n  [slot0],                                       // storage keys\n  \"latest\",\n]);\n\nconsole.log(proof.balance, proof.nonce, proof.storageHash);\nconsole.log(\"account proof nodes:\", proof.accountProof.length);\nconsole.log(\"slot 0 =\", proof.storageProof[0].value);\n```\n\nRaw JSON-RPC request:\n\n```json\n{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"eth_getProof\",\n  \"params\": [\"0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842\", [\"0x0000000000000000000000000000000000000000000000000000000000000000\"], \"latest\"]\n}\n```\n\nTo 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).\n\n## Things to know\n\n- **Status: Stagnant** as an EIP, yet `eth_getProof` is widely implemented by execution clients and used by bridges, light clients and storage-proof tooling.\n- 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.\n- For an account without code, `codeHash` is the hash of empty bytes, `0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470`.\n- Many nodes only keep recent state, so proofs for old blocks may require an archive node.\n- 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.\n"},"ja":{"lang":"ja","tldr":"eth_getProof JSON-RPC メソッドを定義する。アカウントの状態と Merkle 証明を返すことで、信頼できる state root を持つ人なら誰でも、ノードを信頼せずに検証できる。","tags":["json-rpc","merkle","proof","light-client","state"],"related":[1474,1898],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-1186/","markdown":"## 何を解決するのか\n\n`eth_getBalance` や `eth_getStorageAt` のような通常の RPC 呼び出しは、値を返し、ノードを信頼するよう求めます。Ethereum の状態は Merkle Patricia trie に保存されているため、すべての値は、ブロックヘッダーの `stateRoot` に対して*証明できる*はずですが、標準の RPC にはその証明を取得する手段がありませんでした。\n\nEIP-1186 は `eth_getProof` を追加します。これにより、モバイルアプリ、IoT デバイス、ブリッジ、レイヤー 2 は、信頼できるブロックヘッダーを知ってさえいれば、信頼できないノードにデータを要求し、その答えを自分で検証できます。\n\n## 仕組み\n\n**パラメーター**\n\n1. アカウントアドレス（20 バイト）。\n2. 証明したいストレージキー（各 32 バイト）の配列。\n3. ブロック番号、または `\"latest\"` などのタグ。\n\n**結果**\n\n| フィールド | 意味 |\n| --- | --- |\n| `balance`, `nonce` | アカウントの値 |\n| `codeHash` | アカウントのコードのハッシュ |\n| `storageHash` | アカウントのストレージ trie のルート |\n| `accountProof` | `keccak256(address)` をたどって、`stateRoot` からアカウントまでを結ぶ RLP エンコードされた trie ノード |\n| `storageProof` | 要求した各キーについて、`key`、`value`、および `keccak256(key)` をたどって `storageHash` から下へ向かう `proof` ノード |\n\n検証するには、ブロックの `stateRoot` を取り、`accountProof` をたどってアカウントレコード `[nonce, balance, storageHash, codeHash]` を復元し、その `storageHash` から各ストレージ証明をたどります。\n\n証明は、**存在しない**値に対しても機能します。証明は経路をたどれる限りたどり、それが空のブランチスロット、または別の経路のリーフで終わることを示します。\n\n## サンプルコード\n\nethers v6 で証明を要求する:\n\n```ts\nimport { JsonRpcProvider, zeroPadValue } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\n\nconst slot0 = zeroPadValue(\"0x00\", 32);\nconst proof = await provider.send(\"eth_getProof\", [\n  \"0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842\", // account\n  [slot0],                                       // storage keys\n  \"latest\",\n]);\n\nconsole.log(proof.balance, proof.nonce, proof.storageHash);\nconsole.log(\"account proof nodes:\", proof.accountProof.length);\nconsole.log(\"slot 0 =\", proof.storageProof[0].value);\n```\n\n生の JSON-RPC リクエスト:\n\n```json\n{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"eth_getProof\",\n  \"params\": [\"0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842\", [\"0x0000000000000000000000000000000000000000000000000000000000000000\"], \"latest\"]\n}\n```\n\n実際に検証するには、`accountProof` とヘッダーの `stateRoot` を Merkle Patricia trie 証明の検証器（たとえば、使用言語の trie ライブラリのもの）に渡します。\n\n## 知っておくべきこと\n\n- **ステータス: EIP としては Stagnant** ですが、`eth_getProof` は実行クライアントに広く実装されており、ブリッジ、ライトクライアント、ストレージ証明ツールで使われています。\n- 証明の信頼性は、それを照合するブロックヘッダーの信頼性次第です。`stateRoot` は、同じノードからではなく、信頼できる情報源から取得してください。\n- コードを持たないアカウントでは、`codeHash` は空のバイト列のハッシュ、`0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470` です。\n- 多くのノードは最近の状態しか保持しないため、古いブロックの証明にはアーカイブノードが必要になることがあります。\n- 仕様書は、改善案としてブロックハッシュのパラメーターを挙げていました。[EIP-1898](/eip-1898/) は、状態を読み取る RPC メソッド全般に、その形式のブロック識別子を追加しました。\n"},"ko":{"lang":"ko","tldr":"계정의 상태와 Merkle 증명을 반환하는 eth_getProof JSON-RPC 메서드를 정의해, 신뢰할 수 있는 state root를 가진 누구나 노드를 믿지 않고도 검증할 수 있게 한다.","tags":["json-rpc","merkle","proof","light-client","state"],"related":[1474,1898],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-1186/","markdown":"## 어떤 문제를 해결하나요?\n\n`eth_getBalance`나 `eth_getStorageAt` 같은 일반 RPC 호출은 값을 반환하면서 노드를 믿으라고 요구합니다. 이더리움의 상태는 Merkle Patricia trie에 저장되므로 모든 값은 블록 헤더의 `stateRoot`에 대해 *증명할 수 있*지만, 표준 RPC에는 그 증명을 얻을 방법이 없었습니다.\n\nEIP-1186은 `eth_getProof`를 추가합니다. 이를 쓰면 모바일 앱, IoT 기기, 브리지, 레이어 2는 신뢰할 수 있는 블록 헤더만 알고 있다면 신뢰할 수 없는 노드에 데이터를 요청하고 그 답을 스스로 검증할 수 있습니다.\n\n## 어떻게 동작하나요?\n\n**매개변수**\n\n1. 계정 주소(20바이트).\n2. 증명할 스토리지 키(각 32바이트)의 배열.\n3. 블록 번호 또는 `\"latest\"` 같은 태그.\n\n**결과**\n\n| 필드 | 의미 |\n| --- | --- |\n| `balance`, `nonce` | 계정 값 |\n| `codeHash` | 계정 코드의 해시 |\n| `storageHash` | 계정 스토리지 trie의 루트 |\n| `accountProof` | `keccak256(address)`를 따라 `stateRoot`에서 계정까지 내려가는 RLP 인코딩된 trie 노드 |\n| `storageProof` | 요청한 각 키에 대해 `key`, `value`, 그리고 `keccak256(key)`를 따라 `storageHash`에서 내려가는 `proof` 노드 |\n\n검증하려면 블록의 `stateRoot`를 가져와 `accountProof`를 따라가며 계정 레코드 `[nonce, balance, storageHash, codeHash]`를 복원한 다음, 그 `storageHash`에서 시작해 각 스토리지 증명을 따라갑니다.\n\n증명은 **존재하지 않는** 값에도 적용됩니다. 증명이 경로를 갈 수 있는 곳까지 따라가, 그것이 빈 브랜치 슬롯이나 다른 경로의 리프에서 끝남을 보여 줍니다.\n\n## 샘플 코드\n\nethers v6로 증명 요청하기:\n\n```ts\nimport { JsonRpcProvider, zeroPadValue } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\n\nconst slot0 = zeroPadValue(\"0x00\", 32);\nconst proof = await provider.send(\"eth_getProof\", [\n  \"0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842\", // account\n  [slot0],                                       // storage keys\n  \"latest\",\n]);\n\nconsole.log(proof.balance, proof.nonce, proof.storageHash);\nconsole.log(\"account proof nodes:\", proof.accountProof.length);\nconsole.log(\"slot 0 =\", proof.storageProof[0].value);\n```\n\n원시 JSON-RPC 요청:\n\n```json\n{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"eth_getProof\",\n  \"params\": [\"0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842\", [\"0x0000000000000000000000000000000000000000000000000000000000000000\"], \"latest\"]\n}\n```\n\n실제로 검증하려면 `accountProof`와 헤더의 `stateRoot`를 Merkle Patricia trie 증명 검증기(예: 사용하는 언어의 trie 라이브러리에 있는 것)에 넣으세요.\n\n## 알아둘 점\n\n- **상태: EIP로서는 Stagnant**이지만, `eth_getProof`는 실행 클라이언트에 널리 구현되어 있으며 브리지, 라이트 클라이언트, 스토리지 증명 도구에서 쓰입니다.\n- 증명의 신뢰도는 그것을 대조하는 블록 헤더만큼입니다. `stateRoot`는 같은 노드가 아니라 신뢰할 수 있는 출처에서 가져오세요.\n- 코드가 없는 계정의 경우 `codeHash`는 빈 바이트의 해시인 `0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470`입니다.\n- 많은 노드가 최근 상태만 보관하므로, 오래된 블록의 증명에는 아카이브 노드가 필요할 수 있습니다.\n- 명세는 블록 해시 매개변수를 개선 가능성으로 제안했습니다. [EIP-1898](/eip-1898/)이 상태를 읽는 RPC 메서드 전반에 그런 방식의 블록 식별자를 추가했습니다.\n"},"zh":{"lang":"zh","tldr":"定义 eth_getProof JSON-RPC 方法，返回账户状态及 Merkle 证明，使持有可信状态根的任何人都无需信任节点即可验证。","tags":["json-rpc","merkle","proof","light-client","state"],"related":[1474,1898],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-1186/","markdown":"## 它解决什么问题？\n\n`eth_getBalance` 或 `eth_getStorageAt` 这类普通 RPC 调用会返回一个值，并要求你信任节点。以太坊的状态存放在 Merkle Patricia trie 中，因此每个值原本*都可以*对照区块头中的 `stateRoot` 来证明，但标准 RPC 没有提供获取这种证明的方法。\n\nEIP-1186 新增了 `eth_getProof`。有了它，手机应用、IoT 设备、跨链桥或 Layer 2 只要知道一个可信的区块头，就可以向不受信任的节点索取数据，并自行检查返回的答案。\n\n## 它如何运作\n\n**参数**\n\n1. 账户地址（20 字节）。\n2. 要证明的存储键数组（每个 32 字节）。\n3. 区块号，或 `\"latest\"` 之类的标签。\n\n**结果**\n\n| 字段 | 含义 |\n| --- | --- |\n| `balance`、`nonce` | 账户的值 |\n| `codeHash` | 账户代码的哈希 |\n| `storageHash` | 账户存储 trie 的根 |\n| `accountProof` | 沿着 `keccak256(address)` 从 `stateRoot` 向下到该账户的 RLP 编码 trie 节点 |\n| `storageProof` | 对每个请求的键：`key`、`value`，以及沿着 `keccak256(key)` 从 `storageHash` 向下的 `proof` 节点 |\n\n验证时，取区块的 `stateRoot`，沿 `accountProof` 走一遍以还原账户记录 `[nonce, balance, storageHash, codeHash]`，再从该 `storageHash` 出发沿每条存储证明走一遍。\n\n证明同样适用于**不存在**的值：证明沿路径走到尽头，并显示它终止于一个空的分支槽，或终止于另一条路径的叶子。\n\n## 示例代码\n\n用 ethers v6 请求证明：\n\n```ts\nimport { JsonRpcProvider, zeroPadValue } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\n\nconst slot0 = zeroPadValue(\"0x00\", 32);\nconst proof = await provider.send(\"eth_getProof\", [\n  \"0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842\", // account\n  [slot0],                                       // storage keys\n  \"latest\",\n]);\n\nconsole.log(proof.balance, proof.nonce, proof.storageHash);\nconsole.log(\"account proof nodes:\", proof.accountProof.length);\nconsole.log(\"slot 0 =\", proof.storageProof[0].value);\n```\n\n原始 JSON-RPC 请求：\n\n```json\n{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"eth_getProof\",\n  \"params\": [\"0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842\", [\"0x0000000000000000000000000000000000000000000000000000000000000000\"], \"latest\"]\n}\n```\n\n要真正完成验证，请把 `accountProof` 和区块头的 `stateRoot` 交给 Merkle Patricia trie 证明验证器（例如你所用语言的 trie 库中的验证器）。\n\n## 需要注意\n\n- **状态：作为 EIP 是 Stagnant**，但 `eth_getProof` 已被执行层客户端广泛实现，并被跨链桥、轻客户端和存储证明工具所使用。\n- 证明的可信程度取决于你用来核对它的区块头。请从你信任的来源获取 `stateRoot`，而不要从同一个节点获取。\n- 对于没有代码的账户，`codeHash` 是空字节的哈希，即 `0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470`。\n- 许多节点只保留近期状态，因此获取旧区块的证明可能需要归档节点。\n- 规范曾建议把区块哈希参数作为一项可能的改进；[EIP-1898](/eip-1898/) 为读取状态的 RPC 方法普遍加入了这种区块标识符。\n"}}}
