eth_getProof
The eth_getProof method returns the account and storage values of the specified account including Merkle-Patricia tree proofs. This method provides cryptographic proofs that allow anyone to verify account data (balance, nonce, code, storage) without needing to trust the RPC provider or run a full node.
The method is essential for building trustless applications such as light clients, cross-chain bridges, Layer 2 solutions, and state verification systems. The returned proofs can be independently verified against a known state root (from a trusted block header), enabling secure verification of account states and storage values. This is particularly valuable for applications that need to prove on-chain state to external systems or smart contracts, such as proving token balances for bridges or verifying contract storage in fraud proofs.
Parameters
parameter | type | description |
|---|---|---|
address | string (required) | The address to get proof for (20 bytes) |
storageKeys | array (required) | Array of storage key positions to get proofs for |
blockParameter | string (required) | Block number in hex or tag (latest, earliest, pending) |
Return Object
The method returns an object containing account information and cryptographic proofs:
field | type | description |
|---|---|---|
address | string | The address of the account (20 bytes) |
balance | string | The current balance of the account in wei (hex-encoded) |
codeHash | string | Hash of the account's bytecode (32 bytes). For EOAs (externally owned accounts), this is the hash of empty data |
nonce | string | The transaction count/nonce for this account (hex-encoded) |
storageHash | string | Hash of the storage trie root (32 bytes). Represents the root hash of the account's storage |
accountProof | array | Array of RLP-encoded Merkle-Patricia tree nodes that prove the account's existence and values in the state trie. This proof can be verified against the state root from the block header |
storageProof | array | Array of storage proof objects, one for each requested storage key. Each object contains: key (requested storage key), value (storage value at this key), and proof (array of RLP-encoded nodes proving this storage value) |
Request Example
Response Example