eth_getRootHash (deprecated)
Legacy `eth`-namespace alias for the Polygon Bor root-hash call; **deprecated — use [`bor_getRootHash`](./bor_getRootHash.md) instead.**
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.
fromBlockintegerrequiredtoBlockintegerrequiredResponse
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(fromBlock, toBlock) range, as a hex string.Errors
| Code | Meaning | When it happens |
|---|---|---|
-32601 | Method not found | The standard case for this deprecated alias. Returned by non-Bor backends and on free canals. Migrate to bor_getRootHash. |
-32602 | Invalid params | fromBlock/toBlock missing, out of order, or the range exceeds the allowed window. |
401 | Unauthorized | Missing or invalid Authorization: Bearer API key. |
403 | Forbidden / insufficient scope | Key lacks the polygon_bor scope or is below Pro tier. |
429 | Too Many Requests | Per-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, thepolygon_borscope, and the Pro tier requirement — is unchanged. Seebor_getRootHash. -
Bor extension, not EVM. Despite the
eth_prefix, this is a Bor-consensus-specific method. A0x…/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_getRootHashdirectly. -
Related:
bor_getRootHash·bor_getSnapshot·bor_getCurrentValidators.