Skip to content

brrq-net/brrq

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

cd brrq    # inner workspace directory
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 brrq/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 either of Apache License 2.0 or MIT License, at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you shall be dual licensed as above, without any additional terms or conditions.

About

Bitcoin L2 with Hash-First Architecture

Topics

Resources

License

MIT and 2 other licenses found

Licenses found

MIT
LICENSE
Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors