Azxa
← Scroll overview

Scroll · eth

eth_getProof

Returns the merkle proof for a given account and optionally some storage keys.

Parameters

  • Address required
    Schema
    {
      "type": "string",
      "title": "hex encoded address",
      "pattern": "^0x[0-9a-fA-F]{40}$"
    }
  • StorageKeys required
    Schema
    {
      "type": "array",
      "title": "Storage keys",
      "items": {
        "type": "string",
        "title": "32 hex encoded bytes",
        "pattern": "^0x[0-9a-f]{0,64}$"
      }
    }
  • Block

    default: 'latest'

    Schema
    {
      "title": "Block number, tag, or block hash",
      "anyOf": [
        {
          "type": "string",
          "title": "Block number",
          "pattern": "^0x(0|[1-9a-f][0-9a-f]*)$"
        },
        {
          "type": "string",
          "title": "Block tag",
          "description": "`earliest`: The lowest numbered block the client has available; `finalized`: The most recent crypto-economically secure block, cannot be re-orged outside of manual intervention driven by community coordination; `safe`: The most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions; `latest`: The most recent block in the canonical chain observed by the client, this block may be re-orged out of the canonical chain even under healthy/normal conditions; `pending`: A sample next block built by the client on top of `latest` and containing the set of transactions usually taken from local mempool. Before the merge transition is finalized, any call querying for `finalized` or `safe` block MUST be responded to with `-39001: Unknown block` error",
          "enum": [
            "earliest",
            "finalized",
            "safe",
            "latest",
            "pending"
          ]
        },
        {
          "type": "string",
          "title": "Block hash",
          "pattern": "^0x[0-9a-f]{64}$"
        }
      ]
    }

Result

Account

Schema
{
  "type": "object",
  "title": "Account proof",
  "properties": {
    "accountProof": {
      "type": "array",
      "title": "accountProof",
      "items": {
        "type": "string",
        "title": "hex encoded bytes",
        "pattern": "^0x[0-9a-f]*$"
      }
    },
    "address": {
      "type": "string",
      "title": "address",
      "pattern": "^0x[0-9a-fA-F]{40}$"
    },
    "balance": {
      "type": "string",
      "title": "balance",
      "pattern": "^0x(0|[1-9a-f][0-9a-f]{0,63})$"
    },
    "codeHash": {
      "type": "string",
      "title": "codeHash",
      "pattern": "^0x[0-9a-f]{64}$"
    },
    "nonce": {
      "type": "string",
      "title": "nonce",
      "pattern": "^0x(0|[1-9a-f][0-9a-f]{0,15})$"
    },
    "storageHash": {
      "type": "string",
      "title": "storageHash",
      "pattern": "^0x[0-9a-f]{64}$"
    },
    "storageProof": {
      "type": "array",
      "title": "Storage proofs",
      "items": {
        "type": "object",
        "title": "Storage proof",
        "properties": {
          "key": {
            "type": "string",
            "title": "key",
            "pattern": "^0x[0-9a-f]{0,64}$"
          },
          "proof": {
            "type": "array",
            "title": "proof",
            "items": {
              "type": "string",
              "title": "hex encoded bytes",
              "pattern": "^0x[0-9a-f]*$"
            }
          },
          "value": {
            "type": "string",
            "title": "value",
            "pattern": "^0x(0|[1-9a-f][0-9a-f]{0,63})$"
          }
        },
        "required": [
          "key",
          "value",
          "proof"
        ]
      }
    }
  },
  "required": [
    "address",
    "accountProof",
    "balance",
    "codeHash",
    "nonce",
    "storageHash",
    "storageProof"
  ]
}

Example request

Endpoint: https://your-scroll-node.azxa.io

JSON-RPC
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_getProof",
  "params": [
    "0xe5cB067E90D5Cd1F8052B83562Ae670bA4A211a8",
    [
      "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
    ],
    "latest"
  ]
}
Example response
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "accountProof": [
      "0xf90211a06a718c2c9da77c253b12d7b2569657901e37bb691718f5dda1b86157ab1dd5eda0e7f1…37ffd414b98dda00b280",
      "0xf90211a0d360be1e1da1a0c32bc4c105833bd531e59d110684007b7c50fb2709002973eca0cf6d…03b8176a53f89d4a6680",
      "0xf90211a0b25f283bd01a8c8b2418049f9585bc37ff2c1e2e12eab4b7f64ae1f26647389aa02ad9…fe81ba06e7e8d4366680",
      "0xf90211a00e99ba2198124b8241ea304551fe973215829e2fbc0438d67922707a2a847432a0bb9c…ea12e15bab62c4e1e580",
      "0xf90211a0af0c7fa65ffcb84c31e68c1cf00e1a20bf8bb497c39883e19b66a99975b03431a0c492…975fab1f08bdb2046580"
    ],
    "address": "0xe5cB067E90D5Cd1F8052B83562Ae670bA4A211a8",
    "balance": "0x0",
    "codeHash": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
    "nonce": "0x0",
    "storageHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
    "storageProof": [
      {
        "key": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
        "proof": [
          "0xf90211a0c87222cccea2bf32759fcee9dbaacbe3ea4165dd6184af6773651c5e00e34a8ba0be90…c52180eef08ef200f280",
          "0xf90191a0f0c5b800b542001597f2b7a8e106ac0e2849d2cc1df1727ac35c4ea3965f1c9180a085…0385f025650731808080"
        ],
        "value": "0x1"
      }
    ]
  }
}

Test fixture

Fixture: get-account-proof-blockhash

Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_getProof",
  "params": [
    "0x7dcd17433742f4c0ca53122ab541d0ba67fc27df",
    [],
    "0xd226371d0b1551adb03fb52b71f08e3e11247fe9b1af994768af8cdaa8e7dcd7"
  ]
}
Response
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "address": "0x7dcd17433742f4c0ca53122ab541d0ba67fc27df",
    "accountProof": [
      "0xf90211a03e7affd7171fd5da97f3c822aedb5a54883069214df918f0f8c19a3477835340a096ab…f388eca40abe70243e80",
      "0xf89180a02a2f71808bd7e7f11066619d43d6568a312e3de9666dd037b160a0fab523499080a059…e4ddb015e2a83559e680",
      "0xf869a0201f52c702c40589735c4b038bd94e04268a58c35afad63bb16c071d62d2e23db846f844…0e5fb900be63f41d54a2"
    ],
    "balance": "0x76",
    "codeHash": "0xa3216dd3ef46a63d518ef54e482cecac68a077f70fca0e5fb900be63f41d54a2",
    "nonce": "0x0",
    "storageHash": "0x7917ac1f1d6cd87c54aea239c6efbe5c8865659f0761c74e67f1c1eb837923bb",
    "storageProof": []
  }
}

cURL

curl -X POST https://your-scroll-node.azxa.io \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_getProof","params":["0xe5cB067E90D5Cd1F8052B83562Ae670bA4A211a8",["0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"],"latest"]}'
1

Select Chain

2

Desired Period

3

Contact Information

cross

Select Preferred Chain

BNB Smart Chain
Polygon
Tron
Arbitrum
Optimism
IoTeX
Gnosis
Fantom
Moonbeam
Polkadot
Avalanche
Bitcoin
Ethereum
Aptos
Other
cube

Other Chain

Continue
logo
cross
background