Skip to content

bie202512-droid/bie-node

Repository files navigation

BIE Node

High-performance L1 blockchain node for the BIE Network, featuring a native DEX with perpetuals and spot trading.

Overview

BIE Node is the core blockchain infrastructure powering the BIE Network. Built in Rust for maximum performance and reliability, it implements:

  • BFT Consensus: Byzantine Fault Tolerant consensus mechanism for finality
  • Native DEX: Central Limit Order Book (CLOB) engine with sub-millisecond matching
  • EVM Compatibility: Full Ethereum Virtual Machine support
  • Perpetuals Trading: Native derivatives with up to 50x leverage
  • Oracle Integration: On-chain price feeds for derivatives

Architecture

┌─────────────────────────────────────────────────────────────┐
│                        BIE Node                             │
├─────────────────────────────────────────────────────────────┤
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────────────┐  │
│  │  Consensus  │  │   Mempool   │  │    State Machine    │  │
│  │    (BFT)    │  │             │  │                     │  │
│  └─────────────┘  └─────────────┘  └─────────────────────┘  │
├─────────────────────────────────────────────────────────────┤
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────────────┐  │
│  │   DEX/CLOB  │  │ Derivatives │  │       Oracle        │  │
│  │   Engine    │  │   Engine    │  │                     │  │
│  └─────────────┘  └─────────────┘  └─────────────────────┘  │
├─────────────────────────────────────────────────────────────┤
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────────────┐  │
│  │     EVM     │  │   Storage   │  │     Networking      │  │
│  │   Runtime   │  │  (RocksDB)  │  │      (P2P/RPC)      │  │
│  └─────────────┘  └─────────────┘  └─────────────────────┘  │
└─────────────────────────────────────────────────────────────┘

Features

  • High Throughput: 10,000+ TPS with sub-second finality
  • Native Spot Trading: On-chain order book with instant settlement
  • Perpetual Contracts: Cross-margin trading with liquidation engine
  • EVM Compatible: Deploy Solidity smart contracts
  • Efficient Storage: RocksDB-backed state with Merkle Patricia Trie

Quick Start

Prerequisites

  • Rust 1.70+
  • RocksDB
  • Protocol Buffers compiler

Build

cargo build --release

Run

# Start a single node (development)
./target/release/bie-node --config genesis.example.json

# Or use the provided script
./run_devnet.sh

Configuration

Copy the example genesis file and customize:

cp genesis.example.json genesis.json

Project Structure

src/
├── main.rs           # Entry point
├── consensus.rs      # BFT consensus implementation
├── bft_consensus.rs  # Byzantine fault tolerance
├── state_machine.rs  # State transition logic
├── mempool.rs        # Transaction pool
├── network.rs        # P2P networking
├── rpc.rs            # JSON-RPC server
├── evm.rs            # EVM integration
├── dex/              # DEX components
│   ├── clob/         # Central Limit Order Book
│   │   ├── engine.rs
│   │   └── orderbook.rs
│   └── mod.rs
├── derivatives.rs    # Perpetuals engine
├── oracle.rs         # Price oracle
├── vaults/           # Vault system
└── storage/          # RocksDB storage layer

API

The node exposes a JSON-RPC API compatible with Ethereum tooling:

Method Description
eth_blockNumber Get latest block number
eth_getBalance Get account balance
eth_sendRawTransaction Submit transaction
eth_call Execute call

Additional BIE-specific methods:

Method Description
bie_getOrderbook Get order book depth
bie_getPosition Get perpetual position
bie_getOraclePrice Get oracle price

Network

Network Chain ID RPC Endpoint
Mainnet 1342 https://rpc.bie.ai
Testnet 13420 https://testnet-rpc.bie.ai

Documentation

Contributing

We welcome contributions! Please see our contributing guidelines before submitting PRs.

License

Apache-2.0

Links

About

High-performance L1 blockchain node for the BIE Network with native DEX

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors