eth_getProof - Base Chain JSON-RPC Method
Overview
The eth_getProof
method retrieves Merkle proofs for an account's state (balance, nonce, code) and requested storage values on the Base chain. These cryptographic proofs allow verification that specific data exists within the Base blockchain without requiring trust in the data provider.
Parameters
-
address
- String - The address of the account to retrieve the Merkle proof for -
storageKeys
- Array [Strings] - An array of storage keys to retrieve values for (each key is a position in the account's storage) -
blockNumber
- Block number as hexadecimal or Tag (String) "latest", "earliest", or "pending"
Note: Unlike Ethereum and Arbitrum One chains, the "safe" and "finalized" tags are not available on Base chain.
Need RPC API keys?
Get 12.5M archival requests for free today.
Returns
-
address
- String - The address of the account that the proof is for -
accountProof
- Array - RLP-serialized Merkle tree nodes proving the account's existence and state -
balance
- The account's balance in wei at the specified block -
codeHash
- 32 Bytes - Hash of the contract code at the account address (or hash of empty string for non-contract accounts) -
nonce
- Current nonce value of the account -
storageProof
- Array of storage-entry proofs with these properties:key
- The requested storage keyvalue
- The storage value at that keyproof
- Array of RLP-serialized Merkle tree nodes proving the storage value exists
Request
POST https://base-mainnet.chainnodes.org/YOUR-API-KEY
Example
- HTTPS POST Request with a JSON RPC call in the body
- Replace YOUR-API-KEY with the API key from your Chainnodes.org Dashboard
- You can use a different supported network by replacing
base-mainnet
curl https://base-mainnet.chainnodes.org/YOUR-API-KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getProof","params": ["0x4200000000000000000000000000000000000006",["0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001"], "latest"],"id":1}'
💡 Confusing?
Ask our experienced blockchain developers in Telegram
Body
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"address": "0x4200000000000000000000000000000000000006",
"accountProof": [
"0xf90211a0...",
"0xf90211a0...",
"0xf90211a0...",
"0xf90211a0...",
"0xf90211a0...",
"0xf90211a0...",
"0xf90211a0...",
"0xf90191a0...",
"0xf8669d..."
],
"balance": "0x0",
"codeHash": "0x3b25a38e97bba2cbc73f58909d81158ca84464a5505bc33d73fe57d91018the4",
"nonce": "0x1",
"storageHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"storageProof": [
{
"key": "0x0000000000000000000000000000000000000000000000000000000000000000",
"value": "0x000000000000000000000000000000000000000000000000000000000000000a",
"proof": [
"0xf90211a0...",
"0xf90211a0...",
"0xf8669d..."
]
},
{
"key": "0x0000000000000000000000000000000000000000000000000000000000000001",
"value": "0x0000000000000000000000000000000000000000000000000000000000000001",
"proof": [
"0xf90211a0...",
"0xf90211a0...",
"0xf8669d..."
]
}
]
}
}
Common Use Cases
-
Cross-Chain Verification
// Get proof of ETH balance on Base for a bridge verification {"jsonrpc":"2.0","method":"eth_getProof","params":["0xYourAddress",[], "latest"],"id":1}
-
Smart Contract State Verification
// Verify token balance storage slot for a specific account {"jsonrpc":"2.0","method":"eth_getProof","params":["0xTokenContractAddress",["0x...storageSlotForBalance"], "latest"],"id":1}
-
Historical State Verification
// Verify account state at a specific historical block {"jsonrpc":"2.0","method":"eth_getProof","params":["0xYourAddress",[], "0x500000"],"id":1}
-
L2 to L1 State Verification
// Generate proof needed for L1 verification of Base state {"jsonrpc":"2.0","method":"eth_getProof","params":["0x4200000000000000000000000000000000000006",["0x0"], "latest"],"id":1}
-
Storage Data Verification
// Verify multiple storage slots of a contract {"jsonrpc":"2.0","method":"eth_getProof","params":["0xContractAddress",["0x1","0x2","0x3"], "latest"],"id":1}
Base API Documentation by CHAINNODES is based on Reth node client. Contact us if you are interested in specific methods that are only available on geth, besu, Nethermind or Erigon