Defined in the Ethereum JSON-RPC Specification
Returns the account and storage values of the specified account including the Merkle-proof.
Parameters
The address of the account (20 bytes).
Array of storage-keys which should be proofed and included.
Integer block number, or the string “latest”, “earliest” or “pending”.
Returns
The proof object containing account and storage proofs.Show Proof object properties
The address of the account.
Array of rlp-serialized MerkleTree-Nodes, starting with the stateRoot-Node.
The balance of the account.
Hash of the code of the account.
Array of storage proof objects.Show Storage proof properties
The requested storage key.
Array of rlp-serialized MerkleTree-Nodes.
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_getProof",
"params": [
"0x407d73d8a49eeb85d32cf465507dd71d507100c1",
["0x0000000000000000000000000000000000000000000000000000000000000000"],
"latest"
]
}
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"address": "0x407d73d8a49eeb85d32cf465507dd71d507100c1",
"accountProof": [
"0xf90211a0...",
"0xf90211a0..."
],
"balance": "0x0",
"codeHash": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
"nonce": "0x0",
"storageHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"storageProof": [
{
"key": "0x0000000000000000000000000000000000000000000000000000000000000000",
"value": "0x0",
"proof": [
"0xf90211a0..."
]
}
]
}
}
Error Handling
Code | Message | Description |
---|
-32602 | Invalid parameters | Invalid address, storage keys, or block parameter |
4100 | Requested method not supported | The method is not supported by the wallet |
This method is useful for verifying account states and storage values using Merkle proofs without trusting the provider.