Updated on 2024-11-14 GMT+08:00

eth_getProof

Introduction

This API returns the account and storage values, including the Merkle proof, of the specified account. It consumes 43 CUs.

Parameter Description

Parameter

Type

Description

Address

String

A 20-byte string of the storage address from which the bytecode will be obtained.

Storage keys

Array

An array of 32-byte storage keys to be proofed and included.

Block number

String

A hexadecimal block number, or the string (earliest, latest, or pending).

Return Value

  • address: the address related to the account.
  • accountProof: an array of RLP-serialized MerkleTree-Nodes, starting with the stateRoot-Node, following the path of the SHA3 (address) as key.
  • balance: a hexadecimal value of the current balance in wei.
  • codeHash: the 32-byte hash of the code of the account.
  • nonce: the nonce of the account.
  • storageHash: 32 bytes. The SHA3 of the StorageRoot. All storage will deliver a Merkle proof starting with this rootHash.
  • storageProof: an array of storage-entries as requested. Each entry is an object with these properties:
    • key: the requested storage key.
    • value: the storage value.
    • proof: an array of RLP-serialized MerkleTree-Nodes, starting with the storageHash-Node, following the path of the SHA3 (key) as path.

Request

curl https://your-http-endpoint/v1/<API-KEY> \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc": "2.0","method": "eth_getProof","id": 1,"params": ["0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", ["0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"], "latest"]}'