Logo
New RPC users get 35% off their first monthView the offer
RPC Assistant

BNB Smart Chain RPC Endpoint and Chain Settings

Summary

BNB Smart Chain (BSC) is an EVM-compatible network with mainnet chain ID 56 (hex 0x38) and testnet chain ID 97 (hex 0x61). To connect, you need an RPC URL, the correct chain ID, currency symbol BNB (tBNB on testnet), and a block explorer. Official public mainnet endpoints, such as https://bsc-dataseed.bnbchain.org, are available for testing and light use, while OnFinality offers a public mainnet endpoint at https://bnb.api.onfinality.io/public with EVM-compatible HTTPS and WebSocket RPC, archive support, and trace/API access. Before trusting any endpoint, send an eth_chainId request: a mainnet response returns 0x38, and testnet returns 0x61. Using the wrong chain ID is a common cause of rejected transactions and can lead to funds loss if you connect to the wrong network. Public endpoints often have rate limits and may disable eth_getLogs, so production applications should evaluate managed endpoints with predictable throughput, archive data, and WebSocket support. This guide covers wallet configuration, curl, ethers, and viem setup, common endpoint failures, and a path to OnFinality's BNB network hub and testnet guide.

Key Takeaways

  • BNB Smart Chain mainnet uses chain ID 56 (0x38); testnet uses 97 (0x61).
  • Official public endpoints like https://bsc-dataseed.bnbchain.org have rate limits and may disable eth_getLogs.
  • OnFinality offers a public mainnet endpoint at https://bnb.api.onfinality.io/public with WebSocket, archive, and trace support.
  • Always verify the network with eth_chainId before sending transactions; a mainnet response is 0x38.

BNB Smart Chain Chain Settings at a Glance

BNB Smart Chain (formerly Binance Smart Chain, BSC) is an EVM-compatible blockchain. Developers interact with it using standard JSON-RPC methods, but the network parameters differ from Ethereum. The mainnet chain ID is 56, represented as 0x38 in hexadecimal. The testnet chain ID is 97, represented as 0x61. Both networks use BNB as the native gas token, but testnet uses tBNB.

CriterionWhat to checkWhy it matters
MainnetChain ID 56 (0x38), currency BNB, explorer https://bscscan.com, official public RPC https://bsc-dataseed.bnbchain.org, OnFinality public RPC https://bnb.api.onfinality.io/publicUse these values in wallets, SDKs, and backend services to connect to production.
TestnetChain ID 97 (0x61), currency tBNB, explorer https://testnet.bscscan.com, official public RPC https://bsc-testnet-dataseed.bnbchain.org, OnFinality public RPC https://bnb-testnet.api.onfinality.io/publicTestnet is used for development, QA, and staging; never send real assets.

Adding BNB Smart Chain to a Wallet

Most EVM wallets, including MetaMask and Rabby, allow manual network addition. Use the mainnet values from the table above. If you have a private OnFinality endpoint, replace the public URL with your assigned HTTPS or WebSocket URL.

  • Open the wallet's Settings or Networks menu.
  • Choose Add network or Add custom network.
  • Enter Network name: BNB Smart Chain.
  • Set RPC URL to https://bsc-dataseed.bnbchain.org or your OnFinality endpoint.
  • Set Chain ID to 56.
  • Set Currency symbol to BNB.
  • Set Block explorer URL to https://bscscan.com.
  • Save and switch to the network.

Verifying the Endpoint with eth_chainId and curl

Before sending transactions, confirm you are connected to BNB Smart Chain mainnet. Use eth_chainId: a response of 0x38 is mainnet; 0x61 is testnet. If you receive 0x1 (Ethereum) or another chain ID, stop and fix your configuration.

Example curl request against the OnFinality public endpoint:

``bash curl -X POST https://bnb.api.onfinality.io/public \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}' ``

Expected response:

``json {"jsonrpc":"2.0","id":1,"result":"0x38"} ``

You can also check block height with eth_blockNumber. For JavaScript applications, use ethers.js or viem:

ethers.js example:

``javascript const { ethers } = require("ethers"); const provider = new ethers.JsonRpcProvider("https://bnb.api.onfinality.io/public"); const network = await provider.getNetwork(); console.log("Chain ID:", Number(network.chainId)); // 56 ``

viem example:

``javascript import { createPublicClient, http } from 'viem'; import { bsc } from 'viem/chains'; const client = createPublicClient({ chain: bsc, transport: http('https://bnb.api.onfinality.io/public') }); const chainId = await client.getChainId(); console.log(chainId); // 56 ``

Public Endpoint Limitations and Rate-Limit Behavior

The official BNB Smart Chain public endpoints are shared infrastructure. According to the BNB developer documentation, the listed public mainnet endpoints have a rate limit of 10,000 requests per 5 minutes per IP, and eth_getLogs is disabled on those listed mainnet endpoints to protect node performance. These limitations apply to the official public list, not necessarily to OnFinality's public endpoint.

OnFinality's supplied BNB mainnet network configuration states that its public endpoint at https://bnb.api.onfinality.io/public provides EVM-compatible HTTPS and WebSocket RPC, archive support, and trace/API access. However, specific rate limits for that endpoint are not published in this guide; treat it as a testing and prototyping endpoint unless your plan details otherwise.

