Skip to content

brrq-net/brrq

Repository files navigation

Brrq

Bitcoin L2 with Hash-First Architecture

A Bitcoin Layer 2 built entirely on hash functions. 4 of 5 cryptographic layers operate on pure hash-based primitives: signatures (SLH-DSA), proofs (STARKs), state (SHA-256 Merkle), and equivocation detection (SLH-DSA dual signing).

Architecture

brrq-node (entry point)
 |- brrq-sequencer    Block building + transaction ordering
 |  \- brrq-vm        RISC-V zkVM (RV32IM) with gas metering
 |     \- brrq-prover STARK proof generation (BabyBear + FRI)
 |- brrq-consensus    Staking, epochs, slashing, leader election
 |- brrq-state        Sparse Merkle Tree (SHA-256 + Poseidon2)
 |- brrq-crypto       Schnorr, SLH-DSA, EOTS, MuSig2, ECVRF
 |- brrq-network      P2P gossip, sync, peer reputation
 |- brrq-bridge       BitVM2 peg-in/peg-out, federation
 |- brrq-portal       L3 instant payments (escrow, nullifiers)
 |- brrq-api          JSON-RPC, REST, WebSocket
 |- brrq-indexer      SQLite blockchain indexing
 |- brrq-bitcoin      L1 RPC client, SPV verification
 |- brrq-sdk          Rust wallet SDK
 |- brrq-wallet       CLI wallet
 \- brrq-types        Shared types (Block, Transaction, Address)

Quick Start

Prerequisites

  • Rust 1.88.0
  • Node.js 22+ (for web explorer and SDK)

Build

cargo build --release

Run Tests

cargo test --workspace

Run a Local Node

cargo run --release --bin brrq-node -- \
  --genesis testnet-genesis.toml \
  --sequencer \
  --rpc-port 8545

Docker

cd docker
docker compose up -d

Key Design Decisions

  • Hash-First: Post-quantum safe by construction, not by retrofit
  • Dual Signing: Every block signed with both EOTS (Schnorr) + SLH-DSA
  • STARK Proofs: Transparent setup (no trusted ceremony), BabyBear field
  • BitVM2 Bridge: Trustless peg-in/peg-out via on-chain dispute game
  • sqrt(x) Stake Cap: Prevents plutocratic control of validation
  • MEV Protection: Commit-reveal with epoch key encryption
  • No Governance Token: BTC is the only collateral

Documentation

Project Status

Pre-mainnet — Testnet: node.brrq.net

Community

License

Licensed under the MIT License.

Releases

No releases published

Packages

 
 
 

Contributors