TriportRPC

eth_getRootHash (deprecated)

Legacy `eth`-namespace alias for the Polygon Bor root-hash call; **deprecated — use [`bor_getRootHash`](./bor_getRootHash.md) instead.**

Polygonpolygon_borPro tier (premium bor namespace; low per-method RPS)

eth_getRootHash is a legacy alias for bor_getRootHash. It computes the Bor checkpoint root hash over an inclusive block range (fromBlock, toBlock). That root hash is consumed by the Polygon PoS bridge to generate state-sync / withdrawal proofs between Polygon and its L1 settlement layer.

The functionality is a Polygon Bor-consensus extension, not part of the standard EVM eth namespace. Because of that, the method only ever responds on Bor-backed nodes. On standard Geth / Erigon backends — and on all of Triport's free read canals — it returns -32601 (method not found). The spec marks this method deprecated: true.

Use bor_getRootHash instead. The migration is a one-line change: swap the method name from eth_getRootHash to bor_getRootHash. Parameters, result shape, range limits, required scope (polygon_bor), and tier are all identical.

Parameters

Positional params array, identical to bor_getRootHash.

fromBlockintegerrequired
First block of the range (inclusive).
toBlockintegerrequired
Last block of the range (inclusive).

Response

On a Bor-backed endpoint the result is the hex-encoded root hash (no 0x-prefixed eth_-style framing — a bare 64-char hex string, matching bor_getRootHash):

In practice, on standard backends and free canals you will instead receive a method-not-found error (see Errors).

resultstring
Bor checkpoint root hash for the requested (fromBlock, toBlock) range, as a hex string.

Errors

CodeMeaningWhen it happens
-32601Method not foundThe standard case for this deprecated alias. Returned by non-Bor backends and on free canals. Migrate to bor_getRootHash.
-32602Invalid paramsfromBlock/toBlock missing, out of order, or the range exceeds the allowed window.
401UnauthorizedMissing or invalid Authorization: Bearer API key.
403Forbidden / insufficient scopeKey lacks the polygon_bor scope or is below Pro tier.
429Too Many RequestsPer-tier RPS limit exceeded (burst-limited; no daily quota).

See the shared errors reference for the full error envelope and retry guidance.

Examples

JavaScript (fetch)

// DEPRECATED — shown for reference only. Use "bor_getRootHash" in new code.
const res = await fetch("https://api.triport.io/json-rpc/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_getRootHash", // ← replace with "bor_getRootHash"
    params: [0, 255],
  }),
});
const { result, error } = await res.json();
if (error) throw new Error(`${error.code}: ${error.message}`);

TypeScript SDK (@triport/sdk)

import { TriportClient } from "@triport/sdk";


const client = new TriportClient({ apiKey: process.env.TRIPORT_API_KEY! });


// Deprecated alias — prefer client.polygon.rpc("bor_getRootHash", ...)
const rootHash = await client.polygon.rpc<string>("bor_getRootHash", [0, 255]);

Python (triport-sdk)

import os
from triport_sdk import TriportClient


client = TriportClient(api_key=os.environ["TRIPORT_API_KEY"])


# Deprecated alias — prefer "bor_getRootHash".
root_hash = client.polygon.rpc("bor_getRootHash", [0, 255])

Notes

  • Migration: rename the method only.

    - "method": "eth_getRootHash"
    + "method": "bor_getRootHash"

    Everything else — params [fromBlock, toBlock], the result hash, the polygon_bor scope, and the Pro tier requirement — is unchanged. See bor_getRootHash.

  • Bor extension, not EVM. Despite the eth_ prefix, this is a Bor-consensus-specific method. A 0x…/hex root-hash response (rather than -32601) is effectively a fingerprint of a Bor-backed node.

  • Bridge dependency. The root hash feeds Polygon PoS bridge proof generation for L1 ↔ L2 state sync. Most bridge SDKs already call bor_getRootHash directly.

  • Related: bor_getRootHash · bor_getSnapshot · bor_getCurrentValidators.