bor_getRootHash
Last updated:
`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
This method takes no parameters.
Returns
| Field | Type |
|---|---|
| result | object |
Examples
curl https://<your-endpoint>/ \
-X POST -H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"bor_getRootHash","params":[]}'const res = await fetch("https://<your-endpoint>/", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"id": 1,
"method": "bor_getRootHash",
"params": [],
"jsonrpc": "2.0"
}),
});
const data = await res.json();import requests
resp = requests.post("https://<your-endpoint>/", json={"id":1,"method":"bor_getRootHash","params":[],"jsonrpc":"2.0"})
print(resp.json())Usage
- Transport: HTTP (JSON-RPC).
- Networks: mainnet.
- Credit cost: 1 per call.
FAQ
- What does bor_getRootHash do?
- Returns 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.
- How many credits does bor_getRootHash cost?
- bor_getRootHash costs 1 credit(s) per call on Triport by default.
- Is bor_getRootHash available over WebSocket?
- bor_getRootHash is an HTTP JSON-RPC method.