Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Bitcoin Commons Node
Minimal Bitcoin node implementation using blvm-protocol for protocol abstraction and blvm-consensus for consensus decisions.
📚 Comprehensive Documentation: See docs.thebitcoincommons.org (source repo: blvm-docs).
For verified system status: See SYSTEM_STATUS.md in the BTCDecoded organization repository.
Provides a minimal Bitcoin node implementation using blvm-protocol for protocol abstraction and blvm-consensus for all consensus decisions. Adds only non-consensus infrastructure: storage, networking, RPC, and orchestration.
Architecture Position
Tier 4 of the 6-tier Bitcoin Commons architecture (BLVM technology stack):
1. blvm-spec (Orange Paper - mathematical foundation)
2. blvm-consensus (pure math implementation)
3. blvm-protocol (Bitcoin abstraction)
4. blvm-node (full node implementation)
5. blvm-sdk (developer toolkit)
6. blvm-commons (governance enforcement)
Design Principles
- Zero Consensus Re-implementation: All consensus logic from blvm-consensus
- Protocol Abstraction: Uses blvm-protocol for variant support
- Pure Infrastructure: Only adds storage, networking, RPC, orchestration
- Production Ready: Full Bitcoin node functionality
Features
- Consensus Integration: All consensus logic from blvm-consensus
- Protocol Support: Multiple variants (mainnet, testnet, regtest)
- RBF Support: Configurable RBF modes (Disabled, Conservative, Standard, Aggressive)
- Mempool Policies: Comprehensive mempool configuration with 5 eviction strategies
- Payment Processing: CTV (CheckTemplateVerify) support for advanced payment flows
- Advanced Indexing: Address and value range indexing for efficient queries
- RPC Interface: JSON-RPC server with methods aligned to common Bitcoin node documentation
- Storage: UTXO set management and chain state with multiple backends (tidesdb, redb, sled, rocksdb)
- Module System: Process-isolated modules for optional features
- P2P Governance: Governance message relay via P2P protocol
See Security for production considerations.
Storage Backends
Supports multiple database backends via feature flags:
- rocksdb (default): High-performance database; reads common LevelDB/
blk*.datlayouts; strong IBD performance - redb: Embedded database with ACID transactions
- sled: Embedded key-value store (fallback)
- tidesdb (optional): LSM-tree key-value store; requires TidesDB C library
RocksDB (default backend):
- Automatic detection of common Bitcoin-style data directories
- Direct access to raw block files (
blk*.dat) where supported - Parsers for common on-disk chain formats
Default binary builds enable RocksDB (rocksdb feature). RocksDB requires a working C++ toolchain; CI installs libclang where bindgen is needed.
To build with redb only (pure Rust, no librocksdb-sys):
Omit governance if you do not need the HTTP client (Commons auto-detect uses reqwest via that feature). For Bitcoin-style ZMQ PUB notifications, load the blvm-zmq module (no longer a blvm-node feature flag).
Note: RocksDB and erlay features are mutually exclusive due to dependency conflicts.
RBF and Mempool Policies
Supports configurable RBF (Replace-By-Fee) modes and comprehensive mempool policies:
- RBF Modes: Disabled, Conservative, Standard (default), Aggressive
- Mempool Policies: Size limits, fee thresholds, eviction strategies, ancestor/descendant limits
See the Configuration Guide for details:
- RBF Configuration - Detailed RBF mode configuration
- Mempool Policies - Detailed mempool policy configuration
Protocol Variants
Supports multiple Bitcoin protocol variants:
- Regtest (default): Regression testing network for development
- Testnet3: Bitcoin test network
- BitcoinV1: Production Bitcoin mainnet
use ;
// Default: Regtest for safe development
let config = default;
let node = new?;
// Explicit testnet
let mut config = default;
config.network = Testnet3;
let testnet_node = new?;
Building
Quick Start
Cargo resolves blvm-consensus and other blvm-* dependencies from crates.io according to Cargo.toml. The [patch] flow below is only for local sibling development.
Local Development
If you're developing both blvm-node and blvm-consensus:
-
Clone both repos:
-
Set up local override:
-
Build:
Changes to blvm-consensus are now immediately reflected without git push.
Testing
# Run all tests
# Run with verbose output
Usage
Running the Node
# Start node in regtest mode (default)
# Start in testnet mode
# Start in mainnet mode (use with caution)
Programmatic Usage
use ;
// Default: Regtest for safe development
let config = default;
let node = new?;
// Start the node
node.start.await?;
See docs/ for detailed documentation including:
- Configuration Guide - Complete configuration options
- Module System - Process-isolated module system
- RPC Reference - JSON-RPC API documentation
Security
See SECURITY.md for security policies and BTCDecoded Security Policy for organization-wide guidelines.
Additional hardening required for production mainnet use.
Dependencies
Monorepo vs crates.io: In-tree builds use path dependencies for blvm-protocol, blvm-consensus, blvm-muhash, and optional blvm-spec-lock. From crates.io:
[]
= ">=0.1, <1"
- blvm-consensus: All consensus logic (via
blvm-protocolor direct optional dep) - tokio: Async runtime for networking
- serde: Serialization
- anyhow/thiserror: Error handling
- tracing: Logging
- clap: CLI interface
Contributing
See CONTRIBUTING.md and the BTCDecoded Contribution Guide.
License
MIT License - see LICENSE file for details.