| Crates.io | brk_indexer |
| lib.rs | brk_indexer |
| version | 0.1.0-beta.0 |
| created_at | 2025-02-23 23:30:40.558838+00 |
| updated_at | 2026-01-25 13:22:31.416807+00 |
| description | A Bitcoin indexer built on top of brk_reader |
| homepage | https://bitcoinresearchkit.org |
| repository | https://github.com/bitcoinresearchkit/brk |
| max_upload_size | |
| id | 1566725 |
| size | 153,329 |
Full Bitcoin blockchain indexer for fast analytics queries.
Transform raw Bitcoin blockchain data into indexed vectors and key-value stores optimized for analytics. Query any block, transaction, address, or UTXO without scanning the chain.
let mut indexer = Indexer::forced_import(&outputs_dir)?;
// Index new blocks
let starting_indexes = indexer.index(&blocks, &client, &exit)?;
// Access indexed data
let txindex = indexer.stores.txidprefix_to_txindex.get(&txid_prefix)?;
let blockhash = indexer.vecs.blocks.blockhash.get(height)?;
Vecs (append-only vectors):
blocks: blockhash, timestamp, difficulty, total_size, weighttransactions: txid, first_txinindex, first_txoutindexinputs: outpoint, txindexoutputs: value, outputtype, typeindex, txindexaddresses: Per-type p2pkhbytes, p2shbytes, p2wpkhbytes, etc.Stores (key-value lookups):
txidprefix_to_txindex - TXID lookup via 10-byte prefixblockhashprefix_to_height - Block lookup via 4-byte prefixaddresstype_to_addresshash_to_addressindex - Address lookup per typeaddresstype_to_addressindex_and_unspentoutpoint - Live UTXO set per address| Machine | Time | Disk | Peak Disk | Memory | Peak Memory |
|---|---|---|---|---|---|
| MBP M3 Pro (36GB, internal SSD) | 3h | 247 GB | 314 GB | 5.2 GB | 11 GB |
| Mac Mini M4 (16GB, external SSD) | 4.9h | 233 GB | 303 GB | 5.4 GB | 11 GB |
Full benchmark data: bitcoinresearchkit/benches
Use mimalloc v3 as the global allocator to reduce memory usage.
vecdb for append-only vectorsbrk_cohort for address type handlingbrk_iterator for block iterationbrk_store for key-value storagebrk_types for domain types