Warning: External libraries (Ethers.js/Highlight.js) failed to load. Interactive features may not work. Check your internet connection.

Bxbit Chain API Documentation

Comprehensive developer reference covering JSON-RPC, enterprise-grade precompiled contracts, cross-chain interoperability, and integration guides.

Introduction

Bxbit Chain is an enterprise-grade EVM public blockchain designed for high-frequency commercial applications. While maintaining full Ethereum compatibility, it introduces Native Identity (DID), Gas Sponsorship, and Cross-Chain Interoperability through consensus-level innovations.

High Performance

IBFT 2.0 Consensus, 2-second block time, instant finality.

Zero Gas Barrier

Native Gas Sponsorship protocol lowers the entry barrier for users.

Get API Key

Bxbit Chain provides tiered API access permissions:

  • Local/Dev: No key required, direct access via http://localhost:8545.
  • Public Mainnet: Free tier requires no key but has rate limits (50 req/s).
  • Enterprise: Requires an API Key, providing unlimited rate limits and SLA guarantees.

Supported Chains

Network Name Chain ID RPC URL Explorer
Bxbit Local (Dev) 100 http://localhost:8545 n/a
Bxbit Mainnet 101 https://rpc.bxbit.cc scan.bxbit.cc

Rate Limits

Free

50 req/s

Pro

500 req/s

Enterprise

Unlimited

V2 Migration Guide

Migrating from V1 to V2 primarily involves the following precompile address changes:

- Old VRF (0x90...01) -> Native VRF (0x100)
- Old DID (0x90...02) -> Native DID (0x103)

Contract Secured Revenue (CSR)

Bxbit pioneers a protocol-level revenue sharing model. Smart contract developers can register for CSR to receive 20% of the Gas fees consumed by users interacting with their contracts as continuous revenue.

Core Mechanism

  • Registration: Developers call the registry contract to bind a beneficiary address.
  • Accrual: Gas fees are automatically distributed proportionally at each block settlement.
  • Claim: Developers can claim accumulated earnings at any time.

Native Gas Sponsorship (NGS)

Address: 0x00...0102

Native Gas Sponsorship allows DApps to pay Gas fees on behalf of users, enabling users to interact with applications without holding BXB tokens.

Workflow

  1. Project owner deposits BXB into the 0x102 contract.
  2. Project owner designates the sponsored contract address (Target).
  3. User initiates a transaction setting GasPrice = 0.
  4. Consensus layer verifies and deducts fees from the sponsor pool.
// Deposit Sponsorship
// deposit(address target, uint256 amount) -> 0xf340fa01
const tx = await wallet.sendTransaction({
    to: "0x102",
    value: ethers.utils.parseEther("10"),
    data: "0xf340fa01" + abi.encode(target, amount).slice(2),
    gasLimit: 100000
});

Native VRF

Address: 0x00...0100

Provides secure, verifiable on-chain randomness, suitable for GameFi lotteries, NFT blind boxes, and other scenarios requiring entropy.

// Get Random Number (StaticCall)
const randomness = await provider.call({
    to: "0x100",
    data: "0x",
    gasLimit: 100000
});

Native Interoperability

Address: 0x00...0101

Built-in light client verification logic supporting Merkle Patricia Trie (MPT) state proof verification for Ethereum, Polygon, and other EVM chains, enabling decentralized cross-chain communication.

Interface: verifyProof

verifyProof(bytes32 root, bytes key, bytes value, bytes[] proof)

Native DID (Identity)

Address: 0x00...0103

On-chain native identity system supporting KYC/AML compliance tagging.

// Check if user is verified (Level 5)
// verify(address user, uint256 level) -> 0xbbbbbbbb
const isVerified = await provider.call({
    to: "0x103", 
    data: "0xbbbbbbbb" + abi.encode(user, 5).slice(2)
});

Accounts

POST

eth_getBalance

Returns the balance (in Wei) of a specified address at a given block height.

{"method":"eth_getBalance","params":["0xF0b1...42fe", "latest"],"id":1}
POST

eth_getTransactionCount

Returns the number of transactions sent from an address (Nonce).

{"method":"eth_getTransactionCount","params":["0xF0b1...42fe", "latest"],"id":1}

Blocks

POST

eth_blockNumber

Returns the latest block height of the current chain.

{"method":"eth_blockNumber","params":[],"id":1}

Gas Tracker

POST

eth_gasPrice

Returns the current Gas price (in Wei).

{"method":"eth_gasPrice","params":[],"id":1}

L2 Deposit/Withdraw (Native Bridge)

Bxbit supports cross-chain asset verification via the Native Interoperability (0x101) precompiled contract.

Verify Cross-Chain Proof

// Address: 0x101
// Method: verifyProof(root, key, value, proof)
await provider.call({
    to: "0x101",
    data: payload // RLP encoded proof data
});

Create Wallet

Using Metamask

  1. Install Metamask extension.
  2. Add Network: https://rpc.bxbit.cc (ChainID: 101).
  3. Create a new account.

Using Ethers.js

const { ethers } = require("ethers");
const wallet = ethers.Wallet.createRandom();
console.log("Address:", wallet.address);
console.log("Private Key:", wallet.privateKey);

Connect Node

HTTPS

https://rpc.bxbit.cc

WebSocket

wss://ws.bxbit.cc

Deploy Node

# 1. Download binary
wget https://github.com/bxbitchain/releases/bxbit.tar.gz

# 2. Initialize data directory
./bxbit init --chain genesis.json

# 3. Start node
./bxbit server --chain genesis.json --grpc-address :9632 --libp2p :30301 --jsonrpc :8545

Governance

Proposal Workflow

  • Proposal: Initiate a proposal (BIP) on the forum.
  • Snapshot: Conduct off-chain pre-voting.
  • On-chain: Execute final voting through the Governance contract.

Contract Verification

Verify via Hardhat

npx hardhat verify --network bxbit 0xYourContract "Arg1" "Arg2"

Resources & Support

PRO Endpoints

grpc.bxbit.cc:9632

Contact Us

Email: bxb@bxbit.cc