BNB Smart Chain

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.

Not available on this chainPoSA on BSC never leaves orphaned siblings behind, so this uncle count is always 0x0.

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; a 0x0 count tells you up front there is nothing further to fetch at that height.

Parameters

#NameTypeRequiredDescription
1blockTagstringYesThe block to count uncles in.

Response

TypeDescription
string (hex)Hex-encoded uncle count.

Example request

curl https://bsc.therpc.io/YOUR_API_KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getUncleCountByBlockNumber",
"params": ["latest"],
"id": 1
}'

Try it live in the BNB Smart Chain playground.

Errors & troubleshooting

CodeMessageCause
-32602Invalid paramsBlock tag is malformed or unrecognised.

Common pitfalls

  • Under PoSA, BNB Smart Chain returns 0x0 for 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 0x0 to 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"

curl https://bsc.therpc.io/YOUR_API_KEY \
-X POST \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_getUncleCountByBlockNumber","params":[""]}'

Ready to call this in production?

Free tier covers personal projects. Pay-as-you-go scales without a card.