For the complete documentation index, see llms.txt. This page is also available as Markdown.

eth_getProof - Ethereum

Example code for the eth_getProof JSON RPC method. Сomplete guide on how to use eth_getProof JSON RPC in GetBlock Web3 documentation.

This method returns a Merkle-Patricia proof for an account and (optionally) a set of storage slots, per EIP-1186. The proof allows verifiers to cryptographically validate account state (nonce, balance, code hash, storage root) and specific storage values against a known state root — the foundation for light clients, cross-chain state proofs, and trust-minimized bridges.

Parameters

Parameter
Type
Required
Description

address

string

Yes

20-byte address to prove (hex-encoded with 0x prefix)

storageKeys

array of string

Yes

Array of 32-byte storage keys to include proofs for (empty array for account-only proof)

blockParameter

string

Yes

Block number in hex, or latest, earliest, pending, finalized, safe

Request

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_getProof",
    "params": [
        "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
        [
            "0x0000000000000000000000000000000000000000000000000000000000000000"
        ],
        "latest"
    ],
    "id": "getblock.io"
}'
example.js
const axios = require('axios');

const response = await axios.post('https://go.getblock.io/<ACCESS-TOKEN>/', {
    jsonrpc: '2.0',
    method: 'eth_getProof',
    params: [
        "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
        [
            "0x0000000000000000000000000000000000000000000000000000000000000000"
        ],
        "latest"
    ],
    id: 'getblock.io'
}, {
    headers: { 'Content-Type': 'application/json' }
});

console.log(response.data.result);

Response

Response Parameters

Parameter
Type
Description

jsonrpc

string

JSON-RPC protocol version ("2.0")

id

string

Request identifier matching the request

result.address

string

The proven address

result.accountProof

array of string

Merkle-Patricia proof nodes for the account, from root to leaf

result.balance

string

Account balance (wei, hex)

result.codeHash

string

keccak256 of the deployed bytecode (or 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 for EOAs)

result.nonce

string

Account nonce (hex)

result.storageHash

string

Root of the account's storage trie

result.storageProof

array of object

Per-slot storage proofs (empty if no storage keys requested)

result.storageProof[].key

string

The storage key

result.storageProof[].value

string

The value at that slot

result.storageProof[].proof

array of string

Merkle-Patricia proof nodes for the slot

Use Cases

  • Trust-Minimized Bridges: Cross-chain messaging protocols verify Ethereum state on other chains via Merkle proofs

  • Light Client Validation: Light clients confirm specific account or storage values without downloading full state

  • Historical State Attestations: Zero-knowledge proof systems attest to Ethereum state as inputs for off-chain computation

  • Storage-Value Proofs: Prove a specific ERC-20 balance or governance vote at a historical block for airdrops or snapshots

Error Handling

Error Code
Message
Description

-32602

Invalid params

Address or storage keys malformed

-32603

Internal error

Node failed to generate the proof (usually indicates state pruning of the requested block)

Web3 Integration

Was this helpful?