BNB Smart Chain
eth_getUncleCountByBlockNumber
Chain ID 56 finalizes one canonical block per PoSA slot in roughly three seconds, paying gas in BNB, and never accumulates competing sibling blocks along the way. eth_getUncleCountByBlockNumber, issued against https://bsc.therpc.io/YOUR_API_KEY, is documented to count the ommers a block references when you address that block by height or by a tag like latest. Whether you name the block by number or by hash makes no difference to the result. PoSA forks no uncles, so this variant stays an Ethereum-compatibility shim that hands back 0x0 at every height you ask about.
Use cases
- Iterate a contiguous span of block heights to tally uncle presence and derive an uncle rate; across BNB Smart Chain that tally stays pinned at zero, evidencing PoSA's fork-free design.
- Run a fast gate before requesting uncle details with
eth_getUncleByBlockNumberAndIndex; a0x0count tells you up front there is nothing further to fetch at that height.
Parameters
| # | Name | Type | Required | Description |
|---|---|---|---|---|
| 1 | blockTag | string | Yes | The block to count uncles in. |
Response
| Type | Description |
|---|---|
| string (hex) | Hex-encoded uncle count. |
Example request
Try it live in the BNB Smart Chain playground.
Errors & troubleshooting
| Code | Message | Cause |
|---|---|---|
-32602 | Invalid params | Block tag is malformed or unrecognised. |
Common pitfalls
- Under PoSA, BNB Smart Chain returns
0x0for every height regardless of which block you name, so never branch on the expectation of a positive count. - The value arrives as a hex string, not an integer; decode
0x0to a number before any numeric comparison or you risk comparing strings by accident.
Supported networks
- Mainnet — Chain ID: 56
- Testnet — Chain ID: 97
See also
Parameters
hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"