Resumen
BNB Testnet (chain ID 97) is an EVM-compatible test network for BNB Smart Chain. Developers use it to deploy and test smart contracts, dApps, and integrations without risking real funds. This guide covers RPC endpoints, faucet details, MetaMask configuration, and common debugging steps.
BNB Testnet is the official test environment for BNB Smart Chain (formerly BSC). It allows developers to deploy and interact with smart contracts, test dApp functionality, and validate integrations before moving to mainnet—all without spending real BNB. This reference covers the essential chain settings, RPC endpoints, faucet options, wallet configuration, and common pitfalls.
BNB Testnet Endpoint Decision Checklist
Before connecting your application to BNB Testnet, review these criteria to ensure the RPC endpoint you choose fits your development workflow.
| Criterion | What to check | Why it matters |
|---|---|---|
| Rate limits | Free tier requests per second (e.g., public endpoint vs. API key) | Public endpoints are often rate-limited; for automated CI/CD or load testing, a private endpoint is necessary. |
| WebSocket support | Does the provider offer wss:// endpoint? | Required for real-time event listening (e.g., contract event subscriptions). |
| Archive data | Access to historical state from genesis? | Needed for backtesting, analytics, or dApps that query past balances. |
| Geographic latency | Server locations relative to your team or users | Higher latency increases transaction broadcast time and block retrieval. |
| Failover | Does the provider have multiple nodes? | Single-node endpoints risk downtime; a robust provider offers automatic failover. |
| Faucet integration | Can you request tBNB easily? | Without test tokens, you cannot deploy contracts or send transactions. |
What Is BNB Testnet?
BNB Testnet is a feature-complete replica of BNB Smart Chain (BSC) mainnet. It uses the same Proof-of-Staked-Authority (PoSA) consensus, identical EVM opcodes, and fast block times (~3 seconds). The native test token is tBNB, which has no real monetary value. Developers use BNB Testnet for:
- Smart contract deployment and unit testing
- Integration testing with wallets, oracles, and bridges
- Performance and load testing of dApps
- CI/CD pipeline verification before mainnet releases
Chain Settings and RPC Endpoints
To connect to BNB Testnet, you need the following chain parameters:
- Chain ID:
97 - Network Name:
BNB Smart Chain Testnet(orBSC Testnet) - Currency Symbol:
tBNB - Block Explorer:
https://testnet.bscscan.com
RPC Endpoints
| Provider | HTTP Endpoint | WebSocket Endpoint | Type |
|---|---|---|---|
| OnFinality (public) | https://bnb-testnet.api.onfinality.io/public | wss://bnb-testnet.api.onfinality.io/public-ws | Public (rate-limited) |
| OnFinality (API key) | https://bnb-testnet.api.onfinality.io | wss://bnb-testnet.api.onfinality.io/ws | Private (higher limits) |
| Chain official | https://data-seed-prebsc-1-s1.bnbchain.org:8545 | wss://data-seed-prebsc-1-s1.bnbchain.org:8546 | Public (rate-limited) |
To test your connection, use a simple curl call:
curl -H 'content-type:application/json' -d '{"id": 1, "jsonrpc": "2.0", "method": "eth_blockNumber"}' 'https://bnb-testnet.api.onfinality.io/public'
If successful, you receive a response like {"jsonrpc":"2.0","id":1,"result":"0x6f8b3c"}.
For production testing workflows, sign up for a free OnFinality account to obtain an API key with higher rate limits and access to archival and trace data.
Getting Test Tokens (Faucet)
Deploying contracts and sending transactions on BNB Testnet requires tBNB. The official BNB Chain Testnet Faucet provides 0.3 tBNB per request (once every 24 hours). Alternative faucets include:
- Thirdweb Faucet: Offers 0.01 tBNB/day with wallet connection.
- QuickNode Faucet: Requires a QuickNode account but provides larger amounts.
- Chainstack Faucet: Similar to QuickNode, often requires an account.
Tip: If you need more than 0.3 tBNB for extensive testing, combine multiple faucets or contact the BNB Chain team through their official Discord.
Adding BNB Testnet to MetaMask
To use BNB Testnet with MetaMask or other EVM wallets:
- Open MetaMask and click the network dropdown at the top.
- Select "Add network" (or "Custom network" in older versions).
- Fill in the details:
- Network Name:
BNB Smart Chain Testnet - New RPC URL:
https://bnb-testnet.api.onfinality.io(or your preferred endpoint) - Chain ID:
97 - Currency Symbol:
tBNB - Block Explorer URL:
https://testnet.bscscan.com
- Network Name:
- Click "Save".
After adding, switch to BNB Testnet and request tBNB from a faucet. You can then deploy contracts using Hardhat, Truffle, or Foundry.
Common Issues and Debugging
Transaction Stuck / Pending
- Cause: Low gas price or nonce mismatch.
- Fix: Increase gas price or reset nonce in MetaMask (Settings > Advanced > Clear activity tab data).
"Method not found" Errors
- Cause: Using a mainnet-only method like
eth_callwith state override (not a testnet issue). - Fix: Verify the method is supported on testnet. For
eth_call, ensure the block parameter is valid.
Connection Timeout
- Cause: The RPC endpoint is unreachable or rate-limited.
- Fix: Switch to a different endpoint or switch to a private API key. Check provider status pages.
Insufficient Funds for Deployment
- Cause: Wallet has 0 tBNB.
- Fix: Use faucet to request test tokens. If faucet returns an error, try a different faucet or wait 24 hours.
Chain ID Mismatch
- Cause: Wallet connected to a different network (e.g., mainnet).
- Fix: Switch to BNB Testnet in your wallet. Verify the chain ID in your dApp configuration.
Key Takeaways
- BNB Testnet (chain ID 97) is an essential tool for testing BSC dApps before mainnet deployment.
- Use a reliable RPC provider—especially for automated testing—to avoid rate limits and downtime. OnFinality offers both public and private endpoints with WebSocket support.
- Always check that your wallet and application use the correct chain ID and RPC URL.
- Faucets are the only way to obtain tBNB; plan your testing to avoid running out.
- Archive nodes are available for historical data queries; confirm your provider supports them.
Frequently Asked Questions
Q: What is the difference between BNB Testnet and opBNB Testnet? A: BNB Testnet is for BNB Smart Chain (EVM), while opBNB Testnet is an Optimistic rollup testnet. Both are part of the BNB ecosystem but serve different purposes.
Q: Can I use BNB Testnet on hardware wallets? A: Yes, you can configure a hardware wallet (e.g., Ledger) with MetaMask to interact with BNB Testnet, but ensure the device is not set to mainnet.
Q: How fast are blocks on BNB Testnet? A: Approximately 3 seconds, same as mainnet. This allows quick testing iterations.
Q: Is there a testnet explorer? A: Yes, testnet.bscscan.com provides transaction and block details.
Q: Can I deploy a mainnet contract to testnet? A: Yes, because both environments are EVM-compatible. Deploy the same bytecode to testnet first to verify behavior.
For further help, explore the full list of supported networks on OnFinality or check our pricing page for production-grade plans.