Resumen
A developer reference for BNB Smart Chain RPC endpoints. Learn the official RPC URLs, chain ID, rate limits, WebSocket support, and common error troubleshooting steps. Includes a decision checklist for choosing between public and private endpoints for production apps.
BNB RPC Decision Checklist
Before integrating a BNB Smart Chain RPC endpoint into your dApp or backend service, check these key points:
| Criterion | What to check | Why it matters |
|---|---|---|
| Network match | Confirm chain ID (mainnet: 56, testnet: 97) | Mismatches cause transaction failures or wrong state reads |
| Rate limits | Know the free tier limits (e.g., 10k requests/5min on default endpoints) | Avoid sudden throttling in production |
| Method support | Verify eth_getLogs, eth_call, and trace APIs are enabled | Many dApps depend on these for analytics and indexing |
| WebSocket availability | Check if WSS URL is provided | Required for real-time event streams (e.g., pending transactions, logs) |
| Archive data | Does the endpoint support archive state? | Needed for historical queries and certain DEX backtesting |
| Failover strategy | Plan multiple endpoints or a load-balanced provider | Single points of failure can halt your app |
| Latency | Measure round-trip time from your deployment region | Higher latency degrades user experience, especially in DeFi |
| Authentication | Does the provider require an API key? | Public endpoints may have lower reliability; private ones offer SLAs |
BNB Smart Chain Network Overview
BNB Smart Chain (formerly Binance Smart Chain, BSC) is an EVM-compatible blockchain that runs in parallel with BNB Beacon Chain. It offers low transaction fees, fast block times (~3 seconds), and a high throughput of tens of millions of gas per second. The native token is BNB, used for gas and staking. BSC's compatibility with Ethereum tooling makes it a popular choice for DeFi, gaming, and NFT projects. Developers interact with the chain via JSON-RPC endpoints, which expose methods like eth_sendRawTransaction, eth_call, and eth_getLogs.
BNB RPC Endpoint Configuration
To connect to BNB Smart Chain, you need the following network parameters:
- Chain ID: 56 (0x38) for Mainnet, 97 (0x61) for Testnet
- Currency Symbol: BNB
- Block Explorer: https://bscscan.com (Mainnet), https://testnet.bscscan.com (Testnet)
Official public RPC URLs provided by BNB Chain:
- Mainnet:
https://bsc-dataseed.bnbchain.org - Mainnet (alternative):
https://bsc-dataseed1.bnbchain.org,https://bsc-dataseed2.bnbchain.org, etc. - Testnet:
https://data-seed-prebsc-1-s1.bnbchain.org:8545
These endpoints have a rate limit of 10,000 requests per 5 minutes and eth_getLogs is disabled on some. For higher limits and archive support, consider a dedicated RPC provider.
Example of adding BSC Mainnet to MetaMask or other wallets using chainlist.org: visit https://chainlist.org/chain/56 and connect your wallet.
Sample Request
curl -X POST https://bsc-dataseed.bnbchain.org \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
Response:
{"jsonrpc":"2.0","id":1,"result":"0x672df5"}
Rate Limits and Reliability Considerations
Public BSC endpoints are shared among many users. While sufficient for light usage, they can become unreliable under heavy load or during network congestion. Key limitations:
- Rate limit: ~33 requests/second average (10k per 5 minutes)
- Method bans:
eth_getLogsis often disabled to reduce server strain - No WebSocket: Official public endpoints do not expose WSS
- No archive: Only latest state is available; historical block data limited
For production apps, you need a provider that offers:
- Higher rate limits or dedicated capacity
- WebSocket support for real-time subscriptions
- Archive data for historical queries
- Global load balancing and failover
OnFinality provides RPC API services for BNB Smart Chain with multiple endpoints, including WebSocket and archive modes. Check the supported networks page for current offerings.
Common RPC Errors and Troubleshooting
eth_getLogs Disabled or Returns "Method not found"
Cause: Many public endpoints disable log retrieval to prevent abuse.
Solution: Switch to a provider that explicitly supports log filtering, or use WebSocket subscriptions to receive logs in real time. OnFinality's RPC API enables eth_getLogs on eligible plans.
"Rate limit exceeded" (HTTP 429 or 403)
Cause: You have exceeded the allowed requests per time window.
Solution: Implement client-side throttling, rotate among multiple endpoints, or upgrade to a private RPC endpoint without restrictive limits.
Transaction Replacement Underpriced
Cause: A replacement transaction has a lower gas price than the original pending one.
Solution: Use eth_maxPriorityFeePerGas to estimate appropriate fees, and ensure nonce management is correct.
Nonce Too Low
Cause: The transaction nonce is already used or skipped.
Solution: Track nonce per address using eth_getTransactionCount with "pending" parameter. For more see What is a Nonce in Blockchain?.
Connection Timeouts or Slow Responses
Cause: Network congestion, overloaded node, or geographic distance.
Solution: Choose an RPC provider with multiple regional entry points. OnFinality's dedicated node infrastructure can reduce latency for your specific deployment region.
Using WebSocket for Real-Time Data
WebSocket (WSS) endpoints allow you to subscribe to events like new blocks, pending transactions, and logs. This is essential for applications that need immediate updates without polling.
Example WebSocket subscription to new block headers:
const WebSocket = require('ws');
const ws = new WebSocket('wss://bsc-ws.nodereal.io'); // example WSS endpoint
ws.on('open', () => {
ws.send(JSON.stringify({
jsonrpc: '2.0',
id: 1,
method: 'eth_subscribe',
params: ['newHeads']
}));
});
ws.on('message', (data) => {
console.log('New block:', JSON.parse(data));
});
Many third-party providers offer WSS endpoints. OnFinality's RPC service includes WebSocket support for BNB Smart Chain; check the pricing page for details.
Choosing an RPC Provider for Production
When your dApp outgrows public endpoints, evaluate providers on:
- Throughput: Can it handle your peak request volume without rate limiting?
- Data access: Do you need archive, trace, or debug methods?
- Reliability: What is the uptime SLA? Is there multi-region failover?
- Latency: Are there nodes near your users or backend servers?
- WebSocket: Is WSS available with the same reliability as HTTP?
For a detailed framework, see our guide on How to Choose an RPC Provider.
OnFinality offers both shared RPC API and dedicated nodes for BNB Smart Chain, giving you flexibility to scale from development to high-traffic production.
Key Takeaways
- BNB Smart Chain uses chain ID 56 (mainnet) and 97 (testnet) with official public RPC endpoints at
bsc-dataseed.bnbchain.org. - Public endpoints have rate limits and method restrictions; evaluate your app's needs early.
- For real-time data and higher throughput, use WebSocket and a managed RPC provider.
- Common issues like
eth_getLogsdisabled and rate limiting can be avoided by choosing an appropriate provider. - Always test with a testnet (on Testnet) before mainnet deployment.
Frequently Asked Questions
Q: What is the difference between BNB Beacon Chain and BNB Smart Chain?
A: BNB Beacon Chain handles staking and governance, while BNB Smart Chain is the EVM-compatible chain for smart contracts and dApps. The RPC endpoints covered here are for BNB Smart Chain (formerly BSC).
Q: Can I use Ethereum tools with BNB Smart Chain?
A: Yes, BSC is fully EVM-compatible, so you can use MetaMask, Hardhat, Truffle, and other Ethereum developer tools with minimal changes.
Q: How do I get BNB testnet tokens?
A: Use the BSC Testnet faucet at https://testnet.bnbchain.org/faucet-smart to request BNB for testing.
Q: Does OnFinality support BNB Smart Chain?
A: Yes, OnFinality offers both public and private RPC endpoints for BNB Smart Chain mainnet and testnet. See the supported networks page for details.
Q: What is the block time of BSC?
A: Approximately 3 seconds, making it faster than Ethereum mainnet.