Homepage · API Docs · Charts · Changelog
BRK is a toolkit for parsing, indexing, and analyzing Bitcoin blockchain data. It combines functionality similar to Glassnode (on-chain analytics), mempool.space (block explorer), and electrs (address indexing) into a single self-hostable package.
- Parse blocks directly from Bitcoin Core's data files
- Index transactions, addresses, and UTXOs
- Compute derived metrics across multiple time resolutions
- Monitor mempool with fee estimation and projected block building
- Serve data via REST API and web interface
- Query addresses, transactions, blocks, and analytics
The crates can be used together as a complete solution, or independently for specific needs.
Built on rust-bitcoin, vecdb, and fjall.
Entry Points
| Crate | Purpose |
|---|---|
brk |
Umbrella crate, re-exports all components via feature flags |
brk_cli |
CLI binary (cargo install --locked brk_cli) |
Core
| Crate | Purpose |
|---|---|
brk_reader |
Read blocks from blk*.dat with parallel parsing and XOR decoding |
brk_indexer |
Index transactions, addresses, and UTXOs |
brk_computer |
Compute derived metrics (realized cap, MVRV, SOPR, cohorts, etc.) |
brk_mempool |
Monitor mempool, estimate fees, project upcoming blocks |
brk_query |
Query interface for indexed and computed data |
brk_server |
REST API with OpenAPI docs |
Data & Storage
| Crate | Purpose |
|---|---|
brk_types |
Domain types: Height, Sats, Txid, addresses, etc. |
brk_store |
Key-value storage (fjall wrapper) |
brk_fetcher |
Fetch price data from exchanges |
brk_rpc |
Bitcoin Core RPC client |
brk_iterator |
Unified block iteration with automatic source selection |
brk_grouper |
UTXO and address cohort filtering |
brk_traversable |
Navigate hierarchical data structures |
Clients & Integration
| Crate | Purpose |
|---|---|
brk_mcp |
Model Context Protocol server for LLM integration |
brk_binder |
Generate typed clients (Rust, JavaScript, Python) |
brk_client |
Generated Rust API client |
brk_bundler |
JavaScript bundling for web interface |
Internal
| Crate | Purpose |
|---|---|
brk_error |
Error types |
brk_logger |
Logging infrastructure |
brk_bencher |
Benchmarking utilities |
blk*.dat ──▶ Reader ──┐
├──▶ Indexer ──▶ Computer ──┐
RPC Client ──┤ ├──▶ Query ──▶ Server
└──▶ Mempool ───────────────┘
Readerparsesblk*.datfiles directlyRPC Clientconnects to Bitcoin CoreIndexerbuilds lookup tables from blocksComputerderives metrics from indexed dataMempooltracks unconfirmed transactionsQueryprovides unified access to all dataServerexposesQueryas REST API
As a library:
use brk::{reader::Reader, indexer::Indexer, computer::Computer};
let reader = Reader::new(blocks_dir, &rpc);
let indexer = Indexer::forced_import(&brk_dir)?;
let computer = Computer::forced_import(&brk_dir, &indexer, None)?;As a CLI: See brk_cli
Public API: bitcoinresearchkit.org/api
Contributions are welcome. See open issues.
Join the discussion on Discord or Nostr.
Development supported by OpenSats.