eth_getProof

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

Request

curl 'https://rpc.web3api.io?x-api-key=YOUR-API-KEY' \
    -X POST \
    -H 'x-amberdata-blockchain-id: ethereum-mainnet' \
    -d '{"jsonrpc":"2.0","id":1,"method":"eth_getProof","params":["0x1234567890123456789012345678901234567890",["0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001"],"latest"]}'

Index

Description

0 - address

The address of the account or contract.

1 - storageKeys

The array of storage-keys which should be proofed and included. See eth_getStorageAt.

2 - blockNumber

The integer block number, or the string "latest" or "earliest", see the default block parameter.

Response

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "address": "0x1234567890123456789012345678901234567890",
        "accountProof": [
            "0xf9021...",
            "0xf9021...",
            "0xf9021...",
            "0xf9021...",
            "0xf9021...",
            "0xf9021...",
            "0xf8518...",
            "0xf871a...",
            "0xf86e9...0"
        ],
        "balance": "0xe55346d49c50e0b5",
        "codeHash": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
        "nonce": "0x0",
        "storageHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
        "storageProof": [
            {
                "key": "0x0000000000000000000000000000000000000000000000000000000000000000",
                "value": "0x0",
                "proof": []
            },
            {
                "key": "0x0000000000000000000000000000000000000000000000000000000000000001",
                "value": "0x0",
                "proof": []
            }
        ]
    }
}

Field

Description

result

An account object.

address

The address of the account or contract.

accountProof

Array of rlp-serialized MerkleTree-Nodes, starting with the stateRoot-Node, following the path of the SHA3 (address) as key.

balance

The balance of the account. See eth_getBalance.

codeHash

The hash of the code of the account. For a simple Account without code it will return "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470".

nonce

The nonce of the account. See eth_getTransactionCount.

storageHash

The SHA3 of the StorageRoot. All storage will deliver a MerkleProof starting with this rootHash.

storageProof

Array of storage-entries as requested.

key

The requested storage key.

value

The storage value proof.

proof

Array of rlp-serialized MerkleTree-Nodes, starting with the storageHash-Node, following the path of the SHA3 (key) as path.