bor_getRootHash
https://api.triport.io/polygonReturns the Bor consensus root hash that commits a contiguous range of Polygon blocks — the proof input the Polygon PoS bridge uses for L1↔L2 state sync.
bor_getRootHash computes the Bor root hash over a block range [fromBlock, toBlock]. The root hash is a single 32-byte digest that commits to every block
header in that window; it is the value the Polygon PoS bridge anchors on
Ethereum so that L1 can verify L2 state without replaying individual blocks.
Use it when you are generating state-sync proofs for the Polygon bridge, or when
you need a compact commitment over a span of Polygon blocks for your own
verification pipeline. This is a Bor-consensus-specific method: it exposes
Polygon's bor namespace, which is not part of the standard Geth/EVM RPC
surface.
The range is bounded — a single call typically accepts at most 256 blocks
(roughly nine minutes of Polygon block time). For longer spans, iterate in
chunks of ≤256 blocks and combine the results downstream. This method supersedes
the deprecated eth_getRootHash alias; new integrations should call
bor_getRootHash directly.
Parameters
Positional parameters: the inclusive start and end block numbers of the range.
fromBlockinteger (uint)requiredtoBlockinteger (uint)requiredfromBlock, and the span toBlock - fromBlock + 1 must not exceed the range cap (typically 256).Response
Response fields
| Field | Type | Description |
|---|---|---|
result | string | The Bor root hash committing the requested block range — a 32-byte hex digest. Feed this value into the PoS bridge proof or your own range-commitment check. |
Errors
| Code | Meaning | When it happens |
|---|---|---|
-32002 | tier_insufficient | Your API key's tier is below Pro, so the premium bor namespace is not enabled for it. |
-32003 | rate_limited | You exceeded your tier's per-second budget (including the burst allowance) for this method. Back off and retry. |
See the shared error envelope reference for the full error object shape and handling guidance.
Examples
JavaScript (fetch)
const res = await fetch("https://api.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: "bor_getRootHash",
params: [50000000, 50000255],
}),
});
const { result } = await res.json();
console.log("root hash:", result);TypeScript SDK (@triport/sdk)
import { Triport } from "@triport/sdk";
const triport = new Triport({ apiKey: process.env.TRIPORT_API_KEY! });
const rootHash = await triport.polygon.request("bor_getRootHash", [
50000000,
50000255,
]);Python (triport-sdk)
import os
from triport import Triport
triport = Triport(api_key=os.environ["TRIPORT_API_KEY"])
root_hash = triport.polygon.request(
"bor_getRootHash",
[50000000, 50000255],
)
print("root hash:", root_hash)Notes
- Range cap. Keep
toBlock - fromBlock + 1at or below the per-call limit (typically 256 blocks). To commit a longer span, split it into ≤256-block chunks and iterate — request each chunk's root hash separately. - Deprecated alias.
eth_getRootHashreturns the same value but lives in theethnamespace and is deprecated; it is not served on this surface. Usebor_getRootHash. - Related Bor methods. For validator-set and proposer state, see the other
bor-namespace methods on Polygon (bor_getCurrentValidators,bor_getCurrentProposer,bor_getSnapshot,bor_getAuthor,bor_getSigners), which share thepolygon_borscope and Pro-tier requirement.