Logo
RPC Assistant

What is a BNB RPC node and how do you connect to BNB Smart Chain?

Summary

A BNB RPC node is a server that exposes the BNB Smart Chain JSON-RPC API, letting wallets, dApps, and indexers read chain state and submit transactions. This guide explains the difference between public and private endpoints, how to configure your app for mainnet and testnet, and what to check when choosing infrastructure for production workloads.

Quick decision guide: which BNB RPC node should you use?

Before you copy an endpoint into your config, decide what your app actually needs. The answer changes depending on whether you are prototyping, running a production dApp, or operating a high-frequency trading bot.

  • Prototyping or hackathon: a public endpoint is fine. You can get started in minutes without an API key. Just be aware that public endpoints often throttle requests and may disable expensive methods like eth_getLogs.
  • Production dApp with moderate traffic: a managed RPC provider gives you higher rate limits, better reliability, and support. You pay per request or per month, and you get a stable endpoint that you can scale.
  • High-throughput or data-heavy workloads: consider a dedicated node. You get your own BNB Smart Chain node with no noisy neighbors, full access to methods like eth_getLogs and trace_*, and the ability to tune performance.

If you are evaluating providers, compare them on the criteria in the provider evaluation matrix below. For a deeper dive, see our guide on how to choose an RPC provider.

What is a BNB RPC node?

A BNB RPC node is a server that runs the BNB Smart Chain client (usually a fork of go-ethereum) and exposes the JSON-RPC API. This API lets external applications read blockchain data (balances, transaction receipts, contract state) and submit new transactions. When you connect a wallet like MetaMask to BNB Smart Chain, you are actually pointing it at an RPC endpoint.

BNB Smart Chain is an EVM-compatible chain, so it supports the standard Ethereum JSON-RPC methods (eth_blockNumber, eth_getBalance, eth_sendRawTransaction, etc.) plus a few BSC-specific extensions. The chain ID is 56 for mainnet and 97 for testnet.

Chain settings at a glance

Here are the key network parameters you need to configure your wallet or dApp:

ParameterBNB Smart Chain MainnetBNB Smart Chain Testnet
Chain ID56 (0x38)97 (0x61)
CurrencyBNBtBNB
Block explorerBscScanBscScan Testnet
Public RPChttps://bsc-dataseed.bnbchain.orghttps://data-seed-prebsc-1-s1.bnbchain.org:8545
WebSocketwss://bsc-ws-node.nariber.orgwss://data-seed-prebsc-1-s1.bnbchain.org:8546

Note: Public endpoints are rate-limited and may not support all methods. For production, use a managed provider or your own node.

How to connect to a BNB RPC node

Wallet configuration

To add BNB Smart Chain to MetaMask or another wallet, use the chain settings above. Most wallets have a "Add Network" form where you enter the chain ID, RPC URL, symbol, and explorer URL.

JavaScript (ethers.js)

import { ethers } from "ethers";

const provider = new ethers.JsonRpcProvider("https://bsc-dataseed.bnbchain.org");

async function getBlockNumber() {
  const blockNumber = await provider.getBlockNumber();
  console.log("Current block:", blockNumber);
}

getBlockNumber();

curl JSON-RPC

curl -X POST https://bsc-dataseed.bnbchain.org \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'

WebSocket subscription

const ws = new WebSocket("wss://bsc-ws-node.nariber.org");

ws.onopen = () => {
  ws.send(JSON.stringify({
    jsonrpc: "2.0",
    method: "eth_subscribe",
    params: ["newHeads"],
    id: 1
  }));
};

ws.onmessage = (event) => {
  console.log("New block:", JSON.parse(event.data));
};

Public vs. private BNB RPC nodes

Public endpoints are convenient but come with limitations. They are shared by many users, so they can be slow or rate-limited. They often disable expensive methods like eth_getLogs to protect the infrastructure. For production, you need a private endpoint.

A private RPC node can be either a shared (managed) endpoint or a dedicated node. Shared endpoints are cheaper and easier to scale, but you share resources with other users. Dedicated nodes give you full control and consistent performance, but you pay more and are responsible for monitoring.

Provider evaluation matrix

When comparing BNB RPC providers, use this matrix to structure your evaluation:

CriterionWhat to checkWhy it matters
Rate limitsRequests per second/minute, burst allowancePrevents throttling during traffic spikes
Method supporteth_getLogs, trace_*, eth_subscribeSome providers disable expensive methods
Archive dataAvailability of historical stateNeeded for indexers and analytics
WebSocket supportStable wss endpointRequired for real-time subscriptions
Global reachMultiple regions, low latencyImproves performance for users worldwide
FailoverAutomatic retry, multiple endpointsEnsures high availability
Pricing modelPay-per-request vs. flat monthlyAffects cost predictability

For a more detailed framework, see how to choose an RPC provider.

Common pitfalls and how to avoid them

1. Rate limiting

Public endpoints often limit requests to 10,000 per 5 minutes. If your app exceeds this, you'll get 429 errors. Use a provider with higher limits or implement caching.

2. eth_getLogs disabled

Many public endpoints disable eth_getLogs because it is resource-intensive. If you need to query logs, use a provider that supports it or use WebSocket subscriptions to receive logs in real time.

3. Chain ID mismatch

Make sure your app uses the correct chain ID (56 for mainnet, 97 for testnet). A mismatch will cause transactions to be rejected.

4. WebSocket disconnects

WebSocket connections can drop. Implement reconnection logic with exponential backoff.

When to run your own BNB node vs. using a managed service

Running your own BNB Smart Chain node gives you full control and no per-request fees, but it requires significant operational effort: hardware, storage, monitoring, and maintenance. For most teams, a managed RPC service is more cost-effective and reliable.

OnFinality offers managed BNB Smart Chain RPC endpoints and dedicated nodes for teams that need consistent performance and full method access. You can start with a free tier and scale as your usage grows.

Key Takeaways

  • A BNB RPC node exposes the JSON-RPC API for BNB Smart Chain, enabling wallets and dApps to interact with the chain.
  • Public endpoints are fine for testing but have rate limits and method restrictions.
  • For production, choose a managed provider or dedicated node based on your traffic and data needs.
  • Always verify chain ID, method support, and WebSocket stability when evaluating providers.
  • OnFinality provides BNB Smart Chain RPC and testnet RPC with flexible pricing.

Frequently Asked Questions

What is the BNB Smart Chain RPC URL?

The official public RPC URL for BNB Smart Chain mainnet is https://bsc-dataseed.bnbchain.org. For testnet, use https://data-seed-prebsc-1-s1.bnbchain.org:8545.

What is the BNB Smart Chain chain ID?

The chain ID is 56 for mainnet and 97 for testnet.

Can I use a BNB RPC node for free?

Yes, public endpoints are free, but they have rate limits and may not support all methods. For production, consider a managed service with a free tier.

How do I get a BNB testnet RPC endpoint?

You can use the public testnet endpoint or get a dedicated testnet endpoint from a provider like OnFinality. See our BNB testnet page for details.

What is the difference between a full node and an archive node?

A full node stores the current state and recent history. An archive node stores all historical state, which is needed for queries that access old data. Archive nodes require more storage and are more expensive.

How do I choose between a shared and a dedicated BNB RPC node?

Shared nodes are cheaper and easier to scale, but you share resources. Dedicated nodes give you consistent performance and full method access. Choose dedicated if you have high traffic or need eth_getLogs and trace_* methods.

For more information on pricing and supported networks, see our RPC pricing and supported networks pages.

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