BNB Smart Chain
BNB Smart Chain API is available on Web3 API platform.
BNB Smart Chain is an innovative solution to bring programmability and interoperability to Beacon Chain. BNB Smart Chain relies on a system of 50 validators with Proof of Staked Authority (PoSA) consensus that can support short block time and lower fees. The most bonded validator candidates of staking will become validators and produce blocks. The double-sign detection and other slashing logic guarantee security, stability, and chain finality.
The BNB Smart Chain also supports EVM-compatible smart contracts and protocols. Cross-chain transfer and other communication are possible due to native support of interoperability.
The BNB Smart Chain highlights:
- EVM-Compatible
- Proof-of-Staked Authority
- Cross-Chain Transfer
- Block time
~3seconds
In order for your Web3 application to interact with BNB Smart Chain — either by reading blockchain data or sending transactions to the network — it must connect to a BNB Smart Chain node. Developers interact with the blockchain using the methods provided by the API.
The API interaction follows the JSON-RPC which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in many various message passing environments. It uses JSON (RFC 4627) as data format.
Methods supported
web3_clientVersion— returns the current client version.web3_sha3— returns Keccak-256 (not the standardized SHA3-256) of the given data.net_version— returns the current network ID.net_listening— returns true if client is actively listening for network connections.eth_syncing— returns data on the sync status or false.eth_gasPrice— returns the current price per gas in wei.eth_accounts— returns a list of addresses owned by client.eth_blockNumber— returns the number of most recent block.eth_getBalance— returns the balance of the account specified by address.eth_getStorageAt— returns the value from a storage position at an address specified.eth_getTransactionCount— returns the number of transactions sent from an address.eth_getBlockTransactionCountByHash— returns the number of transactions in a block specified by block hash.eth_getBlockTransactionCountByNumber— returns the number of transactions in the block specified by number.eth_getUncleCountByBlockHash— returns the number of uncles in a block specified by block hash.eth_getUncleCountByBlockNumber— returns the number of uncles in a block specified by block number.eth_getCode— returns code at an address specified.eth_sendRawTransaction— creates a new message call transaction or a contract creation for signed transactions.eth_call— executes a new message call immediately without creating a transaction on the blockchain.eth_estimateGas— generates and returns an estimate of how much gas is necessary to allow the transaction to complete.eth_getBlockByHash— returns information for the block specified by block hash.eth_getBlockByNumber— returns information for the block specified by block number.eth_getTransactionByHash— returns information on a transaction specified by transaction hash.eth_getTransactionByBlockHashAndIndex— returns information on a transaction specified by block hash and transaction index position.eth_getTransactionByBlockNumberAndIndex— returns information on a transaction by block number and transaction index position.eth_getTransactionReceipt— returns the receipt of a transaction by transaction hash.eth_getUncleByBlockHashAndIndex— returns information about an uncle of a block by hash and uncle index position.eth_getUncleByBlockNumberAndIndex— returns information about an uncle of a block by number and uncle index position.eth_getLogs— returns logs matching the parameters specified.
Trace and debug methods (archive nodes; Premium and Enterprise plans; priced the same as standard calls):
trace_filter— retrieve traces that match filter criteria.trace_transaction— retrieves the traces created during the execution of a given transaction.trace_replayTransaction— replays a transaction and returns the traces produced by its execution along with the state changes.trace_replayBlockTransactions— replays all the transactions in a given block and returns the traces produced by their execution along with the state changes.trace_block— retrieves a detailed trace of all the transactions in a specific block.debug_traceBlockByHash— traces the execution of all transactions within a block specified by hash.debug_traceBlockByNumber— traces the execution of all transactions within a block specified by number.debug_traceBlock— traces the execution of all transactions within a block.
Trace and debug methods
The trace_* and debug_* families are served on the BNB Smart Chain archive node and are available on the Premium and Enterprise plans. They are priced the same as standard calls.
Each API key has a block-range cap for these methods. A request whose block range exceeds the cap returns error -32602 (invalid params); narrow the block range or contact support to raise the cap for your key. See Per-chain & method quirks for the current limits.
Methods
web3, net, eth
web3_clientVersionweb3_sha3net_versionnet_listeningeth_syncingeth_gasPriceeth_accountseth_blockNumbereth_getBalanceeth_getStorageAteth_getTransactionCounteth_getBlockTransactionCountByHasheth_getBlockTransactionCountByNumbereth_getUncleCountByBlockHasheth_getUncleCountByBlockNumbereth_getCodeeth_sendRawTransactioneth_calleth_estimateGaseth_getBlockByHasheth_getBlockByNumbereth_getTransactionByHasheth_getTransactionByBlockHashAndIndexeth_getTransactionByBlockNumberAndIndexeth_getTransactionReceipt