Logo

BNB Testnet RPC: Complete Guide to Endpoints, Setup, and Best Providers

Key Takeaways

  • BNB Smart Chain Testnet uses chain ID 97 and tBNB as gas token.
  • Official public RPC endpoints are available but rate-limited to 10,000 requests per 5 minutes.
  • Third-party providers like OnFinality offer higher rate limits, archive data, and dedicated nodes for production testing.
  • You can add the testnet to MetaMask, Hardhat, or Foundry using the correct RPC URL and chain ID.
  • WebSocket endpoints are available for real-time event listening.
  • Always use a private RPC endpoint for automated testing to avoid rate limiting.
  • OnFinality provides a free tier for BNB testnet RPC with scalable options for larger workloads.

What is BNB Smart Chain Testnet?

BNB Smart Chain Testnet is a public test network that replicates the functionality of BNB Smart Chain (BSC) mainnet. It allows developers to deploy and test smart contracts, dApps, and blockchain interactions in a risk-free environment using test BNB (tBNB) which has no real value.

The testnet uses the same consensus mechanism (Proof of Staked Authority) and supports all standard Ethereum JSON-RPC methods, making it fully compatible with tools like MetaMask, Hardhat, Truffle, and Web3.js. Key parameters include chain ID 97, block time of approximately 3 seconds, and a native token tBNB.

  • Chain ID: 97 (0x61)
  • Currency: tBNB
  • Block Explorer: https://testnet.bscscan.com
  • Consensus: Proof of Staked Authority (PoSA)
  • EVM Compatibility: Full

BNB Testnet RPC Endpoints

BNB Chain provides official public RPC endpoints for the testnet, but these are rate-limited to 10,000 requests per 5 minutes. For development and automated testing, it is recommended to use a third-party RPC provider that offers higher rate limits, archive data, and dedicated node options.

Below are commonly used BNB testnet RPC endpoints. Note that public endpoints are suitable only for light testing; for production-grade development, sign up for a private endpoint.

CriterionWhat to checkWhy it matters
ProviderEndpoint URLReliability and rate limits
Official (BNB Chain)https://data-seed-prebsc-1-s1.bnbchain.org:8545Public, rate-limited to 10K/5min
OnFinality (Public)https://bnb-testnet.api.onfinality.io/publicFree public endpoint for testing
OnFinality (Private)https://bnb-testnet.api.onfinality.io/rpc?apikey=YOUR_KEYHigher rate limits, archive support
ChainListMultiple endpoints listed on chainlist.org/chain/97Aggregated list with latency scores

How to Add BNB Testnet to MetaMask

Adding BNB Smart Chain Testnet to MetaMask is straightforward. You can either use ChainList to add it automatically or configure it manually.

To add manually, open MetaMask, click the network dropdown, select 'Add Network', and fill in the following details:

  • Network Name: BNB Smart Chain Testnet
  • RPC URL: https://bnb-testnet.api.onfinality.io/public (or your private endpoint)
  • Chain ID: 97
  • Currency Symbol: tBNB
  • Block Explorer URL: https://testnet.bscscan.com

Getting Testnet BNB (tBNB) from a Faucet

To interact with the testnet, you need tBNB for gas fees. Several faucets provide free tBNB, typically with daily limits. Common faucets include the official BNB Chain faucet and third-party faucets like those listed on testnet.bscscan.com.

After obtaining tBNB, you can deploy contracts, send transactions, and test your dApp just like on mainnet.

  • Official BNB Chain Faucet: https://testnet.bnbchain.org/faucet-smart
  • BscScan Faucet: https://testnet.bscscan.com/faucet
  • Thirdweb Faucet: Available via thirdweb.com/binance-testnet

Using BNB Testnet with Hardhat and Foundry

For automated testing and deployment, you can configure Hardhat or Foundry to use BNB testnet RPC endpoints. Below is an example Hardhat configuration:

  • In hardhat.config.js, add a network entry:
  • bnbTestnet: { url: 'https://bnb-testnet.api.onfinality.io/public', chainId: 97 }
  • For Foundry, use: --rpc-url https://bnb-testnet.api.onfinality.io/public
  • Always use a private endpoint with your API key to avoid rate limits during automated runs.

Choosing a BNB Testnet RPC Provider

When selecting an RPC provider for BNB testnet, consider factors like rate limits, archive data support, WebSocket availability, and geographic distribution. Public endpoints are fine for occasional use, but for continuous integration or load testing, a private endpoint is essential.

OnFinality offers a free tier for BNB testnet RPC with generous rate limits, archive data, and WebSocket support. For teams needing dedicated infrastructure, OnFinality also provides one-click deployment of full, archive, and validator nodes on global infrastructure.

CriterionWhat to checkWhy it matters
Rate LimitsRequests per second/minutePrevents throttling during testing
Archive DataHistorical state accessRequired for certain dApp features
WebSocket SupportReal-time event streamingEssential for live updates
Geographic DistributionServer locationsReduces latency for global users
Dedicated NodesFull control over nodeMaximum performance and isolation

Troubleshooting Common Issues

Developers often encounter issues like rate limiting, connection timeouts, or incorrect chain ID when using BNB testnet RPC. Here are quick fixes:

  • Rate limiting: Switch to a private RPC endpoint with higher limits.
  • Connection refused: Verify the RPC URL is correct and the endpoint is active.
  • Incorrect chain ID: Ensure your wallet or tool uses chain ID 97.
  • Missing tBNB: Use a faucet to get test tokens.
  • eth_getLogs disabled: Some public endpoints disable this method; use a provider that supports it.

Frequently Asked Questions

What is the BNB testnet RPC URL?

The official public RPC URL is https://data-seed-prebsc-1-s1.bnbchain.org:8545. OnFinality offers a public endpoint at https://bnb-testnet.api.onfinality.io/public and private endpoints with higher limits.

What is the BNB testnet chain ID?

The chain ID is 97 (hex 0x61).

How do I get tBNB for testing?

You can get free tBNB from the official BNB Chain faucet at https://testnet.bnbchain.org/faucet-smart or from BscScan faucet.

Can I use WebSocket with BNB testnet?

Yes, WebSocket endpoints are available. For OnFinality, use wss://bnb-testnet.api.onfinality.io/public-ws.

Is BNB testnet compatible with Ethereum tools?

Yes, it is fully EVM-compatible and works with MetaMask, Hardhat, Foundry, Web3.js, and ethers.js.

bnb testnet rpc
RPC Knowledge Base

Related RPC details

Background

Nunca te preocupes por la infraestructura nuevamente

OnFinality elimina la carga pesada de DevOps para que puedas construir de forma más inteligente y rápida.

Comenzar