BNB Smart Chain

BNB Smart Chain

net_version

BNB Smart Chain settles BNB-paid fees and BEP-20 transfers under PoSA consensus. When you need to confirm a node is wired to the right one, net_version is the quickest check. It returns the network ID of the connected chain as a decimal string. On BNB Smart Chain mainnet that string is exactly "56", and the testnet answers "97". Send the request to https://bsc.therpc.io/YOUR_API_KEY against chain ID 56 and a correctly configured mainnet node replies with "56". The value arrives as a plain decimal string rather than a hex quantity, so comparing it directly in client code takes no extra parsing.

Use cases

  • Verify a wallet or dApp points at BNB Smart Chain mainnet, expecting "56", before broadcasting a BNB-funded transaction.
  • Branch environment-aware logic on the returned string, treating "56" as production mainnet and "97" as the testnet sandbox.

Parameters

This method takes no parameters. Pass an empty array [].

Response

TypeDescription
stringDecimal string network ID, e.g. `"1"` for Ethereum mainnet. Note: network ID and chain ID coincide on most networks but can differ.

Example request

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

Try it live in the BNB Smart Chain playground.

Errors & troubleshooting

Common pitfalls

  • Network ID and chain ID happen to coincide on BNB Smart Chain at 56, but they are distinct concepts that diverge on some networks, so always rely on eth_chainId for the value baked into transaction signatures.
  • This response is a decimal string, unlike the hex-encoded quantities most numeric RPC methods return, so do not feed it through a hex parser before comparing.

Supported networks

  • Mainnet — Chain ID: 56
  • Testnet — Chain ID: 97

See also

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

Ready to call this in production?

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