19 releases
Uses new Rust 2024
| new 0.1.9 | Feb 13, 2026 |
|---|---|
| 0.1.8 | Feb 13, 2026 |
| 0.1.2 | Jan 29, 2026 |
| 0.1.0-alpha.1 | Dec 21, 2025 |
#734 in Magic Beans
Used in 5 crates
(4 directly)
590KB
19K
SLoC
brk_mempool
Real-time Bitcoin mempool monitoring with fee estimation.
What It Enables
Track mempool state, estimate transaction fees via projected block building, and query address mempool activity. Updates automatically with 1-second sync cycles.
Key Features
- Projected blocks: Simulates Bitcoin Core's block template algorithm with CPFP awareness
- Fee estimation: Multi-tier fee recommendations (fastest, half-hour, hour, economy, minimum)
- Address tracking: Maps addresses to their pending transactions
- Dependency handling: Respects transaction ancestry for accurate fee calculations
- Rate-limited rebuilds: Throttles expensive projections to 1/second
Core API
let mempool = Mempool::new(&rpc_client);
// Start background sync loop
std::thread::spawn(move || mempool.start());
// Query current state
let fees = mempool.get_fees();
let info = mempool.get_info();
let blocks = mempool.get_block_stats();
let snapshot = mempool.get_snapshot();
// Address lookups
let tracker = mempool.get_addresses();
Fee Estimation
Returns RecommendedFees with sat/vB rates for different confirmation targets:
fastest_fee- Next block (index 0)half_hour_fee- ~3 blocks (index 2)hour_fee- ~6 blocks (index 5)economy_fee- ~8 blocks (index 7, last projected block)minimum_fee- Relay minimum
Block Projection
Builds projected blocks by:
- Constructing transaction dependency graph
- Calculating effective fee rates (including ancestors)
- Selecting transactions greedily by ancestor-aware fee rate
- Partitioning into 1MB vsize blocks
Built On
brk_errorfor error handlingbrk_rpcfor mempool RPC callsbrk_typesforMempoolInfo,MempoolEntryInfo,RecommendedFees
Dependencies
~33MB
~479K SLoC