eth_getProof — Polygon JSON-RPC

Status: Available

Returns a Merkle-Patricia proof that a given account — and optionally specific storage slots — is included in the Polygon state trie at a chosen block.

POSThttps://triport.io/polygon
Network
Polygon
Scope
polygon_read_rpc
Auth
x-token: $TRIPORT_API_KEY (or Authorization: Bearer)
Rate limit
free (15 rps) · basic (20 rps) · pro (100 rps) · business (250 rps)

Endpoint and plans: Polygon RPC endpoint.

eth_getProof implements EIP-1186. It returns the account's value (balance, nonce, code hash, storage root) together with the cryptographic proof needed to verify those values against the block's stateRoot — and, for each storage key you pass, the slot value plus its proof against the account's storageHash.

Use it whenever a client needs to trust the state without trusting the provider: Polygon PoS bridge L1↔L2 state verification, light-client SDKs (e.g. Helios-style verifying clients), and any flow that re-checks a balance or storage slot against a known block hash. A verifier walks accountProof from the stateRoot down to the account, then walks each storageProof[].proof from storageHash down to the slot.

Gotchas. The response grows with the number of storage keys — each key adds its own value plus a full proof branch, so a request for hundreds of keys can return tens of kilobytes. Request only the slots you actually verify. Proofs are block-specific: pin an explicit block number or hash for reproducible verification rather than relying on latest, which advances every block (~2 s on Polygon). Available from the Free trial up; no daily cap applies — limits are requests-per-second per tier with short bursts.

Parameters

Positional params array: [address, storageKeys, blockTag].

addressstring (20-byte hex)required
Account to prove, e.g. 0x0000000000000000000000000000000000001010 (Polygon native token contract).
storageKeysarray of string (32-byte hex)required
Storage slot keys to prove. Pass [] for an account-only proof.
blockTagstringrequired
Block number in hex (0x...), or a tag: latest, earliest, pending, safe, finalized.

Response

Response fields

FieldTypeDescription
addressstringThe account the proof is for.
balancestring (hex)Account balance in wei at the requested block.
noncestring (hex)Account nonce.
codeHashstring (hex)Keccak-256 hash of the account's code (0xc5d246...b855a4 for accounts with no code).
storageHashstring (hex)Root of the account's storage trie; verify storageProof entries against this.
accountProofarray of stringRLP-encoded trie nodes from the state root down to the account.
storageProofarray of objectOne entry per requested storage key.
storageProof[].keystring (hex)The requested storage slot key.
storageProof[].valuestring (hex)The slot value at the requested block.
storageProof[].proofarray of stringRLP-encoded trie nodes from storageHash down to the slot.

Errors

Errors are returned in the standard JSON-RPC envelope. See errors.md for the full shape and the data payload fields.

CodeMeaningWhen it happens
401trial_expiredThe trial period for the key has ended.
403tier_insufficientThe key's tier does not grant this method.
429rate_limitedPer-second limit for your tier exceeded; honor retry_after_sec.
401subscription_expiredThe subscription tied to the key has lapsed.
401unauthorizedMissing or invalid Authorization bearer token.
HTTP 403method_unknownMethod not available on this network/key.

Examples

JavaScript (fetch)

const res = await fetch("https://triport.io/polygon", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.TRIPORT_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    jsonrpc: "2.0",
    id: 1,
    method: "eth_getProof",
    params: [
      "0x0000000000000000000000000000000000001010",
      ["0x0000000000000000000000000000000000000000000000000000000000000000"],
      "latest",
    ],
  }),
});


const { result } = await res.json();
console.log(result.storageHash, result.storageProof[0].value);

Notes

  • Pin the block. For reproducible bridge or light-client verification, pass an explicit hex block number instead of latest so the proof matches a known stateRoot.
  • Payload scales with keys. Each entry in storageKeys adds a value and a full proof branch. Batch only the slots you verify; request account-only proofs with [] when you don't need storage.
  • Verifying a slot means walking storageProof[i].proof from storageHash to the leaf, and accountProof from the block's stateRoot to storageHash — both must check out for the value to be trusted.
  • Related methods: eth_getStorageAt for an unproven slot read and eth_getBalance for an unproven balance read.