eth_getProof - BSC

Example code for the eth_getProof JSON RPC method. Сomplete 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 on the BNB Smart Chain. This is useful for verifying state without trusting the RPC provider.

Parameters

Parameter
Type
Required
Description

address

string

Yes

Account address

storageKeys

array

Yes

Array of storage keys

blockNumber

string

Yes

Block number or "latest"

Request Example

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_getProof",
    "params": [
        "0x55d398326f99059fF775485246999027B3197955",
        ["0x0"],
        "latest"
    ],
    "id": "getblock.io"
}'

Response Example

Response Parameters

Field
Type
Description

accountProof

array

Array of proof nodes

balance

string

Account balance

codeHash

string

Code hash

nonce

string

Account nonce

storageHash

string

Storage root hash

storageProof

array

Storage proofs

Use Cases

  • Verify account state without trust

  • Light client implementations

  • Cross-chain bridges

  • State verification for rollups

Error Handling

Error Code
Description

-32602

Invalid params

-32603

Internal error

SDK Integration

Last updated

Was this helpful?