eth_getProof

Returns the account and storage values of the specified account including the Merkle-proof.

This method will use 20 Compute Units.


Reference: Here

Parameters

  1. address- String - The address of the account for which the balance is to be checked.

  2. storageKeys - Array[Strings] - An array of storage-keys that should be proofed and included.

  3. blockNumber - String - The block number as a string in hexadecimal format or the string "latest", "earliest" or "pending", see the default block parameter.

Returns

  • address - The address associated with the account.

  • accountProof - An array of rlp-serialized MerkleTree-Nodes which starts with the stateRoot-Node and follows the path of the SHA3 address as key.

  • balance - The current balance of the account in wei.

  • codeHash - A 32 byte hash of the code of the account.

  • nonce - The hash of the generated proof-of-work. Null if pending.

  • storageHash - A 32 byte SHA3 of the storageRoot. All storage will deliver a MerkleProof starting with this rootHash.

  • storageProof - An array of storage-entries as requested. Each entry is an object with the following fields:

    • key - The requested storage key.

    • value - The storage value.

    • proof - An array of rlp-serialized MerkleTree-Nodes which starts with the stateRoot-Node and follows the path of the SHA3 address as key.

// Result
{
	"jsonrpc": "2.0",
	"result": {
		"address": "0x7f0d15c7faae65896648c8273b6d7e43f58fa842",
		"accountProof": [
			"0xf90211a0bc2a27363825400c6eee8abc0eadd7a4a3ab422114c9838c80f8742560f7db6aa0d5a7e0904e5d7ebaac761d2e130b020eeeebf...
			...
		],
		"balance": "0x0",
		"codeHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
		"nonce": "0x0",
		"storageHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
		"storageProof": [
			{
				"key": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
				"value": "0x0",
				"proof": []
			}
		]
	},
	"id": 1
}		
curl https://testnet.berachain.validationcloud.io/v1/<YOUR_API_KEY_HERE> \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0", "method": "eth_getStorageAt", "params": ["0x56310c8452f5bBEa41cD5d351829c304Ac0279b7", "0x0", "latest"], "id": 1}'

Last updated