For production applications, relying solely on free public endpoints is risky. You need predictable throughput, WebSocket subscriptions, archive data, and full log support. Managed RPC services like OnFinality's offer these capabilities; see /networks/bnb for current details.

  • Official public endpoints may throttle at ~10K requests/5min.
  • eth_getLogs is disabled on some official mainnet endpoints.
  • Free endpoints are shared; performance can degrade during network congestion.
  • OnFinality public endpoint supports WebSocket, archive, and trace but production plans may be required for higher limits.

Troubleshooting Common BNB Smart Chain RPC Failures

Even with correct network settings, developers encounter issues. Here are common failures and fixes.

  • **Wrong chain ID:** eth_chainId returns 0x1, 0x5, or 0x61 when you expect mainnet. Check your RPC URL and chain configuration; never send mainnet transactions to a testnet or Ethereum address.
  • **eth_getLogs disabled or method not found:** Some public endpoints disable log queries. Use a provider that supports eth_getLogs or subscribe to logs via WebSocket.
  • **429 rate limit exceeded:** Your app is exceeding the public endpoint's request limit. Implement client-side throttling, caching, or move to a managed endpoint.
  • **Connection timeouts:** The endpoint may be overloaded or distant. Try an alternate official mirror or a geographically closer provider. Consider WebSocket for real-time needs.
  • **Nonce too low:** The transaction nonce is incorrect. Use eth_getTransactionCount with 'pending' to track the next nonce.
  • **Node health:** If your provider supports eth_health, you can use it to check node status; not all endpoints implement this method.

Evaluating Endpoint Providers for Production

When your dApp outgrows public endpoints, compare providers on the criteria below. This is not a vendor ranking; the right choice depends on your workload. Use the OnFinality BNB network page (/networks/bnb) to see current endpoint options, and the provider comparison guide at /rpc-assistant/bnb-chain-rpc-provider for a structured evaluation path.

CriterionWhat to checkWhy it matters
Rate limits and burst capacityDocumented requests per second or per month, burst allowancesPrevents throttling during traffic spikes and launch events.
Method supportArchive state, eth_getLogs, trace/debug methods, WebSocket subscriptionsAnalytics, indexers, and DeFi apps depend on these methods.
Latency and regional distributionNode locations, round-trip time from your regionLow latency improves user experience and transaction confirmation.
Failover and redundancyMultiple endpoints, automatic retry, status pageA single point of failure can halt your app.
Pricing modelPay-as-you-go vs. subscription, overage fees, free tierAvoid unexpected costs and align with your request profile.
Support and observabilitySLA, request analytics, direct support channelsFaster incident response and capacity planning.

BNB Smart Chain Testnet Endpoint Guide

Use testnet for development, staging, and contract testing. The testnet chain ID is 97 (0x61), and the native token is tBNB. Official testnet endpoints include https://bsc-testnet-dataseed.bnbchain.org. OnFinality provides a public testnet endpoint at https://bnb-testnet.api.onfinality.io/public, which is useful for testing EVM-compatible HTTPS and WebSocket connections.

Request tBNB from a BNB testnet faucet before deploying contracts. For more details on testnet configuration and OnFinality's testnet service, see /rpc-assistant/bnb-chain-testnet-endpoint.

Moving from Public RPC to a Production Endpoint

To move beyond public endpoints, sign up for a managed RPC service. OnFinality provides BNB Smart Chain RPC access with options for archive data, WebSocket, and trace/API. Create a private endpoint by following the instructions on the BNB network page (/networks/bnb). Your private URL will include a project-specific identifier; use placeholders in your configuration, such as:

`` https://your-project.onfinality.io/... ``

Do not hardcode API keys in client-side code. Use environment variables and restrict access by referrer or IP where possible. For BSC API method reference, see /rpc-assistant/bsc-api. For dedicated node options, review the BNB network hub and provider comparison at /rpc-assistant/bnb-chain-rpc-provider.

  • Replace the public URL with your private endpoint.
  • Update the chain ID, currency, and explorer settings if needed.
  • Monitor request volume and errors in the provider dashboard.
  • Keep a fallback endpoint for high availability.

Frequently Asked Questions

What is the BNB Smart Chain mainnet RPC URL?

The official public endpoint is https://bsc-dataseed.bnbchain.org. OnFinality also provides a public endpoint at https://bnb.api.onfinality.io/public. For production, use a private endpoint from a managed provider.

What is the chain ID for BNB Smart Chain?

Mainnet chain ID is 56 (hex 0x38). Testnet chain ID is 97 (hex 0x61). Always check eth_chainId to confirm the network.

Are public BNB Smart Chain RPC endpoints rate limited?

Yes, the official public endpoints have a rate limit of 10,000 requests per 5 minutes per IP, and eth_getLogs is disabled on some. OnFinality's public endpoint may have different policies; for high-volume apps, use a managed plan.

Can I use Ethereum tools like ethers.js and viem with BNB Smart Chain?

Yes, BNB Smart Chain is EVM-compatible, so standard Ethereum JSON-RPC methods and libraries work. Just change the RPC URL and chain ID.

How do I get a private BNB Smart Chain endpoint?

Sign up for an RPC provider like OnFinality, create a project, and copy your private endpoint from the dashboard. Replace the public URL in your wallet or app and keep the API key secure.

RPC Knowledge Base

Related RPC details

Never Worry about Infrastructure Again

OnFinality takes away the heavy lifting of DevOps so you can build smarter and faster.

Get Started