eth_getProof - Mantle
Example code for the eth_getProof JSON-RPC method. Complete guide on how to use eth_getProof JSON-RPC in GetBlock Web3 documentation.
This method returns the account and storage values of the specified account including the Merkle proof. This is useful for verifying state without trusting the RPC provider.
Parameters
address
string
The address of the account
storageKeys
array
Array of storage keys to prove
blockNumber
string
Block number (hex) or tag
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": [
"0x201EBa5CC46D216Ce6DC03F6a759e8E766e956aE",
["0x0"],
"latest"
],
"id": "getblock.io"
}'import axios from 'axios';
const data = JSON.stringify({
"jsonrpc": "2.0",
"method": "eth_getProof",
"params": [
"0x201EBa5CC46D216Ce6DC03F6a759e8E766e956aE",
["0x0"],
"latest"
],
"id": "getblock.io"
});
const config = {
method: 'post',
url: 'https://go.getblock.io/<ACCESS-TOKEN>/',
headers: {
'Content-Type': 'application/json'
},
data: data
};
axios(config)
.then(response => console.log(JSON.stringify(response.data)))
.catch(error => console.log(error));Response
Response Parameters
address
string
The address of the account
accountProof
array
Array of RLP-serialized Merkle proof nodes
balance
string
Account balance in wei (hex)
codeHash
string
Hash of the account code
nonce
string
Account nonce (hex)
storageHash
string
Storage root hash
storageProof
array
Array of storage proofs
Use Case
The eth_getProof method is essential for:
Light client verification
Trustless state validation
Cross-chain bridges
State proof verification
Decentralized applications requiring proof
Error Handling
403
Forbidden
Missing or invalid ACCESS-TOKEN
-32602
Invalid params
Invalid address or storage keys
Web3 Integration
Last updated
Was this helpful?