Summary
A Smart Chain RPC URL is the HTTP or WebSocket endpoint your wallet, dApp, or backend uses to read BNB Smart Chain state and broadcast transactions. It carries JSON-RPC calls such as eth_blockNumber, eth_getBalance, and eth_sendRawTransaction to a node that is synced with the network.
This page covers the BNB Smart Chain mainnet and testnet settings you need for wallet configuration, gives a working curl and JavaScript example, and explains when a public endpoint is enough versus when a managed RPC API or dedicated node is the better fit for production traffic.
When developers search for a "smart chain RPC URL," they usually mean BNB Smart Chain (BSC) and they need one of three things: a URL to paste into a wallet, a chain configuration block for a dApp, or a reliable endpoint for backend traffic. This page answers all three, then explains how to decide between a public endpoint and managed infrastructure.
Chain settings at a glance
BNB Smart Chain is an EVM-compatible network, so any tool that speaks Ethereum JSON-RPC works with it. The only difference is the endpoint URL, chain ID, and native token. Here are the values you need for mainnet and testnet.
| Setting | BNB Smart Chain Mainnet | BNB Chain Testnet |
|---|---|---|
| Chain ID | 56 | 97 |
| Chain name | BNB Smart Chain Mainnet | BNB Smart Chain Testnet |
| Native currency | BNB (18 decimals) | tBNB (18 decimals) |
| Block explorer | https://bscscan.com | https://testnet.bscscan.com |
| OnFinality public RPC | https://bnb.api.onfinality.io/public | https://bnb-testnet.api.onfinality.io/public |
| Transports | HTTP, WebSocket | HTTP |
If you are configuring a wallet, use the mainnet row. If you are testing a contract before deployment, use the testnet row and fund your address from a BNB Chain testnet faucet. The chain ID is what prevents a wallet from signing a mainnet transaction against a testnet endpoint, so keep the two sets of values separate in your config.
Quick recommendation: public endpoint or managed RPC?
Most readers can start with a public endpoint and move on. The decision only becomes interesting when traffic grows or when a single request starts failing.
- Use a public RPC URL for wallet setup, one-off scripts, hackathon prototypes, and low-volume read calls. The OnFinality public endpoints above are suitable for this and require no key.
- Use a managed RPC API when you have a frontend or backend that sends steady traffic, needs WebSocket subscriptions, or needs archive and trace methods. A managed provider handles node upgrades, sync, and failover so you do not have to.
- Use a dedicated node when you need predictable capacity, custom configuration, or isolation from other tenants' traffic. This is common for exchanges, indexers, and high-throughput bots.
If you are unsure which category you fall into, the RPC provider selection guide walks through the evaluation criteria in more detail. For a quick look at what OnFinality offers on BSC specifically, see the BNB Smart Chain network page.
Connecting with curl and JavaScript
The fastest way to confirm an endpoint works is a single JSON-RPC call. This asks the node for the latest block number.
curl -X POST https://bnb.api.onfinality.io/public \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}'
A healthy response looks like {"jsonrpc":"2.0","id":1,"result":"0x2a1f3c4"}. The result is hex-encoded, so convert it to decimal to compare against the current block on BscScan. If the number is far behind the explorer, you are talking to a node that is still syncing.
In JavaScript, the same call through a library is usually what your app will do:
import { JsonRpcProvider, formatEther } from "ethers";
const provider = new JsonRpcProvider("https://bnb.api.onfinality.io/public");
const blockNumber = await provider.getBlockNumber();
const balance = await provider.getBalance("0xYourAddressHere");
console.log("Block:", blockNumber);
console.log("Balance:", formatEther(balance), "BNB");
For WebSocket subscriptions such as newHeads or logs, switch the transport to wss:// against a provider that supports it. BNB Smart Chain mainnet supports both HTTP and WebSocket on OnFinality, while the testnet endpoint is HTTP only, so plan your subscription code accordingly.
Adding BNB Smart Chain to a wallet
Most wallets accept a custom network form. The fields map directly to the table above:
Network name: BNB Smart Chain
RPC URL: https://bnb.api.onfinality.io/public
Chain ID: 56
Symbol: BNB
Explorer: https://bscscan.com
Two mistakes are common here. First, entering the chain ID as a decimal string in a field that expects a number, or vice versa in code that expects hex. Second, copying a testnet RPC URL but leaving the chain ID at 56. If a wallet shows a balance of zero for an address you know holds BNB, check the chain ID before anything else.
Common failure modes and how to read them
When an RPC URL stops behaving, the error usually points at the cause. This table maps symptoms to likely fixes.
| Symptom | Likely cause | What to try |
|---|---|---|
429 Too Many Requests | Public endpoint rate limiting | Move to a managed RPC API or dedicated node |
eth_getLogs returns partial results | Block range too wide for the endpoint | Narrow the range or use an archive-capable provider |
| Transactions stuck as pending | Nonce or gas price issue, not the URL | Check nonce handling and gas settings |
method not found | Method not enabled on that endpoint | Confirm trace/debug support with your provider |
| WebSocket disconnects | Idle timeout or transport not supported | Reconnect logic, or confirm wss:// support |
| Block number far behind | Node still syncing | Switch endpoint or wait for sync |
Notice that only some of these are actually about the URL. A stuck transaction or a wrong nonce is an application bug, not an endpoint problem. Before you rotate endpoints, confirm the failure is on the transport side.
What changes at production scale
A public endpoint is shared. That is fine until your traffic grows, at which point you start competing with other users for the same capacity. The symptoms are subtle at first: occasional slow responses, then intermittent 429s, then failed requests during network congestion.
Managed RPC APIs address this by giving you a keyed endpoint with higher limits and a support path. Dedicated nodes go further by giving your workload its own node, which matters when you need consistent throughput, archive data, or trace methods that shared endpoints often restrict.
OnFinality provides both managed RPC API access and dedicated node infrastructure across a range of networks, including BNB Smart Chain. You can review RPC pricing to compare tiers and see the full list of supported RPC networks if your app spans more than one chain.
Migration checkpoints
If you are moving from a public endpoint to a managed or dedicated one, work through these checkpoints so the switch does not break anything:
- Inventory your methods. List every JSON-RPC method your app calls. Flag any trace, debug, or archive calls, since these are the ones most likely to need a different tier.
- Check transport needs. If you use WebSocket subscriptions, confirm the new endpoint supports
wss://before you cut over. - Test on testnet first. Point a staging environment at the BNB Chain testnet endpoint and run your integration tests there.
- Add failover. Configure a secondary endpoint so a single provider outage does not take your app down.
- Monitor after cutover. Track error rates, latency, and block lag for the first few days and compare against your baseline.
A simple monitoring probe can catch problems early:
# Run on a schedule; alert if the block number stops advancing
curl -s -X POST https://bnb.api.onfinality.io/public \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}'
If the returned block number is the same across two consecutive checks spaced a minute apart, the endpoint or the node behind it may be stalled. That is a useful signal to fail over before your users notice.
Key Takeaways
- A Smart Chain RPC URL is the endpoint your wallet or app uses to talk to BNB Smart Chain over JSON-RPC.
- Mainnet uses chain ID 56 and the BNB token; testnet uses chain ID 97 and tBNB.
- The OnFinality public endpoints are
https://bnb.api.onfinality.io/publicfor mainnet andhttps://bnb-testnet.api.onfinality.io/publicfor testnet. - Public endpoints are fine for wallets and prototypes; managed RPC APIs and dedicated nodes are the better fit for steady production traffic.
- Many "RPC errors" are actually application bugs such as nonce or gas issues, so diagnose before rotating endpoints.
- When migrating, inventory your methods, confirm transport support, test on testnet, and add failover.
Frequently Asked Questions
Is the Smart Chain RPC URL the same as the BSC RPC URL?
Yes. "Smart Chain" and "BSC" refer to the same network, BNB Smart Chain. Any endpoint labeled BSC or BNB Chain works, as long as the chain ID matches.
What chain ID should I use?
Use 56 for BNB Smart Chain mainnet and 97 for BNB Chain testnet. Mixing them causes signature and balance errors.
Can I use the public endpoint in production?
You can, but public endpoints are shared and may rate limit under load. For production apps, a managed RPC API or dedicated node gives you more predictable capacity and a support path.
Does BNB Smart Chain support WebSocket?
Mainnet supports HTTP and WebSocket on OnFinality. The testnet endpoint is HTTP only, so plan subscriptions accordingly.
Why does eth_getLogs return incomplete results?
Large block ranges often exceed what a shared endpoint will serve in one call. Narrow the range or use a provider that supports archive and wide-range log queries.
Where do I get testnet BNB?
Use a BNB Chain testnet faucet to fund your address with tBNB before deploying or testing contracts.
Next steps
If you are setting up a wallet or a quick script, copy the mainnet URL from the table above and you are done. If you are running a production app on BNB Smart Chain, review RPC pricing to pick a tier, check dedicated node options if you need isolation, and browse supported RPC networks if your app touches more than one chain.