eth_getProof | Fantom

Fantom API method that returns a Merkle proof for a specific account, contract storage, or both for a given block. Merkle proofs enable users to verify the existence and authenticity of data within a Merkle trie, a data structure that helps optimize and secure data retrieval in blockchains.


eth_getProof requires an archive node.


Get you own node endpoint today

Start for free and get your app to production levels immediately. No credit card required.

You can sign up with your GitHub, X, Google, or Microsoft account.


  • address β€” Ethereum address of the account for which the proof is requested.

  • array β€” the array of 32-byte storage keys that need to be proven and included. See eth_getStorageAt.

  • quantity or tag β€” the integer of a block encoded as hexadecimal or the string with:

    • latest β€” the most recent block in the blockchain and the current state of the blockchain at the most recent block. A chain reorganization is to be expected.

    • safe β€” the block that received justification from the beacon chain. Although this block could be involved in a chain reorganization, it would necessitate either a coordinated attack by the majority of validators or an instance of severe propagation latency.

    • finalized β€” the block accepted as canonical by more than 2/3 of the validators. A chain reorganization is extremely unlikely, and it would require at least 1/3 of the staked ETH to be burned.

    • earliest β€” the earliest available or genesis block.

    • pending β€” the pending state and transactions block. The current state of transactions that have been broadcast to the network but have not yet been included in a block.


      See the default block parameter and How The Merge Impacts Ethereum’s Application Layer.


  • balance β€” represents the account balance. Refer to eth_getBalance.
  • codeHash β€” indicates the code hash associated with the account. For a simple account without any code, the value will be 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470.
  • nonce β€” refers to the account's nonce. See eth_getTransactionCount.
  • storageHash β€” represents the SHA3 hash of the StorageRoot. All storage data will provide a Merkle proof that starts with this rootHash. This hash serves as the starting point for obtaining a Merkle proof for all storage entries linked to the account.
  • accountProof β€” an array of RLP-serialized Merkle trie nodes, starting with the stateRoot node and following the path of the SHA3 (address) as the key, which can be used to verify the existence and authenticity of data within the trie.
  • storageProof β€” contains the requested storage entries in an array, with each entry being an object that includes the following properties:
    • key β€” the requested storage key
    • valueβ€” the value associated with the storage key
    • proof β€” an array of RLP-serialized Merkle trie nodes, starting with the storageHash node and following the path of the SHA3 (key), which can be used to verify the existence and authenticity of data within the trie.

eth_getProof code examples

The following examples retrieve the Merkle proof for the USDC contract.

const { Web3 } = require("web3");
const web3 = new Web3(new Web3.providers.HttpProvider(NODE_URL);

async function getProof() {
    // Gets the Merkle proof of USDT's smart contract
    const proof = await web3.eth.getProof(
        "0x8965349fb649A33a30cbFDa057D8eC2C48AbE2A2", [
                        //Storage slot hash, value = keccak256(storage address + slot index)
    const block = await web3.eth.getBlock("latest")
    //state root is very important for Merkel verification
    const stateRoot = block.stateRoot

        console.log("state root:" + stateRoot)

const ethers = require('ethers');
const provider = new ethers.JsonRpcProvider(NODE_URL);

async function getProof() {
    // Get the storage slot hash (value = keccak256(storage address + slot index))
    const storageSlotHash = '0x9c7fca54b386399991ce2d6f6fbfc3879e4204c469d179ec0bba12523ed3d44c';

    // Define the contract address for USDT
    const contractAddress = '0x8965349fb649A33a30cbFDa057D8eC2C48AbE2A2';

    // Get the Merkle proof of USDT's smart contract using a custom JSON-RPC call
    const proof = await provider.send('eth_getProof', [contractAddress, [storageSlotHash], 'latest']);

    const block = await provider.send("eth_getBlockByNumber", ["latest",false]);
    // The state root is crucial for Merkle verification
    const stateRoot = block.stateRoot;

    console.log('state root:', stateRoot);

from web3 import Web3
web3 = Web3(Web3.HTTPProvider(httpUrl))

proof = web3.eth.get_proof('0x8965349fb649A33a30cbFDa057D8eC2C48AbE2A2', ["0x9c7fca54b386399991ce2d6f6fbfc3879e4204c469d179ec0bba12523ed3d44c"], "latest")


Read Deep dive into Merkle proofs and eth_getProof to learn more about the Merkle trie and how to use eth_getProof.

Use case

A use case for the eth_getProof method can be when a decentralized application (DApp) interacts with a smart contract on the Ethereum blockchain. The DApp needs to verify the state of the contract's storage variables without downloading the entire blockchain data. By using eth_getProof, the DApp can request Merkle proof for specific storage slots in the contract. This proof can then be used to cryptographically verify the authenticity and accuracy of the storage data, ensuring the DApp is working with the correct contract state.

Try eth_getProof yourself

Click Try It! to start a request and see the response here!