Logo
RPC Assistant

BNB Testnet Endpoint: Chain Settings, Faucet, and Debugging

Summary

BNB Testnet is a test environment for BNB Smart Chain (BSC) that mirrors mainnet features. This article covers chain settings, how to get tBNB tokens from the faucet, common debugging steps, and how to connect via an RPC endpoint. Whether you're deploying a smart contract or integrating a dApp, this guide helps you get started with BNB Testnet.

BNB Testnet Decision Checklist

Before diving in, evaluate whether BNB Testnet fits your project stage:

CriterionWhat to checkWhy it matters
Test environment parityDoes BNB Testnet mirror mainnet behavior?BNB Testnet uses the same consensus (PoSA) and gas mechanics as mainnet, making it ideal for realistic testing.
Faucet availabilityCan you get tBNB tokens easily?The official BNB Chain faucet and third-party faucets provide daily tokens for contract deployment and transactions.
RPC reliabilityIs the public RPC endpoint stable for your load?Public endpoints have rate limits; for sustained testing, consider a dedicated RPC provider like OnFinality.
Wallet compatibilityDoes your wallet support Chain ID 97?MetaMask and most EVM wallets require manual network addition using the correct chain settings.
Block explorer supportCan you verify transactions and contracts?BscScan testnet provides full explorer functionality for debugging.

What Is BNB Testnet?

BNB Testnet is the official test environment for BNB Smart Chain (BSC), an EVM-compatible blockchain known for high throughput and low fees. It uses a Proof of Staked Authority (PoSA) consensus, just like mainnet. The native currency is tBNB (test BNB), which has no real-world value. Developers use BNB Testnet to deploy smart contracts, test dApps, and validate infrastructure before going live on mainnet.

BNB Testnet Chain Settings

To connect to BNB Testnet, you need the following parameters:

  • Network Name: BNB Chain Testnet (or BSC Testnet)
  • Chain ID: 97
  • RPC URL: https://data-seed-prebsc-1-s1.bnbchain.org:8545 (public) or use a provider endpoint
  • WebSocket URL: wss://data-seed-prebsc-1-s1.bnbchain.org:8546 (public)
  • Currency Symbol: tBNB
  • Block Explorer: https://testnet.bscscan.com

Adding BNB Testnet to MetaMask

If you use MetaMask, add the network manually:

  1. Open MetaMask > Settings > Networks > Add Network.
  2. Fill in the fields using the values above.
  3. Click Save. You should see tBNB balance after funding.

Getting tBNB from the Faucet

To test transactions, you need tBNB. The primary faucet is the official BNB Chain Testnet Faucet:

  • URL: https://www.bnbchain.org/en/testnet-faucet
  • Amount: 0.3 tBNB per request (daily limit)
  • Requirement: You must hold at least 0.002 BNB on BSC mainnet to use this faucet. Alternatively, use third-party faucets or contact the BNB Chain team for larger amounts.

Note: If you need more tokens for large-scale testing, consider applying for a faucet grant or using a dedicated testnet node provider.

Using BNB Testnet RPC Endpoints

An RPC endpoint is how your application communicates with the blockchain. You can use the public endpoint for light testing, but for reliability and higher rate limits, use a managed service like OnFinality.

Example: Check Latest Block Number

curl -H 'content-type:application/json' -d '{"id": 1, "jsonrpc": "2.0", "method": "eth_blockNumber"}' 'https://data-seed-prebsc-1-s1.bnbchain.org:8545'

Expected response:

{"jsonrpc":"2.0","id":1,"result":"0x7059c8f"}

Switching to a Managed Provider

Public endpoints can throttle requests. For development and CI/CD, obtain a free API key from OnFinality and use:

curl -H 'content-type:application/json' -H 'x-api-key: YOUR_API_KEY' -d '{"id": 1, "jsonrpc": "2.0", "method": "eth_blockNumber"}' 'https://bnb-testnet.api.onfinality.io/public'

OnFinality supports archive data and WebSocket connections, which are essential for debugging historical states or listening to events.

Common Debugging Tips

  • Insufficient Balance: Ensure your wallet has tBNB. Check balance via eth_getBalance.
  • Contract Deployment Fails: Verify your contract compiles correctly and you have enough gas. Use the faucet again if needed.
  • Rate Limited: If you see 429 Too Many Requests, switch to a provider with higher limits or implement exponential backoff.
  • Transaction Not Found: Use BscScan testnet to search by transaction hash. If pending, try increasing gas price.
  • WebSocket Disconnections: For WebSocket usage, consider a dedicated connection via a managed provider.

Debugging with Trace Calls

If you need to debug failed transactions, use debug_traceTransaction (if supported by your provider). OnFinality provides trace support for BNB Testnet:

curl -H 'content-type:application/json' -H 'x-api-key: YOUR_API_KEY' -d '{"id": 1, "jsonrpc": "2.0", "method": "debug_traceTransaction", "params": ["0xTX_HASH", {}]}' 'https://bnb-testnet.api.onfinality.io/public'

BNB Testnet vs. Mainnet: Key Differences

  • tBNB has no value: Do not treat testnet tokens as real assets.
  • Fewer validators: Testnet may have less decentralization, but consensus rules are identical.
  • Faster blocks?: Block times are similar (~3 seconds), but testnet network load varies.
  • Chain ID: 97 (testnet) vs. 56 (mainnet). Ensure your app handles chain switching correctly.

Next Steps: Moving to Mainnet

After testing on BNB Testnet, you'll need to switch to mainnet. Update your RPC endpoint to a production-grade provider. Review your contract's security and gas optimizations. Use BscScan to verify contracts. For a smooth migration, consider using a dedicated BNB Smart Chain node from OnFinality to maintain consistent performance.

For a complete list of supported networks and endpoints, see our supported networks page.

Key Takeaways

  • BNB Testnet mirrors mainnet and is essential for pre-release testing.
  • Use Chain ID 97 and get tBNB from the official faucet.
  • Public RPC endpoints are fine for small tests; for production-like loads, use a managed provider.
  • Debug failing transactions with block explorers and trace APIs.
  • Plan your migration to mainnet with a reliable RPC provider.

Frequently Asked Questions

  1. How do I get more tBNB if the faucet runs out? Try third-party faucets or request through BNB Chain's developer programs.
  2. Can I use BNB Testnet for production? No, testnets are for testing only; use mainnet (Chain ID 56) for live apps.
  3. What if my transaction is stuck? Use a higher gas price or resubmit with a new nonce.
  4. Does BNB Testnet support all EVM features? Most features are supported, but some precompiles may differ. Check the official docs.
  5. How do I connect to BNB Testnet via WebSocket? Use the WebSocket URL with a compatible library like ethers.js.

Note: For precise pricing and rate limits, refer to the RPC pricing page and supported networks page. Performance claims should be independently verified.

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