<!-- This changelog was generated by AI -->

# Changelog

All notable changes to the Bitcoin Research Kit (BRK) project will be documented in this file.

> *This changelog was generated by Claude Code*

## [v0.11.0](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.11.0) - 2026-08-05

### Breaking Changes

#### `brk_types`, `brk_computer`, and generated clients

- Replaced most basis-point values with parts-per-million storage and API types. `BasisPoints16` and `BasisPointsSigned16` were removed, the 32-bit types became `PartsPerMillion32` and `PartsPerMillionSigned32`, and new signed and unsigned 64-bit variants were added. Generated Rust, JavaScript, and Python series paths consequently use `.ppm` instead of `.bps`, including renamed metrics such as `block_fullness_ppm` and `price_sma_200d_ratio_ppm` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_types/src/parts_per_million_32.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_types/src/parts_per_million_64.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_types/src/parts_per_million_signed_64.rs))
- Reserved the maximum integer encodings of `Cents` and `CentsCompact` as `NAN` sentinels. `MAX` now denotes that sentinel, finite callers must use `MAX_FINITE`, and direct integer extraction from a sentinel now fails instead of treating it as a price ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_types/src/cents.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_types/src/cents_compact.rs))
- Renamed the serialized `SeriesCount` fields from `distinct_series`, `total_endpoints`, `lazy_endpoints`, and `stored_endpoints` to the shorter `distinct`, `total`, `lazy`, and `stored` names ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_types/src/series_count.rs))
- Reorganized and reduced the exported metric tree to remove redundant stored cohort variants and duplicated realized-price SMA, deviation, z-score, and band families. OP_RETURN metrics moved from `scripts.raw.op_return` into the dedicated top-level `op_return` tree. Consumers should regenerate typed clients and review removed or relocated paths before upgrading stored data ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_computer/src/distribution/metrics/config.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_computer/src/lib.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_computer/src/op_return/vecs.rs))
- Reorganized entry-price cohorts under the semantic `cohorts.utxo.entry.discount` and `cohorts.utxo.entry.premium` paths, while retaining the stored Veteran and Rookie series prefixes for existing data ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_computer/src/distribution/vecs.rs))
- Split the broad `6m-1y` and `1y-2y` UTXO age cohorts into `6m-9m`, `9m-1y`, `1y-18m`, and `18m-2y`, and added matching under/over 9-month and 18-month aggregates. Series keyed by the former ranges must migrate to the new cohort paths ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_cohort/src/age_range.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_cohort/src/under_age.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_cohort/src/over_age.rs))

#### `vecdb` and `brk_traversable`

- Replaced `LazyVecFrom1` with the general single-source `LazyVec` and removed `LazyVecFrom2` and `LazyVecFrom3`. Multi-source arithmetic is now performed explicitly through eager or binary transform operations, keeping lazy vector derivations tied to one source ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/vecdb/src/variants/lazy/vec/mod.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/vecdb/src/ops/binary_transform/mod.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_traversable/src/lib.rs))

#### `quickmatch`

- Changed result ordering to rank matches by matched-word count, fuzzy score, earliest match position, candidate length, and deterministic lexical order. Applications that depended on the previous result order should treat the new order as part of the matching upgrade ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/quickmatch/src/lib.rs))

### New Features

#### `brk_mcp`

- Added `brk_mcp`, a thin, stateless, read-only MCP adapter generated from BRK's OpenAPI document. Every tool invocation is forwarded as a `GET` request to the configured REST origin, allowing deployments to reuse the REST API's Cloudflare cache without adding response caching or session state to the MCP server ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_mcp/src/server.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_mcp/src/upstream.rs))
- Added a single-argument `brk_mcp <REST_API_URL_OR_HOST>` interface. Bare hosts try HTTPS first and fall back to HTTP only after a transport failure; explicit origins are used as supplied. The local Streamable HTTP server starts at `127.0.0.1:3111` and tries successive ports through `3211` when occupied ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_mcp/src/config.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_mcp/src/main.rs))
- Embedded the generated tool manifest in the binary at compile time and added request-size, concurrency, rate, and Origin protections around the public MCP endpoint. This release implements MCP protocol version `2026-07-28`; the official stateless, tokenless instance is available at `https://mcp.bitview.space/` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_mcp/generated/manifest.json), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_mcp/src/manifest.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_mcp/README.md))

#### `brk_bindgen` and clients

- Added OpenAPI-driven MCP manifest generation and compact/full LLM documentation generation so the MCP tool catalog, `llms.txt`, and `llms-full.txt` share the canonical REST API descriptions instead of maintaining a separate hand-written API surface ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_bindgen/src/generators/llm/manifest.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_bindgen/src/generators/llm/mod.rs))
- Added RapidHash v3 address-payload prefix and match helpers to the generated Rust, JavaScript, and Python clients, plus mainnet Bitcoin address decoding and address-string hashing in Rust. Public clients can discover address candidates without sending a raw address or xpub to the server ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_bindgen/src/generators/rust/client.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_bindgen/src/generators/javascript/client.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_bindgen/src/generators/python/client.rs))
- Added per-request `memCache` control to generated JavaScript endpoint methods, independently of their HTTP/browser `cache` option, so callers can bypass the parsed-response LRU for selected requests ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_bindgen/src/generators/javascript/api.rs))
- Expanded generated endpoint metadata and parameter descriptions for both API readers and agents, including exact address-hash behavior, URPD weighting, endpoint cache policy, and typed request/response schemas ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_bindgen/src/openapi/endpoint.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_server/src/api/openapi/mod.rs))

#### `brk_indexer`, `brk_computer`, and `brk_types`

- Added raw OP_RETURN indexing and 23 protocol/content classifications: Runes, VeriBlock, Omni, Stacks, Blockstack, Colu, OpenAssets, Komodo, CoinSpark, Poet, Docproof, OpenTimestamps, Factom, EternityWall, Memo, Bitproof, Ascribe, Stampery, Epobc, BareHash, Text, Empty, and Unknown ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_types/src/op_return_kind.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_indexer/src/processor/txout/op_return.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_indexer/src/vecs/op_return.rs))
- Added total, per-kind, and policy OP_RETURN metrics for output and transaction counts, data bytes, virtual size, fees, chain share, data share, fee share, cumulative totals, and rolling windows ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_computer/src/op_return/vecs.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_computer/src/op_return/by_kind.rs))
- Added transaction analysis for scriptSig, redeem scripts, witnesses, output scripts, sighash modes, sigops, annexes, inscriptions, fake public keys and script hashes, dust, and nonstandard-policy conditions. The resulting typed flags and counts are stored per transaction for queries and downstream metrics ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_indexer/src/processor/transaction/analysis/mod.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_indexer/src/processor/transaction/analysis/policy.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_indexer/src/vecs/transactions/features/mod.rs))
- Added CoinJoin, consolidation, and batch-payout transaction-pattern series together with nonstandard-transaction policy metrics ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_computer/src/transactions/patterns/compute.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_computer/src/transactions/patterns/coinjoin.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_computer/src/transactions/policy/compute.rs))
- Added confirmed same-block CPFP cluster construction with ancestor and descendant relationships, chunk linearization, effective fee rates, sigops-adjusted virtual sizes, per-transaction parent/child flags, and per-block parent/child counts, extending CPFP analysis beyond the live mempool ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_query/src/impl/cpfp/confirmed.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_computer/src/transactions/fees/vecs.rs))

#### Frameworks and models

- Added the Coinflow framework with spending rate, exposure, mobility, mobile and immobile supply, all/STH/LTH splits, 1-month through 8-year horizons, capitalization, price, and loss-share series ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_computer/src/frameworks/coinflow/compute.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_computer/src/frameworks/coinflow/vecs.rs))
- Made Cointime canonical under the new `frameworks.cointime` tree while retaining the legacy top-level `cointime` branch, and expanded it with age-range coindays created, consumed, and stored; wakefulness and dormancy; awake and dormant supply; all/STH/LTH aggregates; adjusted capitalization and prices; reserve risk; and loss-share series ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_computer/src/frameworks/mod.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_computer/src/frameworks/cointime/age_range/compute.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_computer/src/frameworks/cointime/aggregate/compute.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_computer/src/frameworks/cointime/supply/vecs.rs))
- Added the Bedrock model with raw, cointime, coinflow, and horizon-weighted URPDs; P95, P98, P99, P99.5, and P99.9 loss thresholds; floor percentiles; and L10 through L90 price levels ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_computer/src/models/bedrock/compute.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_computer/src/models/bedrock/vecs.rs))
- Added the Capital Sentiment model with ten named phases, a score, and long/short state derived from spot price, capitalized-price references, and the one-year price moving average ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_types/src/capital_sentiment_phase.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_computer/src/models/capital_sentiment/compute.rs))
- Moved Rarity Meter from indicators into the models tree and expanded it with full-history, local, and cycle variants; percentile components; rank and tail thresholds; and extreme-state metrics for coins in loss, profit taking, capitulation, peak regret, and seller exhaustion ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_computer/src/models/rarity_meter/components.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_computer/src/models/rarity_meter/extremes.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_computer/src/models/rarity_meter/percentiles.rs))

#### URPD

- Added `raw`, `cointime`, and `coinflow` URPD weighting for latest, dated, and discovery queries. Responses now identify their selected weight, and weighted aggregate distributions are persisted for model and API reuse ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_types/src/urpd_weight.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_query/src/impl/urpd.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_server/src/api/urpd.rs))

#### Mining pools

- Added DMND as mining-pool ID 171, removed fixed pool-count assumptions, added pool JSON ID/slug validation, and exposed each block's ordinal `block_number` among blocks attributed to its pool. The pool catalog can now grow without changing array constants in consumers ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_types/pools-v2.json), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_types/src/pools.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_types/src/block_pool.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_computer/src/pools/pool_heights.rs))

#### `website_next`

- Added Bitview Ask, an entirely browser-side assistant using the approximately 580 MB Bonsai 4B model through WebGPU. Model files and conversations stay in the browser, with streaming responses, multiple chats, conversation compaction, stop/copy/remove controls, Markdown rendering, inline charts, and timing details ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/website_next/ask/model.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/website_next/ask/worker.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/website_next/ask/storage.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/website_next/ask/conversation/index.js))
- Added local assistant tools for source search, metric discovery and retrieval, OpenAPI endpoint routing and execution, chart creation, evidence tracking, numeric grounding, and arithmetic. A generated compressed source catalog supplies searchable project context without a server-side assistant service ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/website_next/ask/tools/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/website_next/ask/tools/source/search.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/website_next/ask/tools/api/routing.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/website_next/ask/tools/chart.js))
- Added a complete chain and block explorer with confirmed and projected block navigation, block headers, difficulty, miner attribution, rewards, fee charts, transaction lists, a transaction heatmap, filters, inspection, receipts, and QR rendering ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/website_next/explore/chain/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/website_next/explore/block/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/website_next/explore/block/preview/heatmap/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/website_next/explore/block/receipt/index.js))
- Moved Learn's plotting implementation into a shared chart system and expanded it with reusable area, bar, line, stacked, dot, and XY plots; legends; markers; scrubbers; fullscreen mode; interpolation; loading; persisted settings; and unit-aware formatting ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/website_next/chart/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/website_next/chart/plot.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/website_next/chart/xy/index.js))
- Expanded the watch-only wallet with stronger descriptor parsing, multisig derivation, scan-session handling, client-side address-hash lookup, activity and metadata loading, transaction history, holdings, address inspection, receive flow, and QR rendering ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/website_next/wallets/derive/descriptor-parser.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/website_next/wallets/derive/multisig.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/website_next/wallets/scan/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/website_next/wallets/wallet/index.js))
- Added shared brand, BTC, USD, mining-pool, legend, dialog, QR, cube, interaction, and color components used across Explore, Learn, Ask, and Wallets ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/website_next/brand/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/website_next/btc/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/website_next/pools/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/website_next/qr/index.js))

#### `website`

- Added classic website chart groups for Coinflow, expanded Cointime age ranges, Bedrock, Capital Sentiment, Rarity Meter, and OP_RETURN, and updated distribution, market, mining, unit, color, and URPD heatmap definitions for the new metric tree ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/website/scripts/options/frameworks/coinflow.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/website/scripts/options/models/bedrock.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/website/scripts/options/models/capital-sentiment.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/website/scripts/options/network/op-return.js))
- Added raw, cointime-weighted, and coinflow-weighted URPD heatmap trees across all, STH, LTH, and age-band cohorts, and exposed the new framework/model groupings through the website option hierarchy ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/website/src/heatmap/urpd.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/website/scripts/options/partial.js))

#### Owned imported crates

- Added `rawdb` from the project's `anydb` repository: a non-transactional, region-based, single-file mmap store with sparse allocation, automatic region movement, hole punching, concurrent readers, explicit durability, capacity reservation, and ordered batched writes. It is now the storage foundation for `vecdb` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/rawdb/src/lib.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/rawdb/src/region.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/rawdb/src/hole_punch.rs))
- Added `vecdb` from `anydb`: persistent fixed-size raw and compressed vectors, read-only and read-write views, typed cursors, cloneable caches, eager and lazy computation, stamped rollback, and Pco/LZ4/Zstd storage. BRK-side work added initial-capacity reservation, safe rollback when stamped writes omit change files, checked debug indexing, cache-generation invalidation, single-source lazy derivations, explicit binary transforms, and expanded rollback/capacity/cache tests ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/vecdb/src/lib.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/vecdb/src/base/rollback.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/vecdb/src/variants/cached/mod.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/vecdb/tests/rollback.rs))
- Added `vecdb_derive` from `anydb`, providing `Bytes` and `Pco` derive macros for custom fixed-size wrappers, including generic and nested-generic delegation to the wrapped type ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/vecdb_derive/src/lib.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/vecdb_derive/tests/bytes_generics.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/vecdb_derive/tests/pco_generics.rs))
- Added the Rust `quickmatch` implementation from the project's Quickmatch repository for low-allocation metric and source discovery. It includes bounded joined-word queries, ASCII separator lookup, extracted trigram scoring, deterministic ranking, and a fix for joined-word maximum-length handling ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/quickmatch/src/lib.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/quickmatch/src/config.rs))

#### BRK-maintained storage forks

- Added the BRK-maintained Byteview fork under the package name `brk_byteview`, retaining the Rust library name `byteview` for source compatibility ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/byteview/Cargo.toml), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/byteview/README.md))
- Added the BRK-maintained Fjall and LSM-tree forks under the package names `brk_fjall` and `brk_lsm_tree`, while retaining the `fjall` and `lsm_tree` Rust library names. The forks remove unused blob/value-log, FIFO/tiered compaction, transaction, fixture, test, and dependency surfaces while preserving the LZ4, simple-keyspace, and leveled-LSM functionality used by BRK ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/fjall/Cargo.toml), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/lsm-tree/Cargo.toml))
- Improved the maintained storage stack's exclusive point reads, Bloom filtering, table and super-version read paths, ingestion/recovery behavior, and macOS metadata-file recovery handling, with focused regression coverage for snapshots, recovery, ingestion, checksums, ranges, tombstones, and concurrent reads ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/lsm-tree/tests/exclusive_point_read.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/lsm-tree/src/version/super_version.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/fjall/src/recovery.rs))

#### Benchmarks

- Added and refreshed full BRK, indexer, and computer benchmark harnesses together with committed CSV and SVG histories, including the v0.11.0 M3 Pro run and comparison data for earlier releases and machines ([source](https://github.com/bitcoinresearchkit/brk/tree/v0.11.0/benches/brk), [source](https://github.com/bitcoinresearchkit/brk/tree/v0.11.0/benches/brk_indexer), [source](https://github.com/bitcoinresearchkit/brk/tree/v0.11.0/benches/brk_computer))

### Bug Fixes

#### Queries and API

- Added explicit confirmed `chain_stats.balance`, signed pending `mempool_stats.balance_delta`, and total `balance` fields to address responses, fixing total balances to include both confirmed chain state and current mempool changes ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_types/src/addr_chain_stats.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_types/src/addr_mempool_stats.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_types/src/addr_stats.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_query/src/impl/addr/stats.rs))
- Fixed typed index and read-only reader handling across address transactions, UTXOs, blocks, transactions, pools, series, CPFP, and mempool queries, including reading transaction input values from the consolidated input-value vector ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_query/src/vecs.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_query/src/impl/tx.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_query/src/impl/block/txs.rs))
- Fixed BRK price-fetcher chunk lookup at height and date boundaries by calculating a normalized chunk key and offset and refetching incomplete cached chunks when necessary ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_fetcher/src/brk.rs))

#### Storage

- Fixed `vecdb` rollback and truncation behavior, including rollback after writes without change files, raw final-page handling, compressed read/write state, and restoration of safe lengths after restart ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/vecdb/src/base/rollback.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/vecdb/tests/rollback_truncation.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/vecdb/tests/raw_last_page.rs))
- Fixed stale cache publication by invalidating in-flight `vecdb` materializations when the source generation changes, preventing an old computation from replacing newer cached data ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/vecdb/src/variants/cached/mod.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/vecdb/tests/write_visibility.rs))
- Fixed owned-store ingest persistence so removals and insertions are applied in order and survive database reopen, with a regression test covering repeated synchronous ingest ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_store/src/lib.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_store/tests/owned_ingest.rs))
- Fixed LSM exclusive point reads, Bloom expectations, recovery cleanup, ingestion invariants, table checksums, weak tombstones, snapshot visibility, and super-version read consistency in the BRK-maintained forks ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/lsm-tree/tests/exclusive_point_read.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/lsm-tree/tests/recover_cleanup_orphans.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/lsm-tree/tests/table_full_file_checksum.rs))

### Internal Changes

#### Computation and indexing

- Refactored block, transaction, input, output, address, and script processing into focused stages with shared caches and typed stored vectors. This removes duplicate resolution work and makes OP_RETURN, policy, sigops, and transaction-feature analysis part of the normal indexer pipeline ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_indexer/src/processor/mod.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_indexer/src/processor/transaction/mod.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_indexer/src/stores.rs))
- Moved indexer safe-length publication to the successful end of `Computer::compute`, after all joined computation stages complete, so readers only observe a newly indexed range once the full pipeline has made it queryable ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_computer/src/lib.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_indexer/src/lib.rs))
- Removed the redundant `capitalized_cap_raw` field from `FundedAddrData`, shrinking every funded-address record from 64 to 48 bytes; receive and spend operations now return their exact realized-cap deltas for aggregate computation ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_types/src/funded_addr_data.rs))
- Overhauled metric computation around cached first-height, date, timestamp, lookback-window, moving-average, and source boundaries; single-source lazy per-block calculations; reusable transforms; and fewer persisted duplicates ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_computer/src/blocks/lookback/cached_window_start.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_computer/src/market/moving_average/cached_sma_source.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_computer/src/internal/transform/mod.rs))
- Generalized daily and per-block metric containers and accelerated distribution, address, cohort, cost-basis, Fenwick-tree, transfer, and output-type processing with reusable caches and typed readers ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_computer/src/internal/per_block/mod.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_computer/src/distribution/all_chain_cache.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_computer/src/distribution/block/cohort/transfer_address_cache.rs))
- Added `VecIndex` implementations across BRK's typed indexes and migrated indexer, computer, mempool, oracle, query, store, and traversable code to the new typed vector/read-only reader interfaces ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_types/src/vec_index.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_mempool/src/snapshot/builder.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_oracle/examples/report.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_traversable/src/lib.rs))
- Updated traversable derivation so hidden fields remain part of exportable storage traversal while staying absent from the public API tree, preventing hidden persisted vectors from being dropped during retention/export operations ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_traversable_derive/src/lib.rs))

#### Runtime and tooling

- Added caller-selected fallback log levels through `brk_logger::init_with_default_level` while preserving `LOG` and `RUST_LOG` precedence ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_logger/src/lib.rs))
- Changed the website example server to try ports 3110 and 3111 in order, allowing it to coexist with another local BRK service when the default port is occupied ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_website/examples/website.rs))
- Updated the release test workflow to exclude the external `mempool_compat` integration suite, keeping network-dependent mempool.space compatibility checks out of crate releases ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/scripts/release.sh))
- Updated the workspace Rust toolchain to 1.97.1, aligned publishable workspace packages and generated clients at version 0.11.0, and refreshed third-party dependencies ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/rust-toolchain.toml), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/Cargo.toml))

#### Documentation and generated artifacts

- Regenerated the Rust, JavaScript, and Python clients, API trees, OpenAPI schemas, JavaScript TypeDoc pages, Python documentation, MCP manifest, and compact/full LLM documentation for the complete v0.11.0 API ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_client/src/lib.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/modules/brk-client/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/packages/brk_client/brk_client/__init__.py), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/website/llms.txt))
- Updated crate READMEs and API documentation to describe the official REST and stateless MCP instances and the new monorepo-owned storage/search crates ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk/README.md), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_cli/README.md), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.11.0/crates/brk_server/README.md))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.3.6...v0.11.0)

## [v0.3.6](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.3.6) - 2026-06-27

### Bug Fixes

#### `website`

- Fixed chart PNG export metadata by deriving the share title and download filename from the chart heading, producing named files such as `bitview-{chart-id}.png` instead of anonymous blob exports ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.6/website/scripts/utils/chart/capture.js))
- Fixed chart PNG export on iPhone, iPad, and iPadOS desktop user agents by treating touch-capable Mac user agents as iOS and creating the PNG blob through a synchronous data-URL path on that platform, giving mobile Safari a reliable capture payload ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.6/website/scripts/utils/env.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.6/website/scripts/utils/chart/capture.js))
- Fixed mobile chart export delivery by routing iOS captures through the Web Share sheet when file sharing is available, allowing users to save or share generated chart PNGs through the native browser flow ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.6/website/scripts/utils/chart/capture.js))
- Fixed popup-blocked chart exports by falling back to a named download link when `window.open` cannot open the PNG blob, preserving a working export path for browsers that block new blob tabs ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.6/website/scripts/utils/chart/capture.js))
- Fixed exported PNG object URL lifetime by tracking opened blob URLs and revoking them on `pagehide` instead of shortly after opening, preventing exported image tabs from losing their blob before loading while still cleaning URLs when the page unloads ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.6/website/scripts/utils/chart/capture.js))

### Internal Changes

#### `clients`

- Regenerated the generated JavaScript client documentation so TypeDoc source links point at the released generated client snapshot, keeping documentation navigation aligned with the shipped client artifact ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.6/modules/brk-client/docs/classes/BrkClient.md))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.3.5...v0.3.6)

## [v0.3.5](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.3.5) - 2026-06-23

### New Features

#### `brk_types`

- Added `AddrHashPrefixMatches`, a serializable response type carrying the requested address type, normalized hash prefix, truncation flag, and matched addresses so prefix-search results have a stable API shape ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/crates/brk_types/src/addr_hash_prefix_matches.rs))
- Added a public `AddrHash::new(u64)` constructor, allowing query code to build typed lower and upper hash bounds for address-prefix range scans without untyped numeric casts ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/crates/brk_types/src/addr_hash.rs))

#### `brk_query`

- Added `Query::addr_hash_prefix_matches(addr_type, prefix)`, which validates address output types, accepts 1 to 16 hexadecimal prefix nibbles, range-scans address payload hashes, skips entries beyond safe index lengths, returns up to 100 candidate addresses, and sets `truncated` when a bucket is too large. Wallet clients can use this to discover anonymity-set candidates without sending raw addresses or xpubs to a public server ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/crates/brk_query/src/impl/addr/hash_prefix.rs))

#### `brk_server`

- Added `GET /api/address/hash-prefix/{addr_type}/{prefix}` with typed path parameters, tip caching, OpenAPI metadata, and `AddrHashPrefixMatches` JSON output, exposing the new prefix-search query through the HTTP API for wallet discovery clients ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/crates/brk_server/src/api/addrs.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/crates/brk_server/src/params/addr_hash_prefix_param.rs))

#### `brk_client`

- Added the Rust client method `get_address_hash_prefix_matches(addr_type, prefix)`, giving Rust callers typed access to the address hash-prefix endpoint without constructing the URL by hand ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/crates/brk_client/src/lib.rs))

#### `clients`

- Added generated JavaScript and Python `AddrHashPrefixMatches` / `AddrHashPrefixParam` types and `getAddressHashPrefixMatches` / `get_address_hash_prefix_matches` methods, giving browser and Python consumers direct access to the new wallet-discovery endpoint ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/modules/brk-client/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/packages/brk_client/brk_client/__init__.py))
- Published generated client documentation for the address hash-prefix endpoint and its request/response types, making the new API discoverable from the shipped JavaScript and Python docs ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/modules/brk-client/docs/interfaces/AddrHashPrefixMatches.md), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/packages/brk_client/DOCS.md))

#### `website_next`

- Added the `/wallets` route, Home link, stylesheet imports, and dialog support for the Wallets page, allowing users to open the watch-only wallet workspace from the next website navigation ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/routes.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/home/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/index.html))
- Added an encrypted persistent wallet vault stored in the browser with password-based create, unlock, lock, reset, add-wallet, and delete-wallet flows, so watch-only wallet sources can persist locally without server storage ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/vault/encryption.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/vault/storage.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/vault/index.js))
- Added a temporary vault mode that keeps imported wallets out of browser storage and can be cleared from the session controls, giving users a no-persistence option for one-off wallet checks ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/start/temporary.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/vault/index.js))
- Added the Add Wallet dialog with name and source fields, xpub or descriptor extraction from pasted text, source redaction, and validation by deriving the first address before saving, preventing unsupported watch-only sources from entering the vault ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/add/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/add/source.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/index.js))
- Added horizontal wallet selection with scroll snapping, add buttons, lock/clear controls, and hold-to-delete or hold-to-reset actions, making multi-wallet navigation and destructive actions available without accidental single-click deletion ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/selector/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/hold/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/start/reset/index.js))
- Added a privacy redaction system for wallet sources, balances, dates, txids, and addresses, including a page-level Privacy/Reveal toggle that keeps sensitive values masked during wallet viewing ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/redaction/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/amount/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/index.js))
- Added browser-side parsing for `xpub`, `ypub`, `zpub`, `tpub`, `upub`, and `vpub` keys plus non-hardened BIP32 public derivation, allowing the Wallets page to derive watch-only receive, change, and direct branches locally ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/derive/key.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/derive/bip32.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/derive/index.js))
- Added browser-side address encoding and crypto helpers for Base58Check, Bech32, Bech32m, SHA-256, RIPEMD-160, HMAC-SHA512, secp256k1 public-key tweaks, P2PKH, nested P2WPKH, native P2WPKH, and P2TR address generation, keeping single-key wallet derivation on the client device ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/derive/address.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/derive/hash.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/derive/secp256k1.js))
- Added `wsh(sortedmulti(...))` descriptor support with checksum stripping, origin metadata tolerance, ranged non-hardened paths, receive/change descriptor selection, network consistency checks, BIP-sorted multisig script construction, and native P2WSH address generation, allowing multisig watch-only descriptors to be scanned from the browser ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/derive/descriptor.js))
- Added wallet scanning across supported scripts and branches with a 10-unused-address gap limit, a 1,000-address scan ceiling, progress messages, cached runtime results, BTC/USD price loading, and next receive-address selection based on observed activity, so wallet scans can stop predictably and present a usable receive address ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/scan/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/scan/branches.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/vault/runtime.js))
- Added public-server wallet lookup through RapidHash v3 address-payload prefixes, expanding from 4 to 16 prefix nibbles until the returned bucket is not truncated; local and private servers use direct address lookups instead. This lets public scans fetch metadata for anonymity-set buckets while local scans avoid unnecessary bucket work ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/lookup/bucket.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/lookup/hash.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/lookup/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/lookup/local.js))
- Added the wallet summary panel with total BTC balance, USD value from the live price endpoint, and redaction-aware amount rendering, giving users an immediate portfolio-level view after a scan completes ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/wallet/summary/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/amount/index.js))
- Added a Receive dialog for the selected next receive address, including branch/index labeling, a `bitcoin:` QR code, grouped address rendering, copy-to-clipboard handling, and close-on-backdrop behavior ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/wallet/receive/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/wallet/address/index.js))
- Added the History tab, which loads transactions for used wallet addresses, caches bucket histories, de-duplicates transactions by txid, groups confirmed transactions by date and mempool transactions separately, classifies receive/send/consolidation activity, and shows expandable fee, txid, and involved-address details ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/wallet/history/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/wallet/history/cache.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/wallet/history/transaction.js))
- Added the Holdings tab, which loads UTXOs for positive-balance wallet addresses, caches bucket UTXO responses, treats missing addresses as empty, sorts spendable outputs by value, and displays confirmed or mempool outpoints with their owning wallet address ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/wallet/holdings/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/wallet/holdings/cache.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/wallet/holdings/utxo.js))
- Added the Addresses tab, listing used wallet addresses with branch labels, derivation indexes, balances, transaction counts, grouped redaction-aware address text, and anonymity-set sizes so users can inspect what the scan found and how private each public lookup bucket was ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/wallet/addresses/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/wallet/address/index.js))

### Bug Fixes

#### `brk_bindgen`

- Fixed generated JavaScript client base URL parsing by resolving the configured base URL with `URL` and browser `location.href` fallback, allowing relative API roots and exposing a reliable parsed domain for client-side local/public server decisions ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/crates/brk_bindgen/src/generators/javascript/client.rs))

#### `clients`

- Applied the JavaScript base URL parsing fix to the shipped generated browser client, so consumers can instantiate the client with relative paths while `client.url` and `client.domain` still resolve to normalized values ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/modules/brk-client/index.js))

### Internal Changes

#### `brk_query`

- Split address query code into focused `activity`, `hash_prefix`, `mempool`, `resolve`, `stats`, `txs`, and `utxos` modules while keeping the existing address stats, transaction, UTXO, mempool, and last-activity query behavior available through the same `Query` methods ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/crates/brk_query/src/impl/addr/mod.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/crates/brk_query/src/impl/addr/resolve.rs))

#### `website_next`

- Replaced the embedded `website_next` generated client copy with a link to the workspace `modules` directory and excluded that module link from TypeScript checking, keeping the next website on the shared generated client bundle used elsewhere in the workspace ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/modules), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/tsconfig.json))
- Added shared wallet UI primitives for buttons, link-buttons, input fields, dialogs, busy states, status messages, number formatting, BTC amount rendering, redaction synchronization, and hold-to-confirm actions, giving the Wallets page reusable behavior for its vault, scanner, and wallet detail panels ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/styles/main.css), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/dialog/style.css), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/dom.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.5/website_next/wallets/format.js))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.3.4...v0.3.5)

## [v0.3.4](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.3.4) - 2026-06-14

### Breaking Changes

#### `brk_client`

- Changed the generated `SeriesTree_Cohorts_Utxo_Lth_Realized.sopr` Rust field to use the shared `RatioValuePattern2` type. Code that names the generated concrete SOPR struct must use `RatioValuePattern2`, while `.sopr.ratio` and `.sopr.value_destroyed` access still point to the same series paths ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/crates/brk_client/src/lib.rs))

#### `clients`

- Changed the generated JavaScript and Python LTH realized SOPR node to the shared `RatioValuePattern2` shape. Consumers that refer to generated type or class names must use the shared pattern name, while existing ratio and value-destroyed property access remains available ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/modules/brk-client/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/packages/brk_client/brk_client/__init__.py))

### New Features

#### `brk_cohort`

- Added immutable entry-price cohorts through `EntryPrice`, `ByEntry`, `ENTRY_FILTERS`, and `ENTRY_NAMES`, creating the `Veteran`/`Rookie` cohort pair for coins created at a discount or premium to the entry anchor ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/crates/brk_cohort/src/by_entry.rs))
- Added `Filter::Entry` and wired entry cohorts into UTXO cohort construction, iteration, mutable iteration, parallel iteration, and separate cohort traversal so all UTXO cohort consumers can discover and compute entry cohorts through the same traversal APIs as term, age, class, epoch, amount, and type cohorts ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/crates/brk_cohort/src/filter.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/crates/brk_cohort/src/utxo.rs))
- Marked entry cohorts as extended UTXO cohorts and kept their display names unprefixed, giving Veteran/Rookie the same realized-cap, ratio, percentile, and cost-basis metric coverage as the extended aggregate cohorts without adding context prefixes to chart labels ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/crates/brk_cohort/src/filter.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/crates/brk_cohort/src/cohort_context.rs))

#### `brk_computer`

- Added entry cohort computation to the distribution block loop by classifying each block's new UTXOs against the previous all-cohort capitalized price. This creates the data foundation for comparing coins born below the realized valuation anchor with coins born above it ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/crates/brk_computer/src/distribution/compute/block_loop.rs))
- Stored each UTXO's entry cohort in `BlockState` and applied receives, spends, and zero-value supply adjustments to the matching entry cohort, keeping Veteran/Rookie membership immutable for the full lifetime of a UTXO ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/crates/brk_computer/src/distribution/state/block.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/crates/brk_computer/src/distribution/cohorts/utxo/receive.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/crates/brk_computer/src/distribution/cohorts/utxo/send.rs))
- Rebuilt entry cohort state during distribution resume from stored capitalized price history and passed the correct entry anchor into resumed block processing, so restarted indexing keeps the same Veteran/Rookie classifications as a clean run ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/crates/brk_computer/src/distribution/vecs.rs))
- Included entry cohorts in UTXO cohort import, iteration, compute-rest execution, and vector collection, making entry metrics part of the persisted distribution dataset instead of an in-memory-only classification ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/crates/brk_computer/src/distribution/cohorts/utxo/groups.rs))
- Added entry-aware cost-basis support to the Fenwick cache by tracking the discount-entry partition, deriving premium as all coins minus discount coins, and pushing Veteran/Rookie cost-basis percentiles plus density values for charting cost-basis concentration by entry cohort ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/crates/brk_computer/src/distribution/cohorts/utxo/fenwick.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/crates/brk_computer/src/distribution/cohorts/utxo/percentiles.rs))
- Returned the all-cohort capitalized price from realized metric accumulation and used it as the next block's entry anchor, tying entry classification directly to the computed capitalized-price series that users can inspect ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/crates/brk_computer/src/distribution/metrics/realized/full.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/crates/brk_computer/src/distribution/cohorts/utxo/groups.rs))

#### `brk_bindgen`

- Exported `ENTRY_NAMES` from generated constants, allowing Rust, JavaScript, Python, and website code to use the same Veteran/Rookie IDs and labels as `brk_cohort` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/crates/brk_bindgen/src/generate/constants.rs))

#### `brk_client`

- Added the generated Rust client tree under `series.cohorts.utxo.entry.discount` and `series.cohorts.utxo.entry.premium`, exposing Veteran/Rookie supply, outputs, activity, realized metrics, cost basis, unrealized values, and invested capital through typed client accessors ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/crates/brk_client/src/lib.rs))
- Added `RatioValuePattern2` for SOPR ratio plus value-destroyed access, giving entry cohorts and the LTH realized SOPR node one shared typed pattern for SOPR series reads ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/crates/brk_client/src/lib.rs))

#### `clients`

- Added generated JavaScript and Python access to `cohorts.utxo.entry.discount` and `cohorts.utxo.entry.premium`, so browser and Python consumers can fetch Veteran/Rookie entry cohort metrics without hand-building series names ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/modules/brk-client/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/packages/brk_client/brk_client/__init__.py))
- Published generated client documentation for `ENTRY_NAMES`, the entry cohort tree, Veteran/Rookie realized-price nodes, and the shared SOPR ratio/value-destroyed pattern, making the new client surface discoverable from the shipped docs ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/packages/brk_client/DOCS.md), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/modules/brk-client/docs/interfaces/SeriesTree_Cohorts_Utxo_Entry.md))

#### `website`

- Added a Distribution `Entry` folder with a `Veteran vs Rookie` comparison and individual Veteran/Rookie cohort folders, letting website users chart entry cohorts with the same NUPL, realized, unrealized, supply, and cohort metric views used by existing distribution folders ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website/scripts/options/partial.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website/scripts/options/distribution/data.js))

#### `website_next`

- Changed the Home and header experience so the fixed header carries only the bitview brand link while Home presents direct Explore, Learn, and Build links. This makes the first screen the entry point for section selection instead of duplicating primary navigation in the header ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/home/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/header/index.js))
- Added route canonicalization, hash-preserving route navigation, per-page `pageactive` events, and Cloudflare SPA asset fallback configuration, allowing direct deep links and client-side route transitions to land on the intended page state ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/routes.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/main.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/wrangler.toml))
- Replaced the placeholder Learn taxonomy with data-backed Introduction, Supply, UTXO Set, Address Count, Mining Pools, and Capitalization sections, turning Learn into a smaller set of populated sections rather than a broad menu with placeholder charts ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/data/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/data/sections/introduction.js))
- Added Supply Learn charts for circulating supply, profitability, exposed public-key supply, exposed supply by type, term, age, UTXO balance, address balance, output type, halving epoch, and creation-year class, giving readers direct chart access to supply composition and exposed-key risk ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/data/sections/supply.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/data/supply.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/data/cohorts.js))
- Added UTXO Set Learn charts for total set size, net change, growth rate, spent outputs, spending rate, spending rate by term/age/balance/type/epoch/class, and UTXO count distribution by the same cohort groups, making set turnover and set composition readable from one section ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/data/sections/utxo-set.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/data/utxo-set.js))
- Added Address Count Learn charts for funded addresses, new addresses, funded-address change, funded-address growth rate, active/sending/receiving/bidirectional/reactivated addresses, funded/empty/total state, balance cohorts, address type cohorts, and reuse signals, covering address-set growth, activity, distribution, and privacy-relevant reuse in the guide ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/data/sections/address-count.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/data/address-count.js))
- Added Mining Pools Learn charts for major pool dominance, major pool blocks mined, major pool rewards, per-major-pool dominance/blocks/rewards, and minor pool dominance/blocks, giving readers a charted view of mining concentration and attributed block production ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/data/sections/mining-pools.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/data/mining-pools.js))
- Added Market Cap and Realized Cap Learn charts with splits by profitability, term, age, UTXO balance, address balance, output type, halving epoch, and creation-year class, allowing valuation comparisons across the same cohort dimensions used in supply views ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/data/sections/capitalization.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/data/sections/capitalization/market.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/data/sections/capitalization/realized.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/data/capitalization.js))
- Added collapsible Learn sections with persisted open state, synchronized contents-sidebar state, hash-driven ancestor opening, and active-hash toggling, so readers can keep long sections collapsed while preserving deep-link behavior ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/details.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/hash-links.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/index.js))
- Added path-based Learn section IDs, nested contents entries, and scroll-spy navigation that keeps the current hash and contents sidebar aligned with the visible nested section, making repeated titles such as `Type` or `Balance` safe to deep link ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/path.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/contents/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/scroll-spy.js))
- Added chart lifecycle management with near-viewport activation, suspension when charts leave view, cached timeframe loading, loading status, and error status, reducing unnecessary chart work while keeping visible Learn charts responsive ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/charts/intersection.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/charts/loader.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/charts/renderer.js))
- Added Learn chart controls for area view, line view, stacked view, bar view, dot view, linear/log scale, ascending/descending series order, unit-aware formatting, and persisted per-chart settings, giving readers more ways to inspect the same series without leaving the chart ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/charts/views.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/charts/area/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/charts/scale.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/charts/order.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/charts/units.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/charts/setting.js))
- Added clickable/pinned legend highlighting, preview highlighting from chart scrub position, scrubber shade, scrubber markers, unit-aware readouts, and keyboard scrub controls, making multi-series Learn charts inspectable by date and by selected cohort ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/charts/legend/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/charts/highlight.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/charts/scrubber/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/charts/format.js))

### Bug Fixes

#### `website`

- Fixed root website reads of generated price series by changing `brk.series.prices` callers to `brk.series.price`, restoring market option construction and chart-pane live price overlays against the generated client tree ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website/scripts/options/market.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website/scripts/panes/chart.js))

#### `website_next`

- Fixed route clicks with trailing slashes and route-plus-hash targets by resolving canonical paths before navigation and preserving the hash in the pushed route, so links such as `/learn#supply` open the expected page and section ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/routes.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/main.js))
- Fixed plain-click detection to respect `Alt`-click and made event-target lookup safe for non-Element event targets, preserving browser modifier behavior and preventing `.closest()` calls on unsupported targets ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/utils/event.js))
- Fixed generated anchor IDs by replacing non-alphanumeric runs and trimming leading or trailing separators, preventing punctuation in headings from producing fragile Learn deep-link IDs ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/utils/id.js))
- Fixed Learn chart fullscreen button state by listening for fullscreen changes on the target element, keeping the control state tied to the chart that entered or exited fullscreen ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/charts/fullscreen.js))

### Internal Changes

#### `website`

- Replaced the checked-in `website/scripts/modules` vendor tree with a link to the workspace `modules` directory, making the root website consume the same local client and browser modules as the rest of the repository ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website/scripts/modules))

#### `website_next`

- Split Learn chart code into renderer, loader, plot dispatcher, scale, order, setting, series-path, area, legend, scrubber, math, and type declaration modules, keeping chart loading, chart settings, plotting, and interaction code in focused files for future chart work ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/charts/renderer.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/charts/plot.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/charts/types.d.ts))
- Split Learn data definitions into reusable cohort, group, rolling-window, supply, UTXO set, address-count, mining-pool, capitalization, and section modules, making each Learn topic source its chart series from named data builders instead of one monolithic data file ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/data/cohort-series.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/data/groups.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/data/types.d.ts))
- Split Learn chart CSS into control, legend, scrubber, and area styles, and changed Learn page styling for nested collapsible headings, sidebar scroll alignment, chart fullscreen layout, and chart loading states so the larger nested guide remains navigable and readable ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/charts/controls/style.css), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/charts/legend/style.css), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/charts/scrubber/style.css), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/style.css), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/learn/contents/style.css))
- Changed the shared `website_next` visual foundation to a dark-only variable set with selection colors, thin scrollbars, inherited textarea fonts, `h4` serif headings, and zero-duration reduced-motion transitions, aligning base styles with the next website's Learn and Home layouts ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/styles/variables.css), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/styles/main.css), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/styles/reset.css), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/styles/fonts.css), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/index.html))
- Added local contributor guidance favoring `@type {const}` with inference for literal data structures, matching the new Learn data and chart setting style ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.4/website_next/AGENTS.md))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.3.3...v0.3.4)

## [v0.3.3](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.3.3) - 2026-06-06

### New Features

#### `workspace`

- Added `cycle-dca-sim.mjs`, a Bitview-backed BTC cycle DCA simulator that fetches daily price, all-time-high, halving epoch, and cost-basis percentile series; simulates p50-triggered DCA-in, p100 or percentile-triggered DCA-out, configurable cash reserves, buy weights, sell bands, ATH exits, custom start dates, and table or CSV output; and reports results against lump-sum and simple daily-DCA benchmarks so strategy research can be repeated from the command line ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.3/scripts/cycle-dca-sim.mjs))
- Added `cycle-dca-sweep.mjs`, a grid-search tool that tests buy-weight curves and sell multiples across monthly or explicit start dates, then ranks candidates by average, median, and worst performance against DCA and lump-sum baselines so cycle-rule parameters can be compared systematically ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.3/scripts/cycle-dca-sweep.mjs))

#### `website_next`

- Added a route registry for Home, Explore, Learn, and Build pages, then generated the primary header navigation from that registry so route validation, active nav state, and page construction use one path map ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.3/website_next/routes.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.3/website_next/header/index.js))
- Added page caching, hidden/inert inactive pages, same-origin left-click route interception, browser back/forward rendering, and transition/reveal overlay handling so the next website behaves as a client-side app without recreating pages on every navigation ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.3/website_next/main.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.3/website_next/utils/transition.js))
- Bundled the generated JavaScript BRK client inside `website_next` and added a `https://bitview.space` client wrapper, giving the next website direct access to typed BRK series endpoints without depending on the root website client bundle ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.3/website_next/modules/brk-client/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.3/website_next/utils/client.js))
- Rebuilt the Learn page as a structured article with generated section IDs, nested sections, a contents sidebar, smooth same-page hash navigation, popstate hash restoration, scroll-spy `aria-current` state, and URL hash replacement for the currently visible section, making the learning guide navigable by deep link and keyboard-friendly anchors ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.3/website_next/learn/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.3/website_next/learn/contents/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.3/website_next/learn/hash-links.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.3/website_next/learn/scroll-spy.js))
- Added data-backed Learn chart definitions for circulating supply, supply in profit and loss, STH versus LTH supply, supply by age, supply by UTXO balance, supply by address balance, supply by script type, supply by halving epoch, and supply by creation-year class, while keeping the broader Learn taxonomy for Capitalization, Activity, Mining, Market, Ownership, Liquidity, Risk, Cycles, and Cohorts in the same section model ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.3/website_next/learn/data.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.3/website_next/learn/cohorts.js))
- Added reusable SVG chart rendering for Learn charts with lazy first-intersection loading, per-chart request caching, responsive viewBox sizing, timeframe controls for intraday through all-history ranges, chart view controls for line, stacked, reversed stacked, bar, reversed bar, and dot views, local storage persistence for chart controls, and a fullscreen toggle for individual figures ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.3/website_next/learn/charts/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.3/website_next/learn/charts/timeframes.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.3/website_next/learn/charts/views.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.3/website_next/learn/charts/fullscreen.js))
- Added interactive Learn chart legends, series highlighting, formatted value readouts, pointer and keyboard scrubber controls, and line, stacked-area, bar, and dot plot renderers so readers can compare cohort values at a selected date and switch chart forms without losing context ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.3/website_next/learn/charts/legend.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.3/website_next/learn/charts/highlight.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.3/website_next/learn/charts/scrubber.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.3/website_next/learn/charts/line/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.3/website_next/learn/charts/stacked/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.3/website_next/learn/charts/bar/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.3/website_next/learn/charts/dots/index.js))

### Bug Fixes

#### `brk_client`

- Fixed the Rust client basic example to use `client.series().price.split.close.usd`, so the documented example follows the generated series tree instead of referencing a nonexistent `prices` branch ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.3/crates/brk_client/examples/basic.rs))

#### `website`

- Fixed chart PNG capture to place the screenshot at its real chart offset inside the pane, render the visible title with its computed font styling, wrap top and bottom legend rows to the available legend width, preserve multi-color swatches, honor selected option text and text transforms, and draw the page background plus host watermark so exported charts match the on-page composition ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.3/website/scripts/utils/chart/capture.js))
- Fixed stale chart legend prefixes by adding a `clearPrefix()` path and calling it when a pane has no units, so a chart that renders without a unit selector no longer inherits the previous chart's prefix or separator ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.3/website/scripts/utils/chart/legend.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.3/website/scripts/utils/chart/index.js))

### Internal Changes

#### `clients`

- Regenerated the generated JavaScript and Python client artifacts and TypeDoc files for the release snapshot, keeping shipped client packages and documentation synchronized with the generated API surface used by the website work ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.3/modules/brk-client/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.3/packages/brk_client/brk_client/__init__.py))

#### `website_next`

- Split Learn chart behavior into small modules for series config, SVG element creation, path construction, value formatting, storage, radio controls, lazy intersection loading, viewBox sizing, and color lookup, making the chart stack reusable across Learn sections without duplicating rendering code ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.3/website_next/learn/charts/config.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.3/website_next/learn/charts/path.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.3/website_next/learn/charts/radio.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.3/website_next/utils/colors.js))
- Tightened the local `website_next` contributor guidance around speed, memory use, composition, and maintainable file boundaries so future work on the next website has clearer implementation constraints ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.3/website_next/AGENTS.md))

#### `workspace`

- Allowed the root `btc-cycle-sim.html` artifact to be tracked despite the root HTML ignore rule, enabling the BTC cycle simulator page to live at the repository root when it is added ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.3/.gitignore))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.3.2...v0.3.3)

## [v0.3.2](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.3.2) - 2026-06-04

### Breaking Changes

#### `brk_oracle`

- Bumped the oracle algorithm to version 4 by keeping the strict 100-output transaction fan-out cap below height 630,000 and applying a 250-output cap from height 630,000 onward instead of fully lifting the cap. Stored oracle-derived price data must be recomputed, and historical values from the modern period can differ from v0.3.1 because very large fan-out transactions no longer enter the round-dollar histogram ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.2/crates/brk_oracle/src/filter.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.2/crates/brk_oracle/src/lib.rs))
- Replaced the public free-function payment filter API with `PaymentFilter`. Library callers must move from `payment_histogram(height, txs)` to `PaymentFilter::for_height(height).histogram(txs)`, from `for_each_round_dollar_bin(height, outputs, emit)` or `for_each_modern_round_dollar_bin(outputs, emit)` to `PaymentFilter::for_height(height).for_each_bin(outputs, emit)` or `PaymentFilter::MODERN.for_each_bin(outputs, emit)`, and from `eligible_bin(sats, output_type)` to `PaymentFilter::eligible_bin(sats, output_type)` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.2/crates/brk_oracle/src/filter.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.2/crates/brk_oracle/src/lib.rs))

### Internal Changes

#### `brk_oracle`

- Moved the baked pre-oracle price tape behind the `seed` module and added `Oracle::from_seed()`, so report and determinism tools start from the same height-339,999 seed path as production on-chain computation ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.2/crates/brk_oracle/src/seed.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.2/crates/brk_oracle/src/lib.rs))
- Contained the round-dollar stencil search behind `Stencil`, with the shape anchor and candidate scoring kept private to the stencil module. `Oracle` now stores a `Stencil` and asks it to pick the next reference bin, keeping the root oracle type focused on window state, config, and price conversion ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.2/crates/brk_oracle/src/stencil.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.2/crates/brk_oracle/src/lib.rs))
- Added the `experiment` example for replaying filter and EMA variants against historical OHLC data, and changed the report and determinism examples to use `Oracle::from_seed()` and the shared `PaymentFilter` entry points ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.2/crates/brk_oracle/examples/experiment.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.2/crates/brk_oracle/examples/report.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.2/crates/brk_oracle/examples/determinism.rs))
- Rewrote the oracle README's input-surface and version-history notes for version 4, including the post-630,000 250-output cap and the `PaymentFilter` API that all callers should use when constructing payment histograms ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.2/crates/brk_oracle/README.md))

#### `brk_computer`

- Routed stored oracle price computation through `PaymentFilter::for_height(height).histogram(txs)`, keeping historical price vec generation on the same transaction filter API exposed by `brk_oracle` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.2/crates/brk_computer/src/price/compute.rs))

#### `brk_mempool`

- Routed live eligible histogram maintenance through `PaymentFilter::MODERN.for_each_bin(...)`, so mempool callers automatically apply the modern 250-output fan-out cap without carrying a synthetic block height ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.2/crates/brk_mempool/src/stores/live_histograms.rs))

#### `website`

- Started work on the next version of the BRK website. This is still in progress and is documented here only as a development track ([source](https://github.com/bitcoinresearchkit/brk/tree/v0.3.2/website_next))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.3.1...v0.3.2)

## [v0.3.1](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.3.1) - 2026-06-01

### Breaking Changes

#### `brk_oracle`

- Replaced the version 2 oracle algorithm with version 3. BTC/USD price discovery now starts from on-chain data at height 340,000, runs a slow cold-start EMA until height 508,000, and then switches to the fast mature-market EMA. Existing oracle-derived price data must be recomputed, and historical values from height 340,000 onward can differ from v0.3.0 ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.1/crates/brk_oracle/src/config.rs))
- Removed the old `Config`-controlled per-output filter surface (`min_sats`, `exclude_common_round_values`, `excluded_output_types`, and `Oracle::output_to_bin`). Library callers now use `eligible_bin` for per-output checks or `for_each_round_dollar_bin` for full transaction filtering, which applies the shared dust, round-BTC, P2TR, OP_RETURN, and early batch-payout rules ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.1/crates/brk_oracle/src/filter.rs))
- Replaced the crate-local `Histogram` type with `HistogramRaw`, `HistogramEma`, and `HistogramEmaCompact` aliases backed by the shared `brk_types::Histogram<T, N>` type. External callers that constructed `brk_oracle::Histogram` must switch to the new aliases ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.1/crates/brk_oracle/src/scale.rs))

#### `brk_types`

- Removed the old `OracleBins` and `OracleBinsV2` public exports. Consumers that used those phase-histogram structs should use `Histogram<T, N>` directly or the `brk_oracle` histogram aliases for oracle wire and compute buffers ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.1/crates/brk_types/src/histogram.rs))

#### `brk_mempool`

- Renamed the live oracle histogram accessor to `live_eligible_histogram()` and added `live_raw_histogram()`. Callers using the old `live_histogram()` method must switch to the eligible histogram when feeding the oracle, or to the raw histogram when they need every live output binned without payment filtering ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.1/crates/brk_mempool/src/api/histogram.rs))

### New Features

#### `brk_oracle`

- Added a shared transaction-level payment filter that drops transactions with more than 100 outputs before height 630,000. This removes exchange-sweep and mixer-style batch payouts from the thin early-chain signal while leaving later dense-chain blocks uncapped ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.1/crates/brk_oracle/src/filter.rs))
- Added `Oracle::ema()` and `Oracle::reconfigure()`, letting query paths inspect the smoothed histogram and letting the compute path hand off from the slow cold-start regime to the fast regime without losing the recent raw histogram window ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.1/crates/brk_oracle/src/lib.rs))

#### `brk_types`

- Added a generic fixed-length `Histogram<T, N>` wire type with flat-array serialization, schema generation, bin incrementing for raw counts, compact quantization for EMA values, and binwise add/divide helpers for per-day averages ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.1/crates/brk_types/src/histogram.rs))
- Added `log500`, `log1000`, and `log2000` URPD aggregation modes, giving clients finer logarithmic realized-price buckets for heatmaps and detailed distribution views ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.1/crates/brk_types/src/urpd_aggregation.rs))

#### `brk_computer`

- Added segmented oracle price computation that uses the v3 slow regime for early on-chain history, switches to the fast regime at height 508,000, and reuses the shared `for_each_round_dollar_bin` filter so stored prices match query-side and mempool-side histogram reconstruction ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.1/crates/brk_computer/src/prices/compute.rs))

#### `brk_mempool`

- Added `LiveHistograms`, which maintains two per-bin mempool histograms incrementally as transactions enter and leave: an oracle-eligible histogram for live BTC/USD blending and a raw output-value histogram for the new raw histogram endpoint ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.1/crates/brk_mempool/src/stores/live_histograms.rs))

#### `brk_query`

- Added oracle query methods for live BTC/USD price, live payment histogram, confirmed payment histogram by height, confirmed payment histogram by day, live raw output histogram, confirmed raw output histogram by height, and confirmed raw output histogram by day. Confirmed reads are capped by safe lengths so callers do not observe in-flight indexer writes ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.1/crates/brk_query/src/impl/oracle.rs))
- Added cached live-oracle warm-up at the current tip, then blended the forming mempool block through `live_eligible_histogram()`. The `/api/mempool/price` value and `/api/oracle/price` now share the same v3 live-price path ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.1/crates/brk_query/src/impl/oracle.rs))

#### `brk_server`

- Added `/api/oracle/price`, `/api/oracle/histogram/payments/live`, `/api/oracle/histogram/payments/{point}`, `/api/oracle/histogram/outputs/live`, and `/api/oracle/histogram/outputs/{point}`. The `{point}` parameter accepts either a block height or a `YYYY-MM-DD` date, so clients can fetch one confirmed block or a daily aggregate through the same route shape ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.1/crates/brk_server/src/api/oracle.rs))
- Added OpenAPI documentation under an `Oracle` tag describing the pure on-chain price source, payment-vs-raw histogram semantics, and the relationship between `/api/oracle/price`, `/api/mempool/price`, and `/api/vecs/height-to-price` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.1/crates/brk_server/src/api/openapi/mod.rs))

#### `brk_bindgen`

- Added a generated JavaScript GET option `cache?: boolean`. Passing `cache: false` skips the in-memory/browser-cache path, sends the request with `no-store`, still honors `AbortSignal`, and still emits `onValue` once the fresh response is parsed ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.1/crates/brk_bindgen/src/generators/javascript/client.rs))

#### `brk_client`

- Added Rust client methods for the new oracle API: `get_oracle_price`, `get_oracle_histogram_payments_live`, `get_oracle_histogram_payments`, `get_oracle_histogram_outputs_live`, and `get_oracle_histogram_outputs` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.1/crates/brk_client/src/lib.rs))

#### `clients`

- Added the new oracle methods to the generated JavaScript and Python clients, including typed `HeightOrDateParam` support and the expanded URPD aggregation literals used by high-resolution distribution heatmaps ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.1/modules/brk-client/index.js), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.1/packages/brk_client/brk_client/__init__.py))

#### `website`

- Added a heatmap pane to the app shell with selectable heatmap options, a dedicated canvas renderer, date-range controls, y-axis min/max controls, hover/tap tooltips, and incremental dirty-column repainting for responsive interaction while data streams in ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.1/website/src/heatmap/index.js))
- Added `Heatmaps` to the option tree. Users can now open output-value heatmaps for all outputs or oracle-eligible payments, and URPD heatmaps for supply, realized capital, and unrealized PnL across all coins, STH, LTH, and age-band cohorts ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.1/website/scripts/options/partial.js))
- Added parallel per-day heatmap loading with abortable range changes and stale-while-revalidate client callbacks, so switching ranges or options cancels obsolete requests and paints available dates as soon as they arrive ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.1/website/src/heatmap/loader.js))

### Bug Fixes

#### `brk_computer`

- Fixed clean distribution resumes by calling rollback only when the resume height is below the current height. A normal restart at the existing checkpoint no longer fails because periodic flushes did not create rollback metadata ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.1/crates/brk_computer/src/distribution/vecs.rs))

#### `website`

- Fixed chart scale selector replacement by tracking the selector element per pane before inserting a new one. Rebuilding a pane no longer depends on a fragile `.field` lookup and does not leave stale radio controls behind after the shared form helpers changed shape ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.1/website/scripts/utils/chart/index.js))

### Internal Changes

#### `brk_oracle`

- Split the oracle implementation into explicit `filter`, `scale`, `shape`, `stencil`, and `window` modules. The split makes the v3 behavior testable at the payment filter, EMA window, shape-anchor, and stencil-search layers without duplicating logic across compute and query paths ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.1/crates/brk_oracle/src/lib.rs))
- Shortened the bundled bootstrap price table to the pre-height-340,000 seed range because v3 computes later prices from chain data. This reduces the amount of static exchange-derived data shipped with the crate and makes height 339,999 the final seed point before on-chain computation begins ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.1/crates/brk_oracle/src/lib.rs))
- Rewrote the oracle README for version 3, including the 340,000 start height, slow/fast EMA handoff, early batch-payout filter, revised UTXOracle comparison, and revised accuracy tables ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.1/crates/brk_oracle/README.md))
- Added `dump_hist` for offline raw output exports and `report_from` for replaying external CSV dumps through oracle experiments. Removed obsolete sweep and validation examples whose assumptions no longer match the v3 filter and EMA model ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.1/crates/brk_oracle/examples/dump_hist.rs), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.1/crates/brk_oracle/examples/report_from.rs))

#### `brk_computer`

- Added `feed_blocks_for_warmup` and `feed_blocks_with`, so query code can reconstruct EMA windows and average per-day payment histograms without copying the block-output extraction and filtering path ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.1/crates/brk_computer/src/prices/compute.rs))

#### `brk_server`

- Added `HeightOrDateParam` and `HeightOrDate`, giving oracle routes one parser for height-or-date path segments and matching cache strategies for per-height and per-date responses ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.1/crates/brk_server/src/params/height_or_date_param.rs))

#### `website`

- Extended option processing with `kind: "heatmap"` so heatmap entries can live in the same navigation tree as chart, explorer, URL, and group options ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.1/website/scripts/options/full.js))
- Changed shared DOM helpers so radio controls render as `fieldset`s and select controls return `{ element, get, set }`. Heatmap range controls use this to keep paired `from`/`to` and `min`/`max` selects in valid order while persisting choices per heatmap ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.1/website/scripts/utils/dom.js))
- Added the `#heatmap` container and stylesheet import to the app shell, changed the page title branding to `bitview`, preloaded the Lilex font file used by the site, and removed the unused Satoshi font face and asset ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.1/website/index.html), [source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.1/website/styles/fonts.css))

#### `workspace`

- Removed the scheduled outdated-dependency GitHub Actions workflow, so CI no longer runs a weekly dependency-drift job that can fail independently of code changes.
- Pinned the Rust toolchain to `1.96.0`, so source builds use the compiler release expected by this workspace ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.1/rust-toolchain.toml))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.3.0...v0.3.1)

## [v0.3.0](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.3.0) - 2026-05-18

### Highlights (v0.2.5 → v0.3.0)

The headlines of the v0.3.0 cycle, written for users rather than as a diff:

- **BRK is now a drop-in mempool.space backend.** Every `/api/...` and `/api/v1/...` route returns the same JSON as mempool.space, so existing tools and dashboards point at a self-hosted BRK without code changes. Address activity, block info, fee estimates, RBF and CPFP trees, raw tx submission, merkle proofs, recent mempool txs, and historical prices are all covered.
- **The projected next block is Bitcoin Core's own template.** Instead of BRK reimplementing block selection, the next-block view is now byte-for-byte what your node would mine via `getblocktemplate`. A new `/api/v1/mempool/block-template/diff/{hash}` endpoint lets clients pull incremental updates by hash, so a live mempool UI does not refetch the whole template every second.
- **UTXO realized-price distribution (URPD).** A new family of endpoints exposes the cost-basis distribution of the live UTXO set, with per-bucket supply, realized cap, and unrealized PnL, per cohort, per date, and at multiple aggregation levels (`raw`, `lin200/500/1000`, `log10/50/100/200`). The older `cost-basis` routes still work but are marked deprecated with a 2027-01-01 sunset.
- **A pure on-chain BTC/USD price oracle, with no external feed.** BRK derives price from output-value clustering, so prices are reproducible from the chain alone. The v2 algorithm extends coverage back to block 525,000 (was 550,000), narrows the excluded-output set to taproot only, and screens out OP_RETURN-carrying transactions for tighter signal.
- **A built-in block explorer ships with the website.** Open BRK in a browser and you get an isometric 3D-cube chain view, dedicated `/block/{...}`, `/tx/{...}`, and `/address/{...}` pages with deep links, infinite scroll in both directions, click-to-select, and a full block-details side pane. Replaces the previous single-page UI.
- **Interactive API docs bundled with the server.** A Scalar viewer ships under `/scalar` so anyone running BRK can browse and try the API without external tooling. The OpenAPI document is served in compact and full variants so the viewer loads instantly.
- **Two new CLI tools ship with the project.** `blk` reads Bitcoin Core's `blk*.dat` files directly and emits NDJSON, TSV, or pretty JSON with field selectors and height ranges, useful for scripting block inspection without an RPC round-trip. `mmpl` is a sidecar that prints live mempool events (tx enter / leave, new tip, new block, fee changes, per-address activity) as an NDJSON stream you can pipe into anything.
- **Reads near the tip are now race-free.** A pipeline-wide "safe lengths" snapshot replaced the previous stamp-then-write window where readers could occasionally see a height that was not yet readable. The same fix removed a stale cached tip hash that could lag across reorgs.
- **Reorg-safe iteration.** `BlockIterator` now yields `Result<Block>` instead of `Option<Block>`, so a reorg in the middle of a scan surfaces as an error instead of a silent end-of-stream. Any tool that walks block ranges can react properly instead of believing the chain ended.
- **Stale-while-revalidate baked into the JS client.** Every generated method now accepts `{ signal, onUpdate }`. You render once from cache, then again with fresh data when it arrives, and you can cancel in-flight requests via the `AbortSignal`. Text and CSV endpoints share the same pipeline that JSON had.
- **Server tunables for self-hosters.** A new `ServerConfig` block (matching `brk_cli` flags) exposes `cdn_cache_mode` (Live vs Aggressive for the CDN-control headers), separate `max_weight` budgets for localhost vs public callers, a `cache_size` knob, and a 5-second default request timeout. Useful if you put BRK behind a CDN or expose it publicly.
- **Cleaner install path.** Pre-built GitHub release binaries are gone. Installation is now `cargo install --locked brk_cli`, and updates are a re-run of the same command (indexed data is reused when the format is unchanged, otherwise resynced automatically).

**Things to know before upgrading:**

- The indexer storage format changed (VERSION 25 → 26). On first run, BRK will rebuild any vecs that moved or were added (new fields include per-block / per-tx blk-file positions, coinbase tags, segwit counts, and per-tx sigop cost).
- The oracle algorithm changed (VERSION 1 → 2). Historical prices below the new 525,000 start height will shift, and the bin tally now drops OP_RETURN transactions, so values across the full history will differ slightly from prior releases.
- Cost-basis API consumers should migrate to the new `/api/urpd/...` routes before 2027-01-01.

### Breaking Changes

#### `release`

- Removed the `cargo-dist`-driven `.github/workflows/release.yml` GitHub Actions pipeline (296 lines). Pre-built binaries for `aarch64-apple-darwin`, `aarch64-unknown-linux-gnu`, and `x86_64-unknown-linux-gnu` are no longer published per release. End users install via `cargo install --locked brk_cli` instead. The `[profile.dist]` and `[workspace.metadata.dist]` blocks in the root `Cargo.toml` and the `[package.metadata.dist]` block in `crates/brk_cli/Cargo.toml` are removed accordingly ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0/Cargo.toml))

### New Features

#### `brk_cli`

- New `Update` section in the README documents that updating is a re-run of `cargo install --locked brk_cli`: the binary is overwritten in place, and on-disk indexed data is reused when the storage format is unchanged or reset and resynced automatically when it is not ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0/crates/brk_cli/README.md))

### Internal Changes

#### `repo`

- Moved `docs/LICENSE.md` to the top-level `LICENSE` so GitHub picks it up as the repository's license file. The copyright holder line in the MIT text was also updated from `bitcoinresearchkit` to `Bitcoin Research Kit` to match the project's display name ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0/LICENSE))
- Deleted the obsolete root `CLAUDE.md` reminder file ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0/Cargo.toml))

#### `deps`

- `fjall` was bumped from the pinned `=3.0.4` to `3.1.4` and unpinned (now a normal caret range), `tower-http` from `0.6.10` to `0.6.11`, and `quickmatch` from `0.4.0` to `0.5.0`. The website search pane was updated to import `quickmatch-js` `0.5.0` alongside the Rust bump ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0/Cargo.toml))
- Workspace and per-crate versions stepped to `0.3.0`. The `brk_client::BrkClient::VERSION` constant was refreshed from `v0.3.0-beta.9` to `v0.3.0-beta.11` in the prep snapshot and then to the final value via the auto-generated client regeneration ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0/crates/brk_client/src/lib.rs))

#### `clients`

- Regenerated the auto-generated `modules/brk-client` (npm) and `packages/brk_client` (PyPI) bindings for the v0.3.0 schema ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0/modules/brk-client/index.js))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.3.0-beta.11...v0.3.0)

## [v0.3.0-beta.11](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.3.0-beta.11) - 2026-05-17

### Bug Fixes

#### `scripts`

- Fixed `scripts/rust-publish.sh` to reflect the v0.3.0-beta.10 crate reorganization. `brk_mempool` was moved to publish after `brk_oracle` (its new dependency ordering), and the new `blk` and `mmpl` binary crates were appended to the publish list so the next `cargo publish` pass uploads them to crates.io ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.11/scripts/rust-publish.sh))

### Internal Changes

#### `clients`

- Regenerated the auto-generated `modules/brk-client` (npm) and `packages/brk_client` (PyPI) bindings against the v0.3.0-beta.11 schema. Pure documentation regeneration with no API surface change beyond the version stamp ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.11/modules/brk-client/docs/classes/BrkClient.md))

#### `deps`

- Workspace and per-crate versions stepped to `0.3.0-beta.11` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.11/Cargo.toml))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.3.0-beta.10...v0.3.0-beta.11)

## [v0.3.0-beta.10](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.3.0-beta.10) - 2026-05-17

### Breaking Changes

#### `brk_rpc`

- Removed the wrapper structs `BlockInfo`, `BlockHeaderInfo`, `TxOutInfo` and `RawTx`. The crate now re-exports `corepc_types::v17::{GetBlockHeaderVerbose, GetBlockVerboseOne, GetTxOut}` directly, so downstream consumers must switch to the upstream shapes. The `RawTx { hex, blockhash }` aggregate is gone: callers fetch the hex and the containing-block hash through `get_raw_transaction(txid)` and `get_block_hash` separately ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/brk_rpc/src/lib.rs))
- `Client::fetch_mempool_state()` now returns `(MempoolState, Vec<BlockTemplateTx>)` from a single batched call that issues `getblocktemplate` + `getrawmempool false` + `getmempoolinfo`. `MempoolState` no longer carries verbose entries: it exposes `live_txids: FxHashSet<Txid>`, `min_fee: FeeRate`, `tip_hash: BlockHash`, `tip_height: Height`. Old consumers that read full `MempoolEntryInfo` per cycle must call the new `fetch_new_pool_data(txids)` batched fetch (`getmempoolentry` + `getrawtransaction` per txid) for the deltas they care about ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/brk_rpc/src/methods.rs))
- `BlockTemplateTx` now carries the full transaction body (`{ txid, fee, weight, depends, tx }`) instead of just an identifier, so the rebuild path can copy Core's projected block into the snapshot without a second RPC pass ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/brk_rpc/src/methods.rs))

#### `brk_oracle`

- `VERSION` bumped to `2`. The pure on-chain BTC/USD oracle algorithm changed in three ways: `START_HEIGHT` lowered from `550_000` to `525_000`, the excluded-output set narrowed from `{P2TR, P2WSH}` to `{P2TR}` only, and per-transaction OP_RETURN screening was added so any tx that contains an OP_RETURN output is dropped from the bin tally entirely. Prior databases must rebuild the price vec; clients reading historical oracle values will see the values shift below the new start height ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/brk_oracle/src/config.rs))
- The input surface was simplified to a single `process_histogram(&Histogram) -> Option<Price>` entry point. The new `Histogram([u32; NUM_BINS])` newtype owns the per-bin counters with `Histogram::zeros()` and `Histogram::increment(bin)`, and the new `default_eligible_bin(sats, output_type) -> Option<u16>` helper carries the eligibility decision (compile-time bitmask over `OutputType`). Configuration constants moved to `config.rs` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/brk_oracle/src/lib.rs))

#### `brk_types`

- `MempoolEntryInfo` was slimmed to match the fields BRK actually consumes: removed `ancestor_count`, `ancestor_size`, `ancestor_fee`, `descendant_size`, `descendant_fee`, `chunk_fee`, `chunk_weight`, and the `chunk_rate()` method. The remaining shape is `{ txid, vsize, weight, fee, first_seen, depends }`. The struct's doc comment now points at Bitcoin Core's `getmempoolentry` as the authoritative source. CPFP/chunk consumers must compute these values themselves via the snapshot's chunk-rate map instead of reading them off the entry ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/brk_types/src/mempool_entry_info.rs))
- Moved the SFL chunking primitives from `brk_mempool` into `brk_types::cpfp`: new `chunk_input.rs` holds the borrowed `ChunkInput<'a>`, new `linearize.rs` holds the Single Fee Linearization implementation, and a new `find_seed_chunk()` helper is exposed in `cluster_chunk.rs`. A new `CPFP_CHAIN_LIMIT: usize = 25` constant is exported. `brk_query::impl::cpfp` and the rebuild pipeline now import from `brk_types` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/brk_types/src/cpfp/linearize.rs))

#### `brk_mempool`

- Crate-level `chunking.rs` (162 lines) and `cpfp.rs` (305 lines) are deleted; both moved into `brk_types::cpfp`. External code that imported `brk_mempool::chunking::linearize` or `brk_mempool::cpfp::CpfpInfo` must switch to the `brk_types::cpfp` re-exports ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/brk_types/src/cpfp/mod.rs))
- `state.rs` was split into a `state/` module (`mod.rs` + `tx_entry.rs`). `TxEntry` now carries `size: u64` and an `rbf: bool` flag in addition to the previous fields, so signal-aware reasoning (BIP-125 trees, eviction policy) reads off the entry instead of re-parsing the body ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/brk_mempool/src/state/tx_entry.rs))
- `Mempool::start_with` now takes a batched prevout resolver `Fn(&[(Txid, Vout)]) -> FxHashMap<(Txid, Vout), TxOut> + Send` instead of a per-input lookup. Callers driving the cycle must adapt: the previous `Box<dyn Fn(&Txid, Vout) -> Option<TxOut>>` signature is gone. `brk_query::indexer_prevout_resolver()` was rewritten to return the batched form ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/brk_mempool/src/driver.rs))
- The `diagnostics` counter set drops the `skip_cleans` field. Consumers reading `MempoolStats` must remove the field reference ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/brk_mempool/src/diagnostics.rs))

### New Features

#### `mmpl` (new crate)

- New `mmpl` CLI binary that streams live mempool events as NDJSON on stdout. The `Event` enum covers `Enter` (tx admitted), `Leave` (tx evicted or mined), `AddrEnter` / `AddrLeave` (per-address presence changes), `Tip` (block tip moved), `Block` (new block connected), `Fees` (recommended fee tiers refreshed), and `Cycle` (full cycle diff summary). Depends on `brk_error`, `brk_mempool`, `brk_rpc`, `brk_types`. Useful as a thin observability sidecar against a running BRK node without polling the HTTP API ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/mmpl/src/event.rs))

#### `brk_types`

- New `BlockTemplate { hash: NextBlockHash, stats: BlockStats, transactions: Vec<Transaction> }` describing the projected next block exactly as Bitcoin Core would mine it ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/brk_types/src/block_template.rs))
- New `BlockTemplateDiff { hash, since, order, removed }` and `BlockTemplateDiffEntry` (untagged JSON enum of `Retained(u32)` index references and `New(Transaction)` bodies) for incremental client updates against a known template hash ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/brk_types/src/block_template_diff.rs))
- New `NextBlockHash(u64)` opaque hash type identifying a specific projected block; clients pass it back via `/diff/{hash}` and receive a `NotFound` when their `since` has aged out of the buffer ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/brk_types/src/next_block_hash.rs))
- New mutator `Transaction::refresh_sigops()` recomputes `total_sigop_cost` after in-place mutation of script witness data, used by the rebuild path when fixing up template-supplied transactions ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/brk_types/src/tx.rs))

#### `brk_mempool`

- New `api/` module surface: `addr.rs`, `block_template.rs`, `fees.rs`, `histogram.rs`, `rbf.rs`, `tx.rs`. New methods include `block_template() -> BlockTemplate`, `block_template_diff(since: NextBlockHash) -> Option<BlockTemplateDiff>`, `live_histogram() -> Histogram`, `live_effective_fee_rate(txid)`, `graveyard_fee_rate(txid)` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/brk_mempool/src/api/block_template.rs))
- New `cycle/` module: `AddedKind` (Fresh / Revived), `AddrTransitions` (with same-cycle enter/leave cancellation so a tx that enters and leaves within one cycle never emits to subscribers), `CycleDiff`, `Cycle` event aggregate, plus `TxAdded` and `TxRemoved` payloads. Drives the `mmpl` event stream ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/brk_mempool/src/cycle/mod.rs))
- New `snapshot/` module: `block_stats.rs` (`CORE_PERCENTILES` 0..=100 for `blocks[0]`, `PROJECTED_PERCENTILES` 5..=95 for `blocks[1..]`), `builder.rs` (per-cluster `refresh_chunk_rates`), `cluster.rs`, `cpfp.rs`, `fees.rs`, `partition.rs`, `rebuilder.rs`, `snap_tx.rs`, `tx_index.rs`. The snapshot now carries `{ txs, blocks, block_stats, fees, next_block_hash, prefix_to_idx }`, with `block0_txids()`, `hash_next_block()`, `chunk_rate_for(txid)` helpers ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/brk_mempool/src/snapshot/builder.rs))
- New `driver.rs` runs a 1-second `PERIOD` cycle loop. `start()` uses the default RPC resolver, `start_with(resolver)` accepts a custom batched resolver. Panics if started twice on the same `Mempool` to surface misuse early ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/brk_mempool/src/driver.rs))
- New `steps/prevouts.rs` backfills `prevout: None` entries from same-cycle in-mempool parents first, then from the caller-supplied resolver for confirmed ancestors ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/brk_mempool/src/steps/prevouts.rs))

#### `brk_rpc`

- New batched `Client::fetch_new_pool_data(txids)` issues `getmempoolentry` + `getrawtransaction` in one round-trip per delta set, replacing the per-tx loop that the apply step used to drive ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/brk_rpc/src/methods.rs))
- New `Client::get_blockchain_info()` and `Client::get_network()` are reintroduced as proper wrappers (after the v0.3.0-beta.9 removal). The wrappers are not behind a `cfg(debug)` gate, per the keep-public-API rule, so external integrations can call them directly ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/brk_rpc/src/lib.rs))

#### `brk_server`

- Added `/api/v1/mempool/block-template` returning the current projected block and `/api/v1/mempool/block-template/diff/{hash}` returning the incremental update since a known template hash. The mempool-hash response type was changed from `u64` to `NextBlockHash` for type safety on the wire ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/brk_server/src/api/mempool.rs))
- New `NextBlockHashParam { hash: NextBlockHash }` axum extractor parses the diff route's path parameter ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/brk_server/src/params/next_block_hash_param.rs))
- New `X-Method` response header derived from a `Method` extension placed on the response by the API layer, so reverse proxies and access logs see which BRK method served a given request without inspecting the URL ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/brk_server/src/lib.rs))

#### `brk_query`

- New `block_template()` and `block_template_diff(since: NextBlockHash) -> Result<BlockTemplateDiff>` query methods. `block_template_diff` returns `Error::NotFound` when the `since` hash has aged out of the in-memory buffer, signalling the client to fall back to a full template fetch ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/brk_query/src/impl/mempool.rs))

#### `brk_logger`

- New `install_panic_hook()` registers a `std::panic::set_hook` that captures the panic message, source location and a `std::backtrace::Backtrace` and routes them through `tracing::error!`, so panics in worker threads land in the same log sink as normal errors instead of being lost on stderr ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/brk_logger/src/lib.rs))

#### `blk`

- New `coinbase_hex` field on the per-block JSON: emits the raw coinbase scriptSig hex, useful for miner-tag extraction without re-deriving from `tx.0.vin.0.script_sig` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/blk/src/main.rs))
- New `BLOCK_FIELDS`, `TX_FIELDS`, `VIN_FIELDS`, `VOUT_FIELDS` constant arrays drive selector validation and bash completion. Args validation now rejects duplicate `--field` flags and unknown long flags, and `Mode::pick` enforces that `--pretty` and `--compact` are mutually exclusive ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/blk/src/args.rs))
- Selectors pre-resolve the chain tip exactly once per invocation, so `tip` and ranges that resolve relative to tip do not issue an RPC call per output row ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/blk/src/main.rs))
- A bare `tx`, `vin`, or `vout` selector now returns the matching sub-object as JSON instead of bailing on the missing leaf; `bits` is formatted as a hex string to match `bitcoin-cli`. `Ctx::new(block, network)` now takes the network alongside the block so address rendering picks the right human-readable prefix ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/blk/src/main.rs))

### Bug Fixes

#### `brk_server`

- The health endpoint no longer round-trips to `bitcoind` to compute its response. It now reports liveness from the local indexer state directly, so a slow or unresponsive Bitcoin Core node does not flap the BRK liveness probe. A separate `/api/server/sync` endpoint exposes the real chain-tip lag for callers that actually need that signal ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/brk_server/src/api/server.rs))
- The axum middleware stack was reordered so `CatchPanic` is layered above `response_time_layer`. A panic in a handler is now converted into a 500 response that still records its timing, instead of bypassing the response-time layer and producing a zero-duration error log line ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/brk_server/src/lib.rs))

#### `brk_indexer`

- Removed the `tip_blockhash: Arc<RwLock<BlockHash>>` field on `Indexer`. The field could lag behind the on-disk `blockhash` vec across reorgs, so a reader observing a fresh `safe_lengths` against a stale cached tip could see a hash from the abandoned branch. `Indexer::tip_blockhash()` now reads `blockhash.collect_one(safe_lengths().height - 1)` directly, eliminating the cache and the `parking_lot::RwLock` import ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/brk_indexer/src/lib.rs))

#### `brk_query`

- `height_by_hash` now clamps its scan to the current `safe_lengths()` snapshot. A reader that races a reorg-and-rewrite no longer hits the stamp-before-write window where the in-flight vec has a stamp but the data for the highest position is not yet readable ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/brk_query/src/impl/block/info.rs))

### Internal Changes

#### `brk_computer`

- `prices/compute.rs` switched to per-transaction grouping: a `tx_starts` array records each tx's output range, and any transaction that contains at least one OP_RETURN output is dropped from the bin tally before counters are summed. Histogram allocation now goes through `brk_oracle::Histogram::zeros()`. `feed_blocks` was unified into a single public function that takes an optional `cap: Option<&Lengths>` for bounded replays, replacing the previous capped/uncapped pair ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/brk_computer/src/prices/compute.rs))
- `distribution/vecs.rs` `VERSION` is now sourced from `brk_oracle::VERSION` so the oracle algorithm bump cascades to the distribution snapshot without a manual version edit ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/brk_computer/src/distribution/vecs.rs))

#### `brk_iterator` / `brk_reader`

- Both crates adapted to the new `get_block_header_info()` return shape, using `(height + 1) as u64` for the next-block hint instead of reading a now-removed field on the wrapper. The change is internal and does not affect public iteration / canonical-read APIs ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/brk_iterator/src/lib.rs))

#### `brk_mempool`

- New `test_support.rs` extracts the test-only helpers (builder fixtures, cluster factories) that used to live inline in test modules, so the unit tests across the new `snapshot/` and `cycle/` submodules share a single fixture surface ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/brk_mempool/src/test_support.rs))
- The lib-doc was rewritten to describe the new 5-step pipeline (Fetcher then Preparer then Applier then Prevouts then Rebuilder) and to drop references to the deleted block-builder ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/crates/brk_mempool/src/lib.rs))

#### `clients`

- Regenerated the auto-generated `modules/brk-client` (npm) and `packages/brk_client` (PyPI) bindings to pick up the new `BlockTemplate`, `BlockTemplateDiff`, `BlockTemplateDiffEntry`, `NextBlockHash` types, the slimmed `MempoolEntryInfo`, and the two new `/api/v1/mempool/block-template*` routes ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/modules/brk-client/index.js))

#### `website`

- Snapshots across `src/explorer/chain`, `src/explorer/mempool`, `src/options/full`, `src/utils/price`, `src/utils/theme`, and `src/explorer/chain/cube` to render the projected block template and consume the new diff endpoint ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/website/src/explorer/mempool))

#### `deps`

- Workspace and per-crate versions stepped to `0.3.0-beta.10` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.10/Cargo.toml))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.3.0-beta.9...v0.3.0-beta.10)

## [v0.3.0-beta.9](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.3.0-beta.9) - 2026-05-08

### Breaking Changes

#### `brk_rpc`

- Removed the public `BlockchainInfo` struct and `Client::get_blockchain_info()` method. The single internal caller (`wait_for_synced_node`) now declares a local `SyncProgress { headers, blocks }` and invokes `getblockchaininfo` directly. Downstream consumers that called `client.get_blockchain_info()` must inline the corresponding `corepc-jsonrpc` call ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.9/crates/brk_rpc/src/lib.rs))
- The corepc-types import surface narrowed from a flat `v30::*` to version-pinned `v17::{GetBlockCount, GetBlockHash, GetBlockHeader, GetBlockHeaderVerbose, GetBlockVerboseOne, GetBlockVerboseZero, GetRawMempool, GetTxOut}` plus `v24::GetMempoolInfo`. Each wrapper now imports the response shape that matches what Bitcoin Core returns at the version that first stabilized the field set, instead of relying on the v30 re-exports ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.9/crates/brk_rpc/src/methods.rs))

#### `brk_types`

- Removed the `mined: Option<bool>` field from `RbfTx`. The flag was misleading: an RBF tree's tx is by definition not yet mined (mined replacements collapse the tree), so the field was either redundant or actively wrong on stale captures. Clients that read `tx.mined` from the RBF response must drop the lookup ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.9/crates/brk_types/src/rbf.rs))

### Bug Fixes

#### `brk_mempool`

- Fixed an SFL chunk-extraction bug where uniform-rate chains and same-rate sibling subtrees produced singleton chunks "above" the main chunk under integer-vsize rounding, silently breaking the descending-rate invariant the partitioner relies on. The initial chunk selection now prefers the larger ancestor-closed set on rate ties, and a new extension loop greedily extends the picked chunk with any other ancestor-closed subset whose union keeps the chunk rate `>=` the current rate. Helper functions `closure(items, remaining, excluded, start)` and `sum_fee_vsize(items, set)` are factored out so the extension loop reuses the same closure walk as the initial pick ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.9/crates/brk_mempool/src/chunking.rs))
- `Mempool::graveyard_fee_rate(txid)` previously returned `entry.fee_rate()`, the tx's isolated `fee/vsize`. For an RBF predecessor evicted to the graveyard this misrepresented the bid that displaced it, since the live tx had been propagated with its package-effective rate. Burials now snapshot `entry.chunk_rate` (Core's chunk rate at apply time), and `graveyard_fee_rate` returns the same value the tx reported via `live_effective_fee_rate` while alive. The doc comment is updated to call out the package-effective semantics ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.9/crates/brk_mempool/src/lib.rs))

#### `brk_query`

- `tx_rbf` was threading a `mined` field through every node of the RBF tree, but the field was always synthesized from a stale lookup that could disagree with the canonical `TxStatus` for the same txid. The field is now dropped from both `RbfTx` and the per-node construction in `impl/mempool.rs`, so clients that need confirmation status query `/api/v1/tx/:txid/status` instead and avoid the inconsistency window ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.9/crates/brk_query/src/impl/mempool.rs))

### Internal Changes

#### `clients`

- Bumped the auto-generated `modules/brk-client` (npm) and `packages/brk_client` (PyPI) bindings to reflect the dropped `RbfTx.mined` field and the removed `BlockchainInfo` type ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.9/modules/brk-client/index.js))

#### `deps`

- Workspace and per-crate versions stepped to `0.3.0-beta.9` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.9/Cargo.toml))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.3.0-beta.8...v0.3.0-beta.9)

## [v0.3.0-beta.8](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.3.0-beta.8) - 2026-05-08

### Breaking Changes

#### `brk_mempool`

- Replaced the entire intra-mempool block-building pipeline with Bitcoin Core's `getblocktemplate`. All of `steps/rebuilder/block_builder/{graph,graph_bench,linearize/**,package,partitioner,pool_index,tx_node,mod}.rs` and `steps/rebuilder/projected_blocks/{fees,snapshot,stats,verify,mod}.rs` are deleted (~2,000 lines). The new `Rebuilder` lives in `steps/rebuilder/` and is a dirty-bit-driven snapshot publisher: it copies Core's next-block template verbatim into `blocks[0]` and uses a simple `Partitioner` to fill `blocks[1..8]` from the remaining mempool ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_mempool/src/steps/rebuilder/mod.rs))
- `Mempool::start_with` / `Mempool::update_with` now take a `PrevoutResolver = Box<dyn Fn(&Txid, Vout) -> Option<TxOut> + Send + Sync>` and drive the new dedicated `steps::Prevouts::fill` step that backfills `prevout: None` from same-cycle in-mempool parents (direct memory lookup) and from confirmed parents via the supplied resolver. The previous `fill_prevouts<F>(resolver)` accessor is removed; backfill is now part of the cycle ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_mempool/src/steps/prevouts.rs))
- Removed `MempoolState` / `stores::state` and replaced it with a top-level `state::State` re-exported as `pub(crate) use state::State`. `Mempool(Arc<Shared>)` now holds a single `state: RwLock<State>` instead of one lock per sub-store, and one batched RPC (`getrawmempool verbose` + `getblocktemplate` + `getmempoolinfo`) drives the cycle instead of five separately-locked stores. The five-lock acquire order in the old `MempoolState::apply` is gone ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_mempool/src/state.rs))
- Flattened the rest of the stores layout: `stores/{entry,entry_pool,tombstone}.rs` are deleted, `stores/addr_tracker.rs` is split into `stores/addr_tracker/{mod,addr_entry}.rs`, `stores/tx_graveyard.rs` is split into `stores/tx_graveyard/{mod,tombstone}.rs`, and `stores/outpoint_spends.rs` is added. The new public types `TxStore`, `TxGraveyard`, `TxTombstone`, `TxEntry`, `TxRemoval`, `BlockStats`, `RecommendedFees`, `Snapshot` are re-exported from the crate root ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_mempool/src/lib.rs))

#### `brk_indexer`

- Split the flat `indexes.rs` into three files: `lengths.rs` (the `Lengths` struct with per-vec counters), `indexes.rs` (the typed `Indexes` view), and the new `safe_lengths.rs` (`SafeLengths`, a pipeline-wide `Arc<RwLock<Lengths>>` snapshot). Callers that imported `Lengths` from `indexes` must update to `brk_indexer::lengths::Lengths` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_indexer/src/lib.rs))
- Split the flat `processor.rs` into `processor/{mod,metadata,sigops,tx,txin,txout}.rs`. The block processor is now `BlockProcessor` with explicit `process_inputs`, `process_outputs`, `compute_sigops` methods instead of a monolithic free function. External callers that imported `processor::*` may need to drop submodule prefixes ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_indexer/src/processor/mod.rs))

#### `brk_types`

- Split the flat `cpfp.rs` into a submodule: `cpfp/{mod,cluster,cluster_chunk,cluster_tx,cluster_tx_index,entry,info}.rs`. Public types `Cluster`, `ClusterChunk`, `ClusterTx`, `ClusterTxIndex`, `CpfpEntry`, `CpfpInfo` keep their names but now live in `brk_types::cpfp::*` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_types/src/cpfp/mod.rs))
- Deleted `pagination_index.rs` and `series_count.rs`. Pagination is now expressed through the typed index in `index.rs` (new `Index` newtype), and series count is folded into the response wrapper ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_types/src/lib.rs))

#### `brk_server`

- Deleted `extended/encoding.rs`. JSON / text / bytes encoding is now selected per-route via the new `typed_text.rs` `TypedText` extended response type and per-route helpers on `AppState` (`cached_json`, `cached_text`, `cached_bytes`). Custom handlers that called `encoding::*` must switch to the typed helpers ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_server/src/extended/typed_text.rs))

#### `brk_computer`

- Workspace-wide signature simplification: every compute method dropped its `starting_indexes: &Indexes` (and `starting_indexes: Indexes` on `Computer::compute`) parameter across ~115 files. The top-level `Computer::compute(&mut self, indexer: &Indexer, exit: &Exit) -> Result<()>` no longer threads a starting-indexes value through `blocks`, `inputs`, `outputs`, `transactions`, `mining`, `market`, `pools`, `investing`, `distribution`, `prices`, `supply`, `cointime`, `indicators`, and every sub-import call site. Consumers driving the compute pipeline must drop the argument; the equivalent snapshot is now reached through `Indexer::safe_lengths()` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_computer/src/lib.rs))

#### `brk_indexer`

- `Indexer::index(...)` now returns `Result<()>` instead of `Result<Indexes>`; the local pipeline variable is renamed `starting_indexes` → `starting_lengths` and the value is no longer surfaced (consumers that want the post-index snapshot call `Indexer::safe_lengths()`). On the storage layer, `Vecs::rollback_if_needed(starting_indexes: &Indexes)` is renamed to `rollback_if_needed(starting_lengths: &Lengths)`, and the per-vec `truncate` cascade follows suit. Downstream callers driving rollback or reading the indexed-result value must update both names and the return type ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_indexer/src/lib.rs))
- New `total_sigop_cost: PcoVec<TxIndex, SigOps>` column persisted in `vecs/transactions.rs` and `TxsAppender`. Consumers that destructured `TxsAppender` field-by-field must add the new field, and any external code that snapshots the transactions vec set picks up the additional column on disk ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_indexer/src/vecs/transactions.rs))

#### `brk_error`

- `Error::OutOfRange(String)` is now `Error::OutOfRange(Cow<'static, str>)` so static error messages avoid an allocation; callers that constructed it with `OutOfRange(format!(...))` keep working (the `Cow::Owned` arm), but callers that pattern-matched on `OutOfRange(String)` must update to `OutOfRange(Cow<'static, str>)` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_error/src/lib.rs))

#### `brk_logger`

- `tracing_subscriber::init(path: Option<&Path>)` renamed parameter to `init(dir: Option<&Path>)` to match the semantics (the argument is the log directory, not a single file path). Callers passing positional arguments are unaffected; named-argument callers must update ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_logger/src/lib.rs))

### New Features

#### `blk` (new crate)

- New `blk` CLI binary for inspecting Bitcoin Core blocks. Reads `blk*.dat` files directly via `brk_reader` and resolves the chain tip / heights via the Bitcoin Core RPC. Output is shell-friendly (bare values, NDJSON, pretty JSON, or TSV). Supports field selectors like `tx.0.vout.0.value`, height ranges (`0..2`), `tip` alias, and named outputs (`hash`, `height`, `time`, etc.) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/blk/src/main.rs))

#### `brk_mempool`

- Projected next block is now Bitcoin Core's own `getblocktemplate` rather than BRK's reimplementation. The same fetch cycle that pulls `getrawmempool verbose` now also pulls GBT, so the snapshot's `blocks[0]` is byte-for-byte what Core would mine if it produced a block at that instant. Blocks `[1..8]` are partitioned from the remaining mempool by descending package feerate via the new lightweight `Partitioner::partition`. The previous SFL + cluster linearization + parent-before-child verifier is no longer needed and was deleted ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_mempool/src/steps/rebuilder/mod.rs))
- New `Mempool::stats()` returns a `MempoolStats` summary (rebuild count, skip-clean count, etc.) for diagnostics. The `diagnostics` module exposes counters that previously lived in scattered fields on the rebuilder ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_mempool/src/diagnostics.rs))
- New top-level `rbf` module producing `RbfForTx { tx, replacements }` and recursive `RbfNode { tx, replaces }` shapes for the BIP-125 replacement tree. Backs the `/api/v1/tx/:txid/rbf` and `/api/v1/replacements` server endpoints. Standalone `cpfp` module exposes `CpfpInfo` ancestor walks deduplicated via `FxHashSet` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_mempool/src/rbf.rs))
- New public `chunking::linearize(ChunkInput) -> Vec<ChunkOrder>` exposes the per-cluster chunk ordering primitive previously buried inside the block-builder, so external crates can run the same package-grouping logic without depending on the rebuilder ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_mempool/src/chunking.rs))

#### `brk_indexer`

- New `SafeLengths(Arc<RwLock<Lengths>>)` pipeline-wide snapshot of safe-read counts: `bound.f = N` means positions `0..N` are fully written and readers reject `pos >= bound.f`. Eliminates the stamp-before-write race where a `Ro` reader could observe `stamp == N` but `collect_one(N)` returns `None` (see project memory). `Indexer::safe_lengths()` exposes the snapshot; readers consult it before issuing range reads ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_indexer/src/safe_lengths.rs))
- New `BlockProcessor::compute_sigops` returns per-tx BIP-141 sigop cost (legacy + P2SH-redeem + witness, weighted). Dispatches on the already-resolved `OutputType` so canonical-shape scripts (~99% of outputs and ~95% of inputs on mainnet) skip the script walk entirely. Sigops are persisted into a new per-tx column read by mining/sigops endpoints ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_indexer/src/processor/sigops.rs))

#### `brk_types`

- New `SigOps(u32)` newtype representing BIP-141 sigop cost. Const `VBYTES_PER_SIGOP = 5` matches Core's `nSigOpCost` adjustment factor (`adjusted_vsize = max(vsize, sigops * 5)`). Carries `Pco`, `Formattable`, `JsonSchema`, and serde `transparent` impls so it can be written into vecdb columns and exposed through the OpenAPI surface without bespoke serialization ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_types/src/sigops.rs))
- New `Index` newtype in `index.rs` consolidating pagination and series indexing, and new `OutpointPrefix` (`outpoint_prefix.rs`) and `BlockTxIndex` (`block_tx_index.rs`) types used by the new mempool-compat and block-tx endpoints ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_types/src/outpoint_prefix.rs))

#### `brk_query`

- New `cpfp.rs` query impl provides `cpfp_info_for_tx(&Txid)` returning ancestor+descendant package fee/vsize from a single FxHashSet-deduplicated walk over the mempool entry graph. Replaces the per-call ancestor recursion that previously lived inside the mempool endpoint handler ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_query/src/impl/cpfp.rs))
- New `mining/period_start.rs` resolves the height of the difficulty / halving period boundary used by mining endpoints, replacing inline boundary math scattered across `block_window`, `difficulty_adjustments`, `epochs`, and `hashrate` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_query/src/impl/mining/period_start.rs))

#### `brk_server`

- New `extended/typed_text.rs` adds `TypedText`, a content-typed text response wrapper that lets a single handler return `text/plain`, `application/hex`, or any RFC 6838 subtype with one ETag pipeline. Used by `block_raw`, `tx_hex`, and the merkle-proof endpoints ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_server/src/extended/typed_text.rs))
- New `params/addr_after_txid_param.rs` provides typed `?after_txid=...` cursor support for address tx-history endpoints, replacing the ad-hoc `Option<Txid>` field on `AddrTxidsParam` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_server/src/params/addr_after_txid_param.rs))
- Split the OpenAPI document into `api/openapi/{compact,full,mod}.rs`. `compact` emits a slimmed schema (path-only operations) for fast loading in browser-side Scalar viewers, while `full` keeps every schema and response variant for code generation ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_server/src/api/openapi/mod.rs))
- New crate-level constants `MAX_ERROR_BODY_BYTES = 4096` (caps the buffered upstream-error body that the JSON-error middleware re-wraps) and `REQUEST_TIMEOUT = Duration::from_secs(5)` (per-request timeout layer, returns `504 Gateway Timeout` on hit). The previous inline `4096` and `Duration::from_secs(5)` are now named, audited constants ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_server/src/lib.rs))
- New `is_json_content_type(s: &str) -> bool` helper recognizes both `application/json` and any `application/...+json` subtype, ignoring parameters like `; charset=utf-8`. The JSON-error rewriter consults it to skip re-wrapping already-JSON upstream bodies ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_server/src/lib.rs))
- JSON-error rewriter now propagates an upstream `Allow` header through to the rewrapped error response, so 405 Method Not Allowed responses keep their `Allow:` list intact after being normalized to BRK's `application/problem+json` shape ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_server/src/lib.rs))

#### `brk_error`

- New `Error::TooManyUtxos` variant rendered as `"Too many unspent transaction outputs (>1000)."`. Wired into the address-UTXO endpoints so requests that would exceed `DEFAULT_MAX_UTXOS` return a structured `400` instead of being silently truncated or rejected as a generic weight overflow ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_error/src/lib.rs))

#### `clients`

- The auto-generated `brk-client` (npm) and `brk_client` (PyPI) bindings gained a `.len()` method on every list-shaped response. Removes the need for callers to read `.data.length` / `len(data)` through nested wrappers and aligns with the new `Index` pagination type ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/modules/brk-client/index.js))
- Added a comprehensive `mempool_compat` Python pytest suite under `packages/brk_client/tests/mempool_compat/` and `scripts/mempool_compat/` covering all major mempool.space-aligned endpoint families: addresses (info, txs, txs/chain, txs/mempool, utxo, validate), blocks (block, header, height, raw, status, txid-by-index, txids, txs, v1 variants, blocks-at-height, tip hash/height), fees (mempool-blocks, precise, recommended), general (difficulty adjustment, historical price, prices), mempool (`/mempool`, recent, replacements, fullRBF replacements, txids), mining (blocks fee rates / fees / rewards / sizes / timestamps, difficulty adjustments, hashrate, hashrate-pools, pool detail, pool blocks, pool hashrate, pools, pools period, reward stats), and transactions (cpfp, post-tx, times, tx, hex, merkle proof, merkleblock proof, outspend, outspends, raw, rbf, status). Each test drives the live BRK server against the live mempool.space JSON, asserting shape and value parity ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/packages/brk_client/tests/mempool_compat/conftest.py))

### Bug Fixes

#### `brk_bindgen`

- JavaScript client generator was emitting the field name `txid` for repeated-key query parameters declared as `txId[]`. Generated callers that built URLs from the type signature produced the wrong key and got `400 unknown query parameter`. The generator now preserves the bracketed form so the emitted code sends `txId[]=...` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_bindgen/src/generators/javascript/api.rs))

#### `brk_indexer`

- The previous indexing pipeline updated each vec's header stamp before the pushed data finished flushing to disk. A `Ro` reader could observe `stamp == N` while `collect_one(N)` returned `None`, manifesting as intermittent 404s right at the tip. `SafeLengths::advance` is now called only after every vec in the pipeline has completed its flush for a given height, so readers gate range reads on `pos < safe_lengths.f` and never see an in-flight write ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_indexer/src/safe_lengths.rs))

#### `brk_mempool`

- The old projected-next-block reimplementation occasionally disagreed with Bitcoin Core's `getblocktemplate` on tx ordering inside CPFP-heavy clusters (parent rates near the dust line, anchor outputs), so the BRK projection could include or exclude a tx the real next block would not. Switching `blocks[0]` to GBT verbatim eliminates the divergence by definition ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_mempool/src/steps/rebuilder/mod.rs))
- Fixed a panic in the prevout backfill when a same-cycle parent appeared after its child in the iteration order. `Prevouts::fill` now does a two-pass walk: first index every added tx into the entry pool, then resolve each `prevout: None` against either the pool or the resolver. Prevents the "child seen before parent" None-deref that crashed the rebuild thread under burst load ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_mempool/src/steps/prevouts.rs))

### Internal Changes

#### `brk_query`

- Moved `urpd.rs` to its own impl module, and added a new `async.rs` providing async wrappers over the synchronous core. The cleanup folds the previously-inline UTXO Realized Price Distribution glue into a stand-alone surface and lets server handlers `.await` query calls without spawning blocking-pool wrappers per endpoint ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_query/src/impl/urpd.rs))
- Series query rewritten: `impl/series.rs` expanded by ~300 lines to thread the new `Index` newtype, range/format limits, and weight-aware truncation through every series fetch. Per-mining-endpoint files (`block_fee_rates`, `block_fees`, `block_rewards`, `block_sizes`, `block_window`, `difficulty_adjustments`, `epochs`, `hashrate`, `pools`, `reward_stats`) were rewritten on top of the new `period_start` helper ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_query/src/impl/series.rs))

#### `brk_logger`

- The `rate_limit` module is rewritten (215 lines) to use a per-target sliding window with bounded memory. Previously a long-running ingest would unboundedly accumulate per-log-key counters; the new structure caps the active key set and drops the oldest on overflow ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_logger/src/rate_limit.rs))

#### `brk_iterator`

- Added `examples/sigops_bench.rs` benchmarking the new sigops dispatch path against a full script walk. Used to validate the ~95-99% short-circuit rate before persisting the column ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_iterator/examples/sigops_bench.rs))

#### `brk_rpc`

- `methods.rs` reorganized so each RPC wrapper (`getblock` variants, `getrawtransaction`, `getmempoolinfo`, `getrawmempool`, `getblocktemplate`, `getblockchaininfo`) lives next to its batched counterpart. `RawTx { tx, hex }` formatting was tidied for the new mempool-compat endpoints that need the raw hex alongside the parsed `bitcoin::Transaction` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_rpc/src/methods.rs))

#### `brk_server`

- Crate root re-exports were reshaped from `{DEFAULT_CACHE_SIZE, DEFAULT_MAX_WEIGHT, DEFAULT_MAX_WEIGHT_LOCALHOST, ServerConfig}` to `{DEFAULT_MAX_UTXOS, DEFAULT_MAX_WEIGHT, ServerConfig}`. The per-route response cap is now expressed as a UTXO count (`max_utxos`) instead of a localhost-vs-public byte-weight pair plus a separate `quick_cache` size. `AppState` lost its `cache: Arc<Cache>` field and its `last_tip` atomic, since the per-URI quick-cache is no longer the cache layer (CDN ETag pipeline handles it) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/crates/brk_server/src/lib.rs))

#### `website`

- New `scripts/explorer/address.js` and `scripts/explorer/block.js` page modules: dedicated address-detail and block-detail explorer views replacing the previous monolithic `explorer/index.js` flow. Deleted `scripts/utils/cache.js` (38 lines) since cache-busting is now handled server-side via the `Empty` extractor and `deny_unknown_fields` from beta.7 ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/website/scripts/explorer/address.js))

#### `deps`

- Bumped workspace dependencies and refreshed `Cargo.lock`. Each crate's local version stepped to `0.3.0-beta.8` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.8/Cargo.toml))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.3.0-beta.7...v0.3.0-beta.8)

## [v0.3.0-beta.7](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.3.0-beta.7) - 2026-04-27

### Breaking Changes

#### `brk_types`

- Deleted `crates/brk_types/src/data_range.rs` and removed `DataRange` from the public surface. `DataRangeFormat`, `SeriesSelection`, and `SeriesSelectionLegacy` no longer carry a nested `range: DataRangeFormat` (or `range: DataRange`) field via `#[serde(flatten)]`. Instead, a new `with_range_format!` macro inlines `start`, `end`, `limit`, and `format` directly into each struct (with the same `s`/`from`/`f`, `e`/`to`/`t`, `l`/`count`/`c` aliases) and emits matching accessors. Downstream callers that read `selection.range.start()` must switch to `selection.start()` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.7/crates/brk_types/src/with_range_format.rs))
- `TxidsParam::from_query(query: &str)` now returns `Result<Self, String>` instead of `Self`. Malformed `txId[]` pairs and unknown keys produce a structured error instead of being silently dropped, so callers must propagate the new error type ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.7/crates/brk_server/src/params/txids_param.rs))

#### `brk_server`

- Every path-only endpoint now takes a new `Empty` extractor (added on `/api/block/...`, `/api/blocks/...`, `/api/v1/block{,s}/...`, `/api/v1/mining/...`, `/api/v1/tx/...`, `/api/v1/address/...`, `/api/fees/...`, `/api/mempool/...`, etc.) that rejects requests carrying any query string. Hand-rolled async handlers must add the `_: Empty` parameter or the route will fail to compile ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.7/crates/brk_server/src/params/empty.rs))

### New Features

#### `brk_server`

- Added the `Empty` query-string-rejecting extractor in `brk_server::params::empty`. When a client sends a path-only endpoint with `?foo=bar`, the handler short-circuits with `400 Bad Request` and a message naming the offending query. This is wired into every cacheable endpoint that does not legitimately accept query params, so injected keys can no longer bypass the URI-keyed cache ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.7/crates/brk_server/src/params/empty.rs))
- `TxidsParam::from_query` now reports a structured error string instead of silently dropping malformed pairs, so the new bulk-tx handler can return a precise `400` (e.g., `"invalid txid `xyz`: ..."` or `"unknown query parameter `foo`, expected `txId[]`"`) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.7/crates/brk_server/src/params/txids_param.rs))

#### `brk_types`

- Added the `with_range_format!` declarative macro (`crates/brk_types/src/with_range_format.rs`) that expands a struct definition by appending the shared `start` / `end` / `limit` / `format` fields plus their aliases and emits matching accessors and setters. Used to keep `DataRangeFormat`, `SeriesSelection`, and `SeriesSelectionLegacy` byte-for-byte consistent without `#[serde(flatten)]`, which is required so `#[serde(deny_unknown_fields)]` actually fires ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.7/crates/brk_types/src/with_range_format.rs))
- Refreshed the upstream `pools-v2.json` data (694 insertions / 215 deletions): added the `Noderunners` pool in slot 170 (replacing the previous `Dummy170` skip slot) and bumped `POOL_COUNT` from 170 to 171. Block-by-pool attribution now recognizes Noderunners-signed coinbases ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.7/crates/brk_types/src/pool_slug.rs))

### Bug Fixes

#### `brk_types`

- `#[serde(deny_unknown_fields)]` on `SeriesSelection`, `SeriesSelectionLegacy`, and `DataRangeFormat` was silently inert because each carried a `#[serde(flatten)] range: DataRangeFormat` field, and `serde` skips unknown-field rejection through any flatten chain. Clients could append arbitrary unknown query params (`?xyz=1`) and bypass the URI-keyed CDN/cache, since the validator never failed. Eliminated the flatten via `with_range_format!`, so every selection struct now rejects unknown keys at deserialization time ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.7/crates/brk_types/src/series_selection.rs))
- Added `#[serde(deny_unknown_fields)]` to the remaining query/param structs that lacked it: `Pagination`, `SearchQuery`, `OptionalTimestampParam`, `AddrTxidsParam`, `UrpdQuery`, and the CLI `Config`. Combined with the new `Empty` extractor, this closes the last paths where an injected query param could be used to cache-bust an otherwise-cacheable response ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.7/crates/brk_types/src/pagination.rs))

#### `brk_bindgen`

- The Python type-dependency walker previously kept self-references in the dep set, so a type that recursively referenced itself (e.g., a node-graph schema) produced a circular import in the emitted Python module. Self-references are now dropped at collection time (handled at emit by quoting via `current_type`), eliminating the import cycle ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.7/crates/brk_bindgen/src/generators/python/types.rs))

### Internal Changes

#### `brk_cli`

- Removed every per-field `deserialize_with = "default_on_error"` from `Config`. With `deny_unknown_fields` now on the struct, silently-defaulting fields would mask the validation error, so each option falls back to `serde(default)` and lets the loader report a real error on bad input ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.7/crates/brk_cli/src/config.rs))

#### `brk_computer`

- Threaded `cached_starts: &Windows<&WindowStartVec>` through additional `forced_import_with` call sites (`distribution::addr::new_addr_count`, `inputs::by_type::import`, `outputs::by_type::import`) so windowed rolling sums share the same starts cache used by the rest of the distribution pipeline, instead of recomputing per-import ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.7/crates/brk_computer/src/distribution/addr/new_addr_count.rs))

#### `clients`

- Bumped the auto-generated `modules/brk-client` (npm) and `packages/brk_client` (PyPI) bindings to reflect the new validation surface: every cacheable endpoint now rejects unknown query keys, `txId[]` rejects malformed values with a 400, and the range/selection types no longer expose a `range` sub-object ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.7/modules/brk-client/index.js))

#### `scripts`

- Updated `scripts/cf-purge.sh` for the tightened cache surface so post-deploy purges still cover every cacheable path under the new `Empty`-extractor regime ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.7/scripts/cf-purge.sh))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.3.0-beta.6...v0.3.0-beta.7)

## [v0.3.0-beta.6](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.3.0-beta.6) - 2026-04-27

### Breaking Changes

#### `brk_mempool`

- Rewrote the crate around `Mempool(Arc<Inner>)`, where `Inner` holds `client`, `state: MempoolState`, and `rebuilder: Rebuilder`. The previous flat module layout is gone: behavior lives under `steps/` (`fetcher`, `preparer`, `applier`, `resolver`, `rebuilder`) and storage under `stores/` (`addr_tracker`, `entry`, `entry_pool`, `state`, `tombstone`, `tx_graveyard`, `tx_index`, `tx_store`). The previous top-level `entry.rs`, `entry_pool.rs`, `tx_store.rs`, `sync.rs`, `types/`, `block_builder/` are deleted ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.6/crates/brk_mempool/src/lib.rs))
- `MempoolState` consolidates the five sub-stores (`info`, `txs`, `addrs`, `entries`, `graveyard`) each behind its own `RwLock`. `MempoolState::apply(Pulled) -> bool` takes the five write locks in a fixed order and runs the new `Applier` step, replacing the per-store ad-hoc locking that previously lived in `sync.rs` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.6/crates/brk_mempool/src/stores/state.rs))
- Public accessors renamed: `Mempool` now exposes `info()`, `snapshot()`, `fees()`, `block_stats()`, `next_block_hash()`, `addr_state_hash()`, `txs()`, `entries()`, `addrs()`, `graveyard()`. The old `sync`/`update`/`tx_store`/`entry_pool`/`addr_tracker` getters are gone. `Mempool::start_with(after_update)` lets callers run a callback after every successful tick, and `Mempool::fill_prevouts<F>(resolver)` exposes the prevout-resolution step to outside crates ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.6/crates/brk_mempool/src/lib.rs))

#### `brk_rpc`

- Removed the dual-backend layout. The `[features]` block, `bitcoincore-rpc` backend, `corepc-client` dep, and `backend/{mod,bitcoincore,corepc}.rs` files are all deleted. The crate now depends directly on `corepc-jsonrpc`, `corepc-types`, `rustc-hash`, and `serde`/`serde_json`, and `brk_error/corepc+serde_json` is no longer optional ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.6/crates/brk_rpc/Cargo.toml))
- `Client` is now backed by `ClientInner` wrapping a `corepc-jsonrpc` `Client` over `simple_http::Builder` (pooled TCP socket with reconnect). This replaces the upstream `corepc-client` path that uses `bitreq_http`, which collapses under concurrent load. New methods `call_with_retry`, `call_once`, `call_batch`, and `call_batch_per_item` centralize retry/backoff for single and batched RPC calls ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.6/crates/brk_rpc/src/client.rs))

#### `brk_server`

- `Server::new` now takes `(query, config: ServerConfig)` instead of a long positional argument list. `ServerConfig { data_path, website, cdn_cache_mode, max_weight, max_weight_localhost, cache_size }` lives in the new `crates/brk_server/src/config.rs` with `DEFAULT_MAX_WEIGHT = 4 * 8 * 10_000`, `DEFAULT_MAX_WEIGHT_LOCALHOST = 50_000_000`, and `DEFAULT_CACHE_SIZE = 1000`. `Server::new` calls `cache::init(config.cdn_cache_mode)` to set the process-global CDN mode ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.6/crates/brk_server/src/lib.rs))
- The `api/mempool_space/` namespace is removed. Its routes are reorganized into top-level modules (`addrs`, `blocks`, `fees`, `general`, `mempool`, `mining`, `transactions`) alongside the existing `metrics`, `series`, `series_legacy`, `urpd`, and `server`. `ApiRoutes::add_api_routes` mounts them at the api root, so the `/api/v1/...` URL shape is preserved but the Rust import paths change ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.6/crates/brk_server/src/api/mod.rs))
- The previous `cache.rs` single file is split into `cache/{mod,mode,params,strategy}.rs`. `CacheStrategy` now has four variants (`Tip`, `Immutable(Version)`, `Deploy`, `BlockBound(Version, BlockHashPrefix)`, `MempoolHash(u64)`). `CacheParams { etag, cache_control, cdn_cache_control }` is constructed via named constructors (`tip`, `immutable`, `block_bound`, `deploy`, `mempool_hash`, `series`, `error`). `new_not_modified` now takes `&CacheParams` and `new_json_cached` is a private free function inside the response module ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.6/crates/brk_server/src/cache/mod.rs))

#### `brk_types`

- Moved `Etag` out of `brk_types` and into `brk_server::etag` (`brk_types/src/etag.rs` deleted). Downstream consumers that imported `brk_types::Etag` must now import `brk_server::etag::Etag` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.6/crates/brk_types/src/lib.rs))
- `TxIn.witness` field changed from `Vec<String>` to the new `Witness` newtype. Callers that read the field as a vector of hex strings must switch to the `Witness` API (`len`, `last`, `second_to_last`, iteration over `&[u8]` items). The on-the-wire JSON shape is preserved by `Witness`'s `Serialize`/`Deserialize`, but Rust-level field access is a breaking change ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.6/crates/brk_types/src/txin.rs))

#### `brk_error`

- Dropped the `BitcoinRPC(#[from] bitcoincore_rpc::Error)` variant alongside the corresponding feature flag, since `bitcoincore-rpc` is no longer a backend. The `CorepcRPC` variant now wraps `corepc_jsonrpc::error::Error` instead of `corepc_client::client_sync::Error`. Callers matching on `Error::BitcoinRPC` must drop the arm; callers matching on `Error::CorepcRPC` must update the inner type ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.6/crates/brk_error/src/lib.rs))

#### `brk_server`

- Deleted `crates/brk_server/src/params/limit_param.rs`. The `LimitParam` struct (which wrapped a single `limit: Limit` query field via `serde(default)`) is removed from the public surface. Routes that needed limit handling now reach it through `DataRangeFormat` / per-route param structs aligned with the new `with_range_format!` macro pipeline ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.6/crates/brk_server/src/params/mod.rs))

### New Features

#### `brk_server`

- Added `CdnCacheMode` with `Live` (`Cache-Control: public, max-age=1, stale-if-error=300`) and `Aggressive` (`public, max-age=31536000, immutable`, RFC 9213 style). The selected mode is stored in a process-global `OnceLock` initialized once via `cache::init`, and `CacheParams::series(version, total, end, hash)` automatically picks `Live` for tail-bound series and the configured mode for fully-historical responses ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.6/crates/brk_server/src/cache/mode.rs))
- Per-request weight caps: `State::max_weight_for(addr)` returns the localhost cap for loopback peers and the public cap for everyone else, with both numbers configurable. Series and bulk endpoints consult this before serving large responses, so an operator can run a generous local CLI alongside a tighter public endpoint without redeploying ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.6/crates/brk_server/src/state.rs))
- New RBF endpoints aligned with mempool.space's surface: `/api/v1/tx/:txid/rbf` returns `RbfResponse { tx: RbfTx, replacements: Option<Vec<ReplacementNode>> }`, including the BIP-125 `rbf` signal and a `fullRbf` flag per node. The endpoint is wired through `brk_server::api::transactions` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.6/crates/brk_server/src/api/transactions.rs))

#### `brk_cli`

- Configuration gained four new fields: `cdn` (`Live` / `Aggressive`), `maxweight`, `maxweightlocal`, and `cachesize`. They are exposed via `Config::cdn_cache_mode()`, `max_weight()`, `max_weight_localhost()`, and `cache_size()`, and threaded into `ServerConfig` on startup ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.6/crates/brk_cli/src/config.rs))
- The CLI now starts the mempool via `Mempool::start_with(|| query_clone.sync(|q| q.fill_mempool_prevouts()))` so every successful update triggers a prevout backfill against the indexer without exposing the resolver to user code ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.6/crates/brk_cli/src/main.rs))

#### `brk_logger`

- Default `RUST_LOG` directives dropped the `bitcoincore_rpc=off` filter (no longer linked) and the standalone `bitcoin=off` (the `corepc=off` filter covers the surviving traces from the new RPC stack) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.6/crates/brk_logger/src/lib.rs))

#### `brk_query`

- Added `fill_mempool_prevouts() -> bool` on `Query`. For each mempool tx with a `prevout == None`, it resolves the predecessor via `txid_prefix_to_tx_index`, walks `first_txout_index_reader` + `vout` to read `output_type`, `type_index`, and `value`, and reconstructs `script_pubkey`. Returns `true` when at least one prevout was filled, so callers can short-circuit no-op ticks ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.6/crates/brk_query/src/impl/mempool.rs))
- Added `tx_rbf(&Txid) -> Result<RbfResponse>` returning the BIP-125 replacement tree for a given txid, complete with descendant replacements. The CPFP ancestor walk now deduplicates visited nodes via `FxHashSet` and aggregates `package_fee` and `package_vsize` alongside the existing single-tx metrics, eliminating an O(n^2) revisit pattern on dense clusters ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.6/crates/brk_query/src/impl/mempool.rs))

#### `brk_types`

- Added the `Witness(bitcoin::Witness)` newtype with `Serialize` / `Deserialize` impls that round-trip as `Vec<String>` (hex per item), matching the JSON-RPC convention. Used by the new RBF/Tx response types ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.6/crates/brk_types/src/witness.rs))
- `Tx` gained `encode_bytes() -> Vec<u8>` (consensus-encode round-trip through `bitcoin::Transaction`) and `total_sigop_cost()` (legacy + P2SH redeem-script + witness sigops, using saturating arithmetic). Added `impl From<&Transaction> for bitcoin::Transaction` so server code can hand BRK txs to any `rust-bitcoin` consumer ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.6/crates/brk_types/src/tx.rs))
- New `RbfTx`, `ReplacementNode`, and `RbfResponse` types under `brk_types::rbf`, shaped to match mempool.space's `/api/v1/tx/:txid/rbf` response and powering the new endpoint ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.6/crates/brk_types/src/rbf.rs))

#### `brk_mempool`

- New `Tombstone` store records every tx that leaves the mempool, the reason (`Removal` vs `Replacement`), and the block hash that evicted it. `Applier::apply` moves removals into the graveyard, hydrates `Revived` additions by `exhume()`-ing from the graveyard when a previously-evicted txid reappears, and evicts old tombstones when the graveyard exceeds its bound ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.6/crates/brk_mempool/src/steps/applier.rs))
- `Mempool::fill_prevouts<F>(resolver)` runs an external prevout resolver against the current entry pool and rewrites missing `TxIn::prevout` fields under a single write lock. Used by the CLI to pull prevouts from the indexer after every successful update ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.6/crates/brk_mempool/src/lib.rs))

### Bug Fixes

#### `brk_query`

- The CPFP ancestor walk in `cpfp_info_for_tx` previously revisited shared ancestors, double-counting fees and vsize on diamond-shaped clusters. Visited nodes are now tracked in an `FxHashSet`, so `package_fee` and `package_vsize` reflect each ancestor exactly once ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.6/crates/brk_query/src/impl/mempool.rs))

#### `brk_server`

- `new_not_modified` previously took a bare `&Etag` and inconsistently set CDN headers, so 304 responses from `Live`-mode endpoints could be cached aggressively by upstream CDNs. It now takes the full `CacheParams` and emits the matching `Cache-Control` and `CDN-Cache-Control` headers for every 304 ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.6/crates/brk_server/src/extended/response.rs))
- `Error::into_response_with_etag` now takes an owned `Etag` (was `&str`) and routes through `CacheParams::error(etag)`, and the bare `IntoResponse for Error` impl calls `CacheParams::apply_error_cache_control(headers)`. Error responses now ship matching `Cache-Control` and `CDN-Cache-Control` headers under both code paths, so a 4xx/5xx from a `Live`-mode route is no longer cacheable by an upstream CDN even when the previous helper path was bypassed ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.6/crates/brk_server/src/error.rs))

### Internal Changes

#### `brk_server`

- `static_json` and `static_bytes` now go through `CacheParams::deploy()` so all bundled-website assets share the same deploy-versioned ETag and cache profile. Error responses route through `CacheParams::error(etag) -> apply_error_cache_control(headers)` to set short TTLs without forking the response builder ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.6/crates/brk_server/src/extended/response.rs))
- `crates/brk_server/src/etag.rs` introduces `Etag(String)`, replacing the `brk_types::Etag` that was deleted in the same release. Keeping the type next to `CacheParams` lets the cache layer evolve without touching the shared types crate ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.6/crates/brk_server/src/etag.rs))

#### `brk_types`

- `Hex` newtype gained `Deref<Target = str>`, `AsRef<str>`, `AsRef<[u8]>`, `Display`, `From<String>`, `From<Hex> for String`, and an inherent `as_str()` so call sites that need a borrowed `&str` or `&[u8]` no longer round-trip through `.into()` / `.to_string()` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.6/crates/brk_types/src/hex.rs))
- Added `From<&TxIn> for bitcoin::TxIn`, `From<&TxOut> for bitcoin::TxOut`, and `From<TxVersionRaw> for bitcoin::transaction::Version`. BRK shapes hand off to `rust-bitcoin` consumers without re-encoding through hex, so the RBF / CPFP / sigops paths can build a `bitcoin::Transaction` directly from the indexed form. Separately, `Vin` gained `From<Vin> for usize` for `Vec<TxIn>` slice indexing ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.6/crates/brk_types/src/txin.rs))

#### `brk_mempool`

- The block-builder pipeline (`graph`, `linearize/sfl`, `partitioner`, `package`, `pool_index`, `tx_node`, `projected_blocks/{fees,snapshot,stats,verify}`) moved under `steps/rebuilder/block_builder/` and `steps/rebuilder/projected_blocks/` so the rebuild step owns its own data. The `mempool.rs` example was updated to drive the new `start_with` shape ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.6/crates/brk_mempool/src/steps/rebuilder/mod.rs))

#### `scripts`

- Added `scripts/cf-purge.sh`, a Cloudflare API helper for invalidating cached URLs when running in `CdnCacheMode::Aggressive`. The script reads `CF_ZONE_ID` and `CF_API_TOKEN` from the environment and POSTs a `purge_cache` request for the paths supplied on the command line ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.6/scripts/cf-purge.sh))

#### `website`

- Upgraded Lightweight Charts from 5.1.0 to 5.2.0. The new bundle ships under `modules/lightweight-charts/5.2.0/`, and the 5.1.0 tree is deleted. Explorer chart and DOM helpers (`scripts/explorer/chain.js`, `scripts/explorer/index.js`, `scripts/utils/chart/index.js`, `scripts/utils/dom.js`) were adapted to the 5.2.0 API surface, and `styles/chart.css`, `styles/components.css`, `styles/elements.css`, `styles/main.css`, and `styles/panes/explorer.css` were updated to match ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.6/website/scripts/utils/chart/index.js))

#### `clients`

- Bumped the auto-generated `modules/brk-client` (npm) and `packages/brk_client` (PyPI) bindings to match the new server surface (RBF endpoint, renamed mempool routes, removed `mempool_space/` paths) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.6/modules/brk-client/index.js))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.3.0-beta.5...v0.3.0-beta.6)

## [v0.3.0-beta.5](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.3.0-beta.5) - 2026-04-23

### Breaking Changes

#### `brk_computer`

- Reorganized the `distribution::addr` module: the bespoke `addr_count`, `exposed/count`, `exposed/supply`, and `reused/count` files are gone, replaced by shared `count/` and `supply/` submodules (`AddrCountsVecs`, `AddrCountFundedTotalVecs`, `AddrSupplyVecs`, `AddrSupplyShareVecs`, `AddrTypeToAddrCount`, `AddrTypeToSupply`) reused by exposed, reused, and respent. The old type aliases `AddrTypeToExposedAddrCount`, `AddrTypeToExposedSupply`, `AddrTypeToReusedAddrCount` are removed from the public surface ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.5/crates/brk_computer/src/distribution/addr/mod.rs))
- Renamed `ReusedAddrEventsVecs` to `AddrEventsVecs` and `AddrTypeToReusedAddrEventCount` to `AddrTypeToAddrEventCount` since the same struct now backs both reused and respent metrics ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.5/crates/brk_computer/src/distribution/addr/reused/events/mod.rs))
- `ReusedAddrVecs::forced_import` and the supporting count/events/supply importers now take a `name: &str` parameter (`"reused"` vs `"respent"`) so the same vec layout can be instantiated twice under different on-disk prefixes ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.5/crates/brk_computer/src/distribution/addr/reused/mod.rs))

#### `brk_rpc`

- Feature flags are now `default = ["corepc"]`, `bitcoincore-rpc`, and `corepc`. Builds that previously enabled both backends must pick one ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.5/crates/brk_rpc/Cargo.toml))

### New Features

#### `brk_computer`

- Address-reuse tracking now has a spend-side counterpart, "respent": addresses with `spent_txo_count > 1` are tracked alongside the existing receive-side `funded_txo_count > 1` reused metric. `distribution::vecs::AddrMetricsVecs` gained a `respent: ReusedAddrVecs` field that stores funded/total count, output/input events, share of outputs and inputs, supply, and supply share under the `respent_*` on-disk prefix ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.5/crates/brk_computer/src/distribution/vecs.rs))
- Reused tracking gained the `supply` and `supply_share` fields previously exclusive to exposed addresses, so both predicates now report total balance held by the funded subset plus its share of all-supply and per-type supply ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.5/crates/brk_computer/src/distribution/addr/reused/mod.rs))
- Introduced `AddrMetricsState` as a single per-block runtime bundle covering funded/empty counts, activity counters, exposed/reused/respent state, and pre/post snapshots (`AddrReceivePreState`, `AddrSendPreState`). The block loop calls `state.on_receive_applied` / `state.on_send_applied` instead of threading thirteen separate mutable counters through `process_received` and `process_sent`. `From<(&AddrMetricsVecs, Height)>` rebuilds the bundle from disk when resuming a run ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.5/crates/brk_computer/src/distribution/addr/state.rs))
- Added named state structs `ExposedAddrState` and `ReusedAddrState` with explicit `on_receive_as_reused`, `on_receive_as_respent`, `on_send_as_reused`, `on_send_as_respent` methods. The respent threshold-crossing logic correctly handles the case where the 2nd-ever spend also empties the address (skips the funded-count bump so the `will_be_empty` decrement doesn't underflow) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.5/crates/brk_computer/src/distribution/addr/reused/state.rs))

#### `brk_mempool`

- Projected blocks now expose intra-cluster ordering: `Package` carries `cluster_id` and `chunk_order` so the partitioner's look-ahead can refuse to pull a child chunk into an earlier block than its parent chunk. `partition_into_blocks` maintains a per-cluster `cluster_next` cursor and skips any candidate whose `chunk_order` is past its cluster's next-expected slot, eliminating a class of CPFP-ordering bugs in the projected next-block view ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.5/crates/brk_mempool/src/block_builder/partitioner.rs))
- Debug builds run a new `projected_blocks::verify::Verifier::check` after each projection. It asserts parents-before-children inside every package, no duplicate txids across blocks, each package's stored vsize equals the sum of its tx vsizes, and non-final blocks fit within `BLOCK_VSIZE`. It also pulls Bitcoin Core's `getblocktemplate` and logs the Jaccard overlap and fee delta (in bps) between BRK's next block and Core's ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.5/crates/brk_mempool/src/projected_blocks/verify.rs))

#### `brk_rpc`

- Added `Client::get_block_template_txs()` on both backends. It calls Core's `getblocktemplate` with the `segwit` rule and returns `Vec<BlockTemplateTx>` (txid + fee in sats), powering the new mempool projection verifier ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.5/crates/brk_rpc/src/lib.rs))

#### `brk_types`

- `FundedAddrData` gained `is_respent()` (true when `spent_txo_count > 1`), `respent_supply_contribution()` (balance if currently funded AND respent, else zero), and `reused_supply_contribution()` (same gate on `is_reused()`). These power the new shared address-supply tracking and align documentation by describing `is_reused` as the receive-side proxy and `is_respent` as the spend-side counterpart ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.5/crates/brk_types/src/funded_addr_data.rs))

#### `website`

- Reused subtrees (per cohort and the network-wide chart) now overlay two series per chart: 2+ Funded (reused, primary color) and 2+ Spent (respent, gray). The Funded / Total / Outputs / Inputs sections each show the pair, and new Supply + Share sections plot funded supply and share-of-supply for both predicates. The previous "Compare" tab is replaced by combining funded and total into the dedicated tabs ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.5/website/scripts/options/shared.js))
- Refreshed the site favicon and PWA icon set: new `favicon.svg`, `favicon-96x96.png`, `favicon.ico`, `apple-touch-icon.png`, and `web-app-manifest-{192,512}x512.png` under `/assets/favicon/`, plus new `logo.svg`, `logo-light.svg`, `logo-dark.svg`, `logo-orange.svg` under `/assets/logo/`. The OpenAPI Scalar HTML, `manifest.webmanifest`, and `index.html` now point at the new paths, and the old `manifest-icon-*` and `apple-icon-180.png` files are deleted ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.5/website/index.html))

### Bug Fixes

#### `brk_query`

- `urpd_dates` now sorts cohorts via `sort_by_key(|a| a.to_string())` rather than building two `to_string()` values per comparison, and `urpd_at` no longer takes an unused `agg` parameter (the aggregation is applied in the downstream URPD builder, not the dates lookup) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.5/crates/brk_query/src/impl/urpd.rs))

#### `brk_mempool`

- SFL's `recurse` function got an `#[allow(clippy::too_many_arguments)]` shim so the lint stops firing on the linearization solver's hot path ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.5/crates/brk_mempool/src/block_builder/linearize/sfl.rs))

### Internal Changes

#### `brk_computer`

- The block loop simplifies dramatically: the bespoke "recover seven separate counters from height" block in `compute/block_loop.rs` collapses to `AddrMetricsState::from((&vecs.addrs, starting_height))`, and `process_received` / `process_sent` lost their nine and ten parameters respectively in favour of `state: &mut AddrMetricsState` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.5/crates/brk_computer/src/distribution/compute/block_loop.rs))
- `AddrMetricsVecs` gained `reset_height`, `min_stateful_len`, `par_iter_stateful_height_mut`, `par_iter_height_mut`, and `push_height(state, active_addr_count)` aggregators so the rest of the pipeline no longer needs to iterate the funded/empty/activity/reused/respent/exposed vecs individually ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.5/crates/brk_computer/src/distribution/vecs.rs))

#### `brk_mempool`

- The block builder switched from `for cluster in clusters` to enumerating `(cluster_id, cluster)` and `(chunk_order, chunk)`, propagating the indices through `singleton_package` and `chunk_to_package`. A `take` helper centralizes the partitioner's debug_assert that the picked chunk matches `cluster_next[cluster_id]` before bumping the cursor ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.5/crates/brk_mempool/src/block_builder/linearize/mod.rs))

#### `brk_server`

- Open Graph and Twitter card images on the Scalar API docs page now point at `/assets/favicon/web-app-manifest-512x512.png` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.5/crates/brk_server/src/api/scalar.html))

#### `website`

- `network.js` rebuilt the network-level reused subtree (`reusedSubtreeForAll`) to share the same overlay pattern as the per-cohort `reusedSubtree` in `shared.js`. `distribution/index.js` now passes `cohort.respent` into `reusedSubtree`, and `distribution/data.js` exposes `respent` alongside `reused` on each cohort entry ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.5/website/scripts/options/network.js))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.3.0-beta.4...v0.3.0-beta.5)

## [v0.3.0-beta.4](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.3.0-beta.4) - 2026-04-22

### Breaking Changes

#### `brk_types`

- Renamed the cost-basis distribution surface to URPD (UTXO Realized Price Distribution): `CostBasisBucket` is now `UrpdAggregation`, `CostBasisDistribution` is now `UrpdRaw`. `CostBasisValue` and `CostBasisFormatted` are gone from the public crate root (the legacy server route keeps a private copy with a 2027-01-01 sunset). A fresh `Urpd` struct (`cohort`, `date`, `aggregation`, `close`, `total_supply`, `buckets`) and a `UrpdBucket` struct (`price_floor`, `supply`, `realized_cap`, `unrealized_pnl`) replace the old map-of-floats shape, so each bucket now carries supply (BTC), realized cap contribution (USD = `price_floor * supply`), and unrealized P&L vs that date's close (USD, can be negative) in one response ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.4/crates/brk_types/src/urpd.rs))
- Every age-bucket slug in the `Cohort` schemars enum gained a `utxos_` prefix: `under_1h_old` is now `utxos_under_1h_old`, the 18 in-between buckets follow the same rule, and `over_15y_old` is `utxos_over_15y_old`. OpenAPI consumers that hard-coded the old slugs need to update their cohort lists ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.4/crates/brk_types/src/cohort.rs))
- `Cohort` gained `Debug + Clone + Serialize` derives so it can travel through API response bodies (the new `Urpd.cohort` field requires it), not just inbound path params ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.4/crates/brk_types/src/cohort.rs))

#### `brk_query`

- The `cost_basis_*` methods (`cost_basis_cohorts`, `cost_basis_distribution`, `cost_basis_dates`, `cost_basis_formatted`) were replaced by URPD-named equivalents: `urpd_cohorts() -> Vec<Cohort>`, `urpd_dates(&Cohort) -> Vec<Date>`, `urpd_raw(&Cohort, Date) -> UrpdRaw`, `urpd_at(&Cohort, Date, UrpdAggregation) -> Urpd`, and a new `urpd_latest(&Cohort, UrpdAggregation) -> Urpd`. Cohorts are now returned as typed `Cohort` values instead of `String`. The cohort directory layout on disk moved from `utxo_{cohort}_cost_basis/by_date/{date}` to `{cohort}/urpd/{date}` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.4/crates/brk_query/src/impl/urpd.rs))

#### `brk_server`

- `/api/series/cost-basis`, `/api/series/cost-basis/{cohort}/dates`, and `/api/series/cost-basis/{cohort}/{date}` are now marked deprecated with a 2027-01-01 sunset and live in a dedicated `api/series/cost_basis.rs` module behind `add_cost_basis_legacy_routes()`. The canonical replacements live under `/api/urpd` (see new features) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.4/crates/brk_server/src/api/series/cost_basis.rs))
- `params/cost_basis_params.rs` (`CostBasisParams`, `CostBasisCohortParam`, `CostBasisQuery`) was removed from the public `params` re-exports; the legacy route keeps its own private copies. Downstream code that imported the public types must migrate to `UrpdParams` / `UrpdCohortParam` / `UrpdQuery` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.4/crates/brk_server/src/params/mod.rs))

#### `brk_computer`

- Internal renames across the whole crate: the `internal::amount` module is now `internal::value`, `AmountPerBlock` is `ValuePerBlock`, `AmountBlock` is `ValueBlock`, `AmountPerBlockCumulative` / `AmountPerBlockCumulativeRolling` / `AmountPerBlockWithDeltas` / `LazyAmountPerBlock` follow the same `Amount→Value` rename. `LazyRollingDeltasFromHeight` (the amount-typed delta) is now `LazyRollingDeltasAmountFromHeight`, paired with a new `LazyDeltaAmountFromHeight`. Touches `distribution/`, `cointime/supply/`, `mining/rewards/`, `outputs/value/`, `supply/`, `supply/burned/`, `investing/`, `transactions/volume/`, and `pools/major.rs` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.4/crates/brk_computer/src/internal/per_block/value/base.rs))
- `internal::CentsType` (the trait associating a cents type with its `ToDollars` transform) is now `internal::FiatType`. All `FiatPerBlock` / `FiatPerBlockCumulativeWithSums` / `LazyFiatPerBlock` / `LazyRollingSumsFiatFromHeight` / `LazyDeltaFiatFromHeight` / `FiatPerBlockWithDeltas` bounds use the new name ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.4/crates/brk_computer/src/internal/per_block/fiat/base.rs))
- The on-disk URPD layout moved from `utxo_{cohort_id}_cost_basis/by_date/{date}` to `utxo_{cohort_id}/urpd/{date}` (per-date snapshots) and from `utxo_{cohort_id}_cost_basis/by_height/{height}` to `utxo_{cohort_id}/cost_basis/{height}` (per-height state). Existing computed state directories must be re-generated or moved before upgrading ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.4/crates/brk_computer/src/distribution/cohorts/utxo/percentiles.rs))

### New Features

#### `brk_server`

- New `/api/urpd` top-level route group with four endpoints: `GET /api/urpd` (list cohorts, returns `Vec<Cohort>`), `GET /api/urpd/{cohort}/dates` (history), `GET /api/urpd/{cohort}` (latest snapshot), and `GET /api/urpd/{cohort}/{date}` (specific snapshot). Each (cohort, date) response carries close price, total supply, and per-bucket `{price_floor, supply, realized_cap, unrealized_pnl}` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.4/crates/brk_server/src/api/urpd/mod.rs))
- Bucketing now flows through a single `agg` query parameter (with `bucket` accepted as an alias for the legacy clients) supporting `raw`, `lin200` / `lin500` / `lin1000` (linear, $200 / $500 / $1000 wide), and `log10` / `log50` / `log100` / `log200` (logarithmic, N bins per price decade). The aggregation echoes back on the response under `aggregation` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.4/crates/brk_server/src/params/urpd_params.rs))
- New OpenAPI `URPD` tag with a long-form description covering the response shape, bucket semantics, and the discovery flow (cohorts, latest, dates, specific). Added a `urpd_tag()` helper on the `TransformOperation` extension ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.4/crates/brk_server/src/api/openapi/mod.rs))
- `Metrics` OpenAPI tag is now flagged `deprecated: true` via the `extensions` map, so Swagger UI consumers see the entire legacy section greyed out ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.4/crates/brk_server/src/api/openapi/mod.rs))

#### `brk_types`

- `Sats` gained `ONE_BTC_I128: i128 = 100_000_000` and `as_i128(self) -> i128` so signed-sats math can stay in `i128` without going through `i64::from`/`i128::from` casts ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.4/crates/brk_types/src/sats.rs))

#### `brk_computer`

- Added `LazyDeltaAmountFromHeight<S, C>` (a sats-stored absolute change vec paired with a lazy BTC view) and `LazyRollingDeltasAmountFromHeight<S, C, B>` (the four-window absolute / rate analog of the existing fiat-typed `LazyRollingDeltasFiatFromHeight`). Powers the new `SupplyBase.delta` shape and unlocks the `AmountDeltaPattern` consumed by the website's per-cohort change charts ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.4/crates/brk_computer/src/internal/per_block/rolling/delta.rs))

#### `website`

- New website helpers in `scripts/options/shared.js`: `amount({ pattern, ... })` and `amountBaseline({ pattern, ... })` emit paired `btc` + `sats` line / baseline series from a single `{ btc, sats }` pattern, removing the per-call `Unit.sats` plumbing for amount-typed cohort series ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.4/website/scripts/options/shared.js))
- New `amountSumsTreeBaseline({ windows, title, metric, legend })` builder in `scripts/options/series.js` mirrors `sumsTreeBaseline` for the `AmountPattern` shape, emitting per-window compare + per-window detail charts that show both BTC and sats ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.4/website/scripts/options/series.js))
- Distribution Holdings options switched to the new amount-typed delta plumbing: `singleAmountDeltaItems` and `groupedAmountDeltaItems` replace the prior `Unit.sats`-only path for Supply Change and Growth Rate charts, so the change views now expose both sats and lazy BTC per rolling window ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.4/website/scripts/options/distribution/holdings.js))
- New JSDoc typedefs: `AmountDeltaPattern` (= `Brk.AbsoluteRatePattern3`) and `AmountPattern` (= `Brk.BtcSatsPattern`), surfacing the bindgen split between fiat-typed and amount-typed rolling deltas ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.4/website/scripts/_types.js))

### Internal Changes

#### `brk_computer`

- `utxo/percentiles.rs` now derives the on-disk directory name via `CohortContext::Utxo.prefixed(name.id)` instead of inlining `format!("utxo_{name}")`, keeping all UTXO-cohort path construction in one helper ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.4/crates/brk_computer/src/distribution/cohorts/utxo/percentiles.rs))
- `CostBasisRaw` dropped the redundant `by_height` subdirectory and the matching `path_by_height` helper; state files now live directly under `{cohort}/cost_basis/{height}` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.4/crates/brk_computer/src/distribution/state/cost_basis/data.rs))

#### `brk_server`

- Added `rustc-hash` workspace dep so the legacy cost-basis bucket aggregator can use `FxHashMap` for its in-route accumulator without pulling the dep through `brk_query` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.4/crates/brk_server/Cargo.toml))

#### `website`

- `panes/chart.js` and `utils/chart/index.js` now drive the chart's candlestick body, border, and wicks from `colors.default` + the new `colors.background` foreground/background pair (previously hard-coded to the bi-color `p1` palette). Adds a `priceLineColor` and turns on `borderVisible` so candle outlines render in the chart's foreground color ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.4/website/scripts/panes/chart.js))
- `colors.background` exposes the CSS `--background-color` variable as a chart-ready `Color` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.4/website/scripts/utils/colors.js))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.3.0-beta.3...v0.3.0-beta.4)

## [v0.3.0-beta.3](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.3.0-beta.3) - 2026-04-22

### Breaking Changes

#### `brk_types`

- Renamed every public "investor" symbol to "capitalized": `Cents::to_investor_cap` is now `to_capitalized_cap`, `CentsSats::to_investor_cap` is now `to_capitalized_cap`, `CostBasisSnapshot.investor_cap` is now `capitalized_cap_raw`, and `FundedAddrData.investor_cap_raw` is now `capitalized_cap_raw`. The on-the-wire byte layout of `FundedAddrData` is preserved, but every consumer that names the field has to migrate ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/crates/brk_types/src/funded_addr_data.rs))
- `FundedAddrData::exposed_supply_contribution` now returns `Sats` instead of `u64`, eliminating the implicit `u64::from` at every call site ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/crates/brk_types/src/funded_addr_data.rs))
- `MempoolBlock.block_size` is now the serialized byte size (witness + non-witness), not `total_vsize * 4`. `MempoolBlock::new` gained a `total_size: u64` parameter that callers must thread through ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/crates/brk_types/src/mempool_block.rs))
- `Cohort`'s schemars annotation switched from per-example hints to an explicit `extend("enum" = [...])` listing all 22 valid cohort slugs (`all`, `sth`, `lth`, the 18 age buckets, and `over_15y_old`), so OpenAPI consumers get a proper string enum instead of free-form text with examples ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/crates/brk_types/src/cohort.rs))
- `TxWithHex` moved out of `brk_types` (deleted from `lib.rs` re-exports) and into `brk_mempool::types::TxWithHex`; downstream code that imported `brk_types::TxWithHex` now needs `brk_mempool::TxWithHex` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/crates/brk_mempool/src/types/tx_with_hex.rs))

#### `brk_rpc`

- Renamed `Client::get_mempool_transaction(txid) -> Result<TxWithHex>` to `Client::get_mempool_raw_tx(txid) -> Result<(bitcoin::Transaction, String)>`. The wrapper no longer resolves prevouts or spawns per-input `get_tx_out` calls. Address resolution and `TxIn`/`TxOut` reconstruction moved into `brk_mempool::sync::build_transaction`, which batches one `get_raw_transaction` per unique parent txid via an `FxHashMap` cache (huge win when a mempool descendant has many in-mempool ancestors) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/crates/brk_rpc/src/lib.rs))

#### `brk_mempool`

- Replaced `selector.rs` (114 lines) and `heap_entry.rs` (66 lines) with a new `linearize` module implementing cluster-mempool linearization. The inner SFL algorithm (`linearize/sfl.rs`, 264 lines) does a topologically-closed-subset search, optimal for clusters up to 18 txs and near-optimal beyond. Comes with a fresh test suite under `linearize/tests/{basic,oracle,stress}.rs` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/crates/brk_mempool/src/block_builder/linearize/mod.rs))
- `build_projected_blocks` now returns `Vec<Vec<Package>>` instead of `Vec<Vec<SelectedTx>>`. Blocks 1 through `NUM_BLOCKS - 1` are still ~1MB blocks sorted by placement rate, but the eighth block is now a catch-all containing every remaining package so no low-rate tx silently disappears (matches mempool.space's last-block behavior). `SelectedTx` is gone; `Package` (with `fee_rate`, ordered `txs`, aggregate sats / vsize) is the new selection unit ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/crates/brk_mempool/src/block_builder/mod.rs))
- `Snapshot::build` and `compute_block_stats` now take `&[Package]` instead of `&[SelectedTx]`; per-tx fee rate in the percentile distribution comes from the containing package's `fee_rate` (the rate the miner actually collects per vsize) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/crates/brk_mempool/src/projected_blocks/stats.rs))

#### `brk_computer`

- Mass rename of the "investor" cohort metric to "capitalized": `RealizedInvestor` is now `RealizedCapitalized`, `realized.investor.*` is now `realized.capitalized.*`, and the on-disk vec names `investor_price` / `investor_cap_raw` were renamed to `capitalized_price` / `capitalized_cap_raw`. The `CostBasisData` accumulator trait methods (`set_investor_cap_raw`, `increment_snapshot`, `decrement_snapshot`) and `RealizedFullAccum` follow the same rename ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/crates/brk_computer/src/distribution/metrics/realized/full.rs))
- `RelativeFull.supply_in_profit_to_own` and `supply_in_loss_to_own` are now `supply_in_profit_share` / `supply_in_loss_share`. The disk-stored series gain a `_share` suffix and lose `_to_own` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/crates/brk_computer/src/distribution/metrics/relative/full.rs))
- Deleted the `RelativeToAll` module. `supply_to_circulating`, `supply_in_profit_to_circulating`, and `supply_in_loss_to_circulating` are no longer emitted from the per-cohort tier; they have a single replacement in the new `ExposedSupplyShareVecs` at the exposed-supply level (see new features). `RelativeWithExtended` swapped out the `rel_to_all` field for the new `invested_capital` field ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/crates/brk_computer/src/distribution/metrics/relative/mod.rs))
- Renamed `AddrTypeToExposedAddrSupply` to `AddrTypeToExposedSupply`, with matching parameter name changes (`exposed_addr_supply` → `exposed_supply`) in the block-cohort received / sent compute paths ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/crates/brk_computer/src/distribution/addr/exposed/supply/mod.rs))
- `Cohorts::compute_rest_part2` (and the matching impls in `cohorts/addr/groups.rs`, `cohorts/addr/vecs.rs`, `cohorts/traits.rs`, `cohorts/utxo/groups.rs`) now takes `all_supply_sats: &impl ReadableVec<Height, Sats>` next to the existing `all_utxo_count`, dropping the per-call `HM: ReadableVec + Sync` generic in favor of an `impl Trait` parameter ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/crates/brk_computer/src/distribution/cohorts/traits.rs))

### New Features

#### `brk_mempool`

- `BlockStats.total_size` and `Entry.size` track the actual serialized byte size (witness + non-witness, from the raw tx hex) alongside vsize, so projected-block JSON now reports both the byte size and vsize ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/crates/brk_mempool/src/projected_blocks/stats.rs))
- `Sync::fetch_new_txs` was rewritten as a builder pipeline. The new `build_transaction(entry, mempool_txs)` reads raw hex once via `get_mempool_raw_tx`, scans all inputs to collect the unique set of non-mempool parent txids, fetches each parent exactly once via `get_raw_transaction` (no per-input `get_tx_out` round-trip), and uses the cached prev-outputs to assemble `TxIn` / `TxOut` directly. Sigops are precomputed via `bitcoin::Transaction::total_sigop_cost` for the new `Entry.size` field ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/crates/brk_mempool/src/sync.rs))
- Added `impl From<TxIndex> for u64` so callers reading mempool indices in bulk no longer need the `as_usize() as u64` two-step ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/crates/brk_mempool/src/types/tx_index.rs))

#### `brk_computer`

- Added `AvgAmountMetrics` (`avg_utxo_amount` = supply / utxo count, `avg_addr_amount` = supply / funded addr count) computed per `all` + per address type. Each pair carries sats and cents/usd lazy slots, mirroring the `AmountPerBlock` shape. Wired into `distribution::vecs::Vecs.addrs.avg_amount` via the new `WithAddrTypes<AvgAmountMetrics>` impl ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/crates/brk_computer/src/distribution/metrics/supply/avg_amount.rs))
- Added `ExposedSupplyShareVecs` (`exposed_supply_share` series, BasisPoints16), exposing the share of exposed (revealed-pubkey, quantum-risk) supply relative to total supply for `all` + per address type. Lives under `addrs.exposed.supply_share` and is computed against the `all` UTXO-cohort supply and the per-type UTXO-cohort supply, respectively ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/crates/brk_computer/src/distribution/addr/exposed/supply/share.rs))
- Added `RelativeInvestedCapital`: `invested_capital_in_profit_share` and `invested_capital_in_loss_share` (= invested-capital / own realized cap, in BasisPoints16). Computed for cohorts that already track `UnrealizedFull` (`all`, `sth`, `lth`) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/crates/brk_computer/src/distribution/metrics/relative/invested_capital.rs))
- Added `SatsSignedToBitcoin` UnaryTransform so a signed-sats delta vec can be lazily projected to a btc-typed view, completing the `Sats` / `SatsSigned` / `Bitcoin` triangle ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/crates/brk_computer/src/internal/transform/currency.rs))
- Added `RatioCentsBp16` BinaryTransform (Cents/Cents → BasisPoints16), used by `RelativeInvestedCapital` and `ExposedSupplyShareVecs` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/crates/brk_computer/src/internal/transform/ratio.rs))

#### `brk_types`

- `Sats` division was rewritten to use `checked_div`: `Sats / Dollars` returns `Sats::MAX` on a zero denominator, `Sats / Sats` and `Sats / usize` return `0`, and the new `Div<StoredU64> for Sats` impl lets cents-precision vecs divide by stored u64 lookups without manual casts ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/crates/brk_types/src/sats.rs))
- `OutputType` adds `#![allow(unreachable_patterns)]` with a reason explaining that `P2PK65` and `P2PK33` both serialize as `'p2pk'`, silencing the new lint without changing semantics ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/crates/brk_types/src/output_type.rs))

#### `brk_query`

- `block_info`'s `avg_fee` now uses `total_fees_u64.checked_div(non_coinbase).unwrap_or(0)` instead of an explicit `non_coinbase > 0` branch, so an all-coinbase block returns 0 rather than relying on the inner guard ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/crates/brk_query/src/impl/block/info.rs))
- `block_window`'s `avg_value` switched to `checked_div(block_count)` and skips the result when the divisor is zero, so partial windows at the chain tip don't push a divide-by-zero result ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/crates/brk_query/src/impl/mining/block_window.rs))
- The pool ranking and the bindgen pattern detector both switched from `sort_by(|a, b| b.cmp(&a))` to `sort_by_key(|x| Reverse(...))` — fewer lines, stable, and explicit about descending order ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/crates/brk_query/src/impl/mining/pools.rs))

#### `brk_server`

- Added `state.date_cache(version, date) -> CacheStrategy` — returns `Immutable(version)` when `date < Date::from(indexed_tip_timestamp)`, otherwise `Tip`. Cost-basis per-date responses use this so a historical date's response is `must-revalidate, max-age=1` until the tip crosses the day boundary, then becomes long-lived immutable ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/crates/brk_server/src/state.rs))
- Added deprecated `/api/metrics/cost-basis`, `/api/metrics/cost-basis/{cohort}/dates`, and `/api/metrics/cost-basis/{cohort}/{date}` routes that delegate to the same handlers but mark the operation `.deprecated()` and document a `Sunset date: 2027-01-01`. Cost-basis routes have moved to `/api/series/cost-basis/*` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/crates/brk_server/src/api/metrics/mod.rs))

#### `website`

- New `scripts/explorer/cube.js` — a pure-CSS HTML cube generator. Populates a `.cube` element with 15 face divs (3 glass-rear, 3 liquid-rear, 3 liquid-front, 3 glass-front, 3 face-text) styled via `explorer.css` transforms. Replaces the earlier SVG-based renderer that broke in Safari due to its long-standing `<foreignObject>` transform bugs ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/website/scripts/explorer/cube.js))
- Cube DOM nodes are now `HTMLAnchorElement` (`<a>`) instead of `<div>`, so deep-link navigation works without JavaScript-only handlers. `chain.js` updates `findCube`, `selectCube`, scroll detection, and the IntersectionObserver to operate on anchors ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/website/scripts/explorer/chain.js))
- Added `scripts/options/shared.js::exposedSubtree(exposed, key, title)` — a reusable builder for the Compare / Funded / Total / Supply / Share layout shared between Network and Distribution per-type cohort views ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/website/scripts/options/shared.js))
- `options/distribution/holdings.js` rewritten to drive the new `share` / `dominance` naming and to split the old combined "Profitability" chart into separate "Amount" (total + halved + in-profit + in-loss sats/btc/usd) and "Composition" charts ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/website/scripts/options/distribution/holdings.js))
- Added `website/assets/logo/demo.html` and `demo-svg.html` plus a local `.gitignore`, used to iterate on cube-style logo variants ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/website/assets/logo/demo.html))

### Internal Changes

#### `workspace`

- Bumped the pinned Rust toolchain to `1.95.0` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/rust-toolchain.toml))
- Bumped `mimalloc` to 0.1.50 and `libmimalloc-sys` to 0.1.47 in `brk_alloc` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/crates/brk_alloc/Cargo.toml))

#### `brk_computer`

- `internal/with_addr_types.rs` gained `WithAddrTypes<AvgAmountMetrics>::forced_import` (plus `collect_vecs_mut`, `par_iter_height_mut`, `reset_height`) and `WithAddrTypes<PercentPerBlock<B>>::forced_import` so the new metrics plug into the existing `WithAddrTypes` machinery ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/crates/brk_computer/src/internal/with_addr_types.rs))
- `block/cohort/addr_updates.rs` collapses the funded / empty `let mut next_index = len(); for ... { next_index += 1; }` loops into `(start..).zip(pushes_iter)`, keeping the index assignment and the push in one expression ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/crates/brk_computer/src/distribution/block/cohort/addr_updates.rs))
- `utxo/percentiles.rs` parallelised the per-cohort `write_distribution` calls via `par_iter()` for the sub-buckets, and merged the `all` / `sth` / `lth` writes into a single `into_par_iter().try_for_each` pass ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/crates/brk_computer/src/distribution/cohorts/utxo/percentiles.rs))

#### `brk_bindgen`

- Generated JS tree client constructor calls `_buildTree()` (no `basePath` argument). Path tracking now lives entirely on the generator side, so the runtime builder is one fewer parameter ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.3/crates/brk_bindgen/src/generators/javascript/tree.rs))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.3.0-beta.2...v0.3.0-beta.3)

## [v0.3.0-beta.2](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.3.0-beta.2) - 2026-04-15

### Breaking Changes

#### `brk_types`
- `BlockInfoV1` gained a `stale: bool` field (defaults to `false`, serialised alongside `info` and `extras`) that marks blocks which have been replaced by a longer chain after a reorg ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.2/crates/brk_types/src/block_info_v1.rs))
- Rewrote `Etag::from_series`: the signature changed from `(version, total, start, end, height)` to `(version, total, end, hash_prefix: BlockHashPrefix)`. Slices that reach the end of the series now produce `v{version}-{hash_prefix:x}` (tied to the current tip's reorg state), and bounded slices produce `v{version}-{total}` (stable until the series grows). The old `{start}-{end}` and `{start}-{total}-{height}` forms are gone ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.2/crates/brk_types/src/etag.rs))

#### `brk_iterator`
- `BlockIterator::Item` changed from `Block` to `Result<Block>`. The `State::Rpc` arm now propagates `get_block_hash` / `get_block` errors as `Some(Err(e))` instead of ending iteration via `.ok()?`, and mid-iteration reorg detection returns `Some(Err(Error::Internal("rpc iterator: chain continuity broken (likely reorg mid-iteration)")))` so callers see the failure instead of a silent `None`. The `State::Reader` arm propagates `Result<ReadBlock>` from the new reader pipeline ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.2/crates/brk_iterator/src/iterator.rs))

#### `brk_computer`
- Removed the `scripts` top-level module entirely (`scripts::Vecs`, `scripts::{count, compute, import, mod}`). The remaining `outputs_value` logic moved to `outputs/value/vecs.rs` and the lib.rs wiring no longer mentions scripts. Downstream consumers referencing `computer.scripts.*` must switch to the corresponding `outputs.*` paths ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.2/crates/brk_computer/src/lib.rs))
- `blocks::lookback::Vecs::cached_window_starts` is no longer a public struct field. It is now a method `cached_window_starts() -> Windows<&WindowStartVec>`, and every downstream importer (inputs/outputs/mining/transactions/cointime/distribution) that used to pass `&blocks.lookback.cached_window_starts` now passes `&cached_starts` as a `Windows<&WindowStartVec>`. The companion `CachedWindowStarts` alias was replaced by the more explicit `Windows<&WindowStartVec>` type ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.2/crates/brk_computer/src/blocks/lookback.rs))
- Removed `prices::Vecs::cached_spot_cents` and `cached_spot_usd` fields. The hot-path spot-price cache now lives on the `price_cents` `CachedPerBlock` itself, so every compute caller that referenced `prices.cached_spot_cents` / `prices.cached_spot_usd` in beta.1 has been migrated to use the cached fields on `price_cents.height` / `price_usd.height` directly ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.2/crates/brk_computer/src/prices/mod.rs))

### New Features

#### `brk_reader`
- Rewrote the blk-file streaming pipeline as a dedicated `pipeline` module. New files: `pipeline/mod.rs` exposing `DEFAULT_PARSER_THREADS` and `spawn(inner, canonical, parser_threads)`, `pipeline/forward.rs` driving the forward blk scanner, `pipeline/reorder.rs` handling out-of-order writes by bitcoind (up to `OUT_OF_ORDER_FILE_BACKOFF = 21` files), and `pipeline/tail.rs` streaming blocks that bitcoind appends live while the pipeline is running ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.2/crates/brk_reader/src/pipeline/mod.rs))
- Added `canonical.rs` with a `CanonicalRange::walk(client, after_hash, tip)` helper that resolves the canonical chain hash list for the streaming pipeline, and `bisect.rs` with `first_block_height(client, blk_path, xor_bytes)` that binary-searches a blk file for the first canonical block height. Replaces the previous inline `find_start_blk_index` logic ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.2/crates/brk_reader/src/canonical.rs))
- Added `parse.rs` as the single parsing entry point, replacing `decode.rs` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.2/crates/brk_reader/src/parse.rs))
- Split `Reader::new` into `new` (raises NOFILE via `Self::raise_fd_limit()` then delegates) and `new_without_rlimit(blocks_dir, client)`, so CI and embedded consumers can opt out of the `setrlimit` call. `raise_fd_limit` is public, clamps to the hard limit, and warns (not panics) on failure — a `TARGET_NOFILE = 15_000` constant replaces the ad-hoc `max(15_000)` call ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.2/crates/brk_reader/src/lib.rs))
- Added `Reader::all()`, `Reader::after(hash)`, and a new configurable `Reader::after_with(hash, parser_threads)` that return a `Receiver<Result<ReadBlock>>` streaming canonical blocks from `hash + 1` (or genesis) to the tip. The old `read(start, end)` / `read_rev` API is gone ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.2/crates/brk_reader/src/lib.rs))
- `ReaderInner::open_blk(blk_index)` is the new single entry point for opening blk file handles. `read_raw_bytes` switched to `FileExt::read_exact_at` (positional pread) and `reader_at` uses the new `XORIndex::at_offset(offset)` constructor ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.2/crates/brk_reader/src/xor_index.rs))
- Added reader benchmark examples under `examples/`: `after_bench.rs` (measures full-chain streaming throughput), `last_n_bench.rs` (measures the tail-fetch path), `reader.rs`, `reader_single.rs`, and `blk_heights.rs` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.2/crates/brk_reader/examples/after_bench.rs))

#### `brk_error`
- Added an `OptionData<T>` extension trait with a single `data(self) -> Result<T>` method that converts `None` into `Error::Internal("data unavailable")`. The doc comment explicitly notes it replaces `.unwrap()` in query paths so a missing value returns HTTP 500 instead of crashing the server under `panic = "abort"` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.2/crates/brk_error/src/lib.rs))

#### `brk_computer`
- Added `internal::block_walker::walk_blocks(fi_batch, txid_len, coinbase, scan_tx, store)` with a `BlockAggregate` aggregate (totals plus `[u64; 12]` per-output-type entries/txs counters) and a `CoinbasePolicy::{Include, Skip}` control. Used by `inputs::by_type` and `outputs::by_type` to share a single per-block / per-type cursor walker, eliminating ~100 lines of duplicated loops ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.2/crates/brk_computer/src/internal/block_walker.rs))
- Added `internal::with_addr_types::WithAddrTypes<T>` — a generic `all + per-AddrType` container that mirrors the existing `WithSth` pattern along the address-type axis. It exposes `forced_import`, `min_stateful_len`, `par_iter_height_mut`, `reset_height`, `push_height(total, per_type)`, and `compute_rest(starting_indexes, exit)` which writes `all.height` as the per-block sum of the per-type vecs. Specialised `forced_import` impls exist for `PerBlock`, `PerBlockCumulativeRolling`, and similar families so every metric that tracks one aggregate alongside a per-address-type breakdown can use the same container ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.2/crates/brk_computer/src/internal/with_addr_types.rs))
- Added a `CachedPerBlock` wrapper type in `internal::per_block::computed::cached`, used by `prices::Vecs::price_cents`. The wrapper carries an in-memory `CachedVec` over the on-disk `PerBlock` so every compute caller that previously reached for the separate `cached_spot_cents` field now reads through `price_cents.height` directly ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.2/crates/brk_computer/src/internal/per_block/computed/cached.rs))
- Added `PercentCumulativeRolling<B, M>` and `LazyPercentCumulativeRolling<B, S1T>` under `internal::per_block::percent`, covering the new "cumulative + rolling window" percent metric shape used by several distribution modules ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.2/crates/brk_computer/src/internal/per_block/percent/cumulative_rolling.rs))
- `blocks::lookback::Vecs` now wraps the `_24h`, `_1w`, `_1m`, and `_1y` lookback vecs in `CachedVec<M::Stored<...>>` so the most frequently read lookback windows serve from an in-memory cache instead of re-reading from disk every block ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.2/crates/brk_computer/src/blocks/lookback.rs))
- `internal::cache_budget::cache_wrap` is now generic over `V: TypedVec + ReadableVec<V::I, V::T> + Clone + 'static`, matching the `CachedVec<V>` wrapper migration in vecdb. Callers pass any cacheable source vec directly and get a `CachedVec<V>` back ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.2/crates/brk_computer/src/internal/cache_budget.rs))

#### `brk_cohort`
- `ByType::try_new(create)` constructor builds both the spendable and unspendable parts from a single `FnMut(Filter, &'static str) -> Result<T, E>`, and the unspendable half now reuses the shared `OP_RETURN: &'static str` constant with `Filter::Type(OutputType::OpReturn)` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.2/crates/brk_cohort/src/by_type.rs))
- Added `ByType::iter`, `iter_mut`, `par_iter_mut`, `iter_typed`, and `iter_typed_mut` helpers so downstream metric modules can iterate all 12 output-type slots (11 spendable + op_return) without unpacking the struct manually. The existing `SpendableType` also grew matching methods ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.2/crates/brk_cohort/src/spendable_type.rs))

#### `brk_query`
- Added `rustc-hash` dependency and new `indexed_height()` accessor that reads `blockhash.inner.stamp()` directly instead of computing `len - 1`, giving the server a stable, bounded way to pick the canonical tip height for cache strategies ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.2/crates/brk_query/src/lib.rs))
- Rewrote `tx.rs`, `block/txs.rs`, `block/info.rs`, `addr.rs`, and `mining/pools.rs` to thread `Result`s through every lookup path using the new `OptionData::data()` method and the refreshed `CachedVec<V>` reader API. Null-safety audits that previously `unwrap()`'d through chained cursor reads now return `Error::Internal("data unavailable")` so the HTTP layer answers 500 instead of aborting the process ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.2/crates/brk_query/src/impl/tx.rs))

#### `brk_server`
- Added `params::tx_index_param::TxIndexParam`, documented in the params module tree, so new endpoints can take a `TxIndex` path segment with schema-driven validation ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.2/crates/brk_server/src/params/tx_index_param.rs))

#### `brk_bindgen` / generated clients
- Extracted a shared `BrkClientBase._getCached(path, parse, options)` method that runs the cache-vs-network race, invokes `onUpdate` when either branch resolves, and writes fresh responses back to the `caches` storage. Both `getJson(path, options)` and `getText(path, options)` now delegate to it with their own `parse` function (`res.json()` + `_addCamelGetters` for JSON, `res.text()` for text), giving CSV/text fetches the same caching, ETag short-circuit, and `onUpdate` semantics that JSON fetches already had. `getText` also gains `AbortSignal` and `onUpdate` option support ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.2/crates/brk_bindgen/src/generators/javascript/client.rs))
- Each generated `fetchCsv()` endpoint method now passes the same `{ signal, onUpdate }` options bag through `getText`, so `brkClient.series.*.fetchCsv({ signal, onUpdate })` benefits from browser-cache reuse and cancellation ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.2/crates/brk_bindgen/src/generators/javascript/api.rs))

#### `scripts`
- Added a new `scripts/mempool_compat/` pytest project (managed with `uv`) that compares every brk mempool_space endpoint against the real mempool.space API using live blockchain data. It ships `conftest.py` + seven test modules covering addresses, blocks, fees, general, mempool, mining, and transactions, with its own `pyproject.toml` and lockfile. Nothing is hardcoded or deterministic — the tests pull live data on each run ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.2/scripts/mempool_compat/conftest.py))

#### `website`
- Rewrote `options/mining.js`, `options/network.js`, `options/market.js`, `options/cointime.js`, `options/partial.js`, `options/full.js`, and the distribution sub-modules to match the new backend series layout (new per-addr-type cohorts, percent cumulative-rolling metrics, etc.). Added `options/series.js` and `options/shared.js` for shared builders ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.2/website/scripts/options/mining.js))
- Added a new `website/CLAUDE.md` with frontend-specific contribution notes, paired with a top-level `CLAUDE.md` update ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.2/website/CLAUDE.md))
- Assorted explorer fixes in `chain.js`, `index.js`, and search (`panes/search.js`) plus format/utils updates, accompanying the main/nav/explorer CSS polish ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.2/website/scripts/explorer/chain.js))

### Internal Changes

#### `brk_indexer`
- `processor/{mod,tx,metadata}.rs` and `vecs/{blocks,transactions}.rs` updated to match the reader pipeline and `CachedVec<V>` wrapper migration in vecdb — no user-visible behavior change ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.2/crates/brk_indexer/src/processor/mod.rs))

#### `brk_rpc`
- `backend/{bitcoincore,corepc}.rs` refreshed for the new iterator error-propagation shape ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.2/crates/brk_rpc/src/backend/bitcoincore.rs))

#### `brk_oracle`
- Refreshed examples (`compare_digits`, `determinism`, `noise`, `report`, `sweep_digits`, `sweep_tolerance`, `validate`) to compile against the new query result types ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.2/crates/brk_oracle/examples/validate.rs))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.3.0-beta.1...v0.3.0-beta.2)

## [v0.3.0-beta.1](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.3.0-beta.1) - 2026-04-08

### New Features

#### `website`
- Replaced the pinned/unpinned sidebar model with a split/full layout mode. The preference is stored under the new `split-view` localStorage key (replacing `sidebar-pinned`), and `data-layout` now holds `"split"` or `"full"` instead of `"desktop"`/`"mobile"`. A new inline script in `index.html` reads the preference synchronously before modules load and sets `data-layout` to avoid a flash of unstyled layout ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.1/website/scripts/main.js))
- Added a layout-toggle button (`#layout-button`, replacing `#pin-button`) that flips between split and full layouts on any device. `syncFrame()` now calls the relevant selector label when the layout changes, so the visible frame follows the mode switch automatically ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.1/website/index.html))
- Rewrote the desktop resize bar as `initResizeBar()` using pointer events (`pointerdown`/`pointermove`/`pointerup`/`pointercancel` with `setPointerCapture`), clamping the width to `--max-main-width * innerWidth`, persisting the value under `bar-width`, and resetting on double-click. Replaces the old `initDesktopResizeBar` which used three separate mouse listeners ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.1/website/scripts/main.js))
- Moved `<aside>` and `<footer>` out of `<main>` in `index.html`, and moved `#resize-bar` between the main and aside elements so the flex row directly resizes only the main column ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.1/website/index.html))
- Refactored the explorer address pane: `initAddrDetails(parent, linkHandler)` now creates the heading, row stubs, and transactions section once, and `update(address, signal)` only writes the row values and mounts transaction rows. A `currentAddr` guard aborts late-arriving txs pages from a previous address, and the labels array (`Address`, `Confirmed Balance`, …, `Avg Cost Basis`) is shared between the DOM rows and the update path ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.1/website/scripts/explorer/address.js))
- Refactored `explorer/tx.js` to follow the same init/update/show/hide/clear shape as block.js and address.js (`initTxDetails(parent, linkHandler)`, `update(tx)`, `clear()`, `show()`, `hide()`) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.1/website/scripts/explorer/tx.js))
- Added `deselectCube()` to the chain module and a `silent` option on `selectCube` that skips the `onSelect` firing. `loadInitial` now returns the top block hash so the router can target the correct cube, and `getBlock(hash)` is a new lookup helper ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.1/website/scripts/explorer/chain.js))
- Simplified the explorer router in `index.js`: `load()` reads the path segments, calls `loadInitial(height)`, and dispatches to `showPanel("block" | "tx" | "addr")`. A single `showPanel` helper hides the other two panels in one pass, replacing the scattered `showBlockPanel` / `showSecondaryPanel` calls and the `pendingTx` mutable state ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.1/website/scripts/explorer/index.js))
- Added `showPanel` / `hidePanel` helpers in `explorer/render.js` (set `hidden = false`, scroll to top) and routed `block.js`, `tx.js`, and `address.js` `show()` / `hide()` through them for consistent behaviour ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.1/website/scripts/explorer/render.js))
- `utils/url.js` gained a `buildUrl(pathname, urlParams)` helper that composes the pathname and query string in one place; `pushHistory` now uses it instead of building the URL inline ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.1/website/scripts/utils/url.js))
- Replaced inline `style.opacity = "0.5"` hacks in `chain.js` and `block.js` with a shared `.dim` CSS class so the dimmed appearance is consistent across the explorer ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.1/website/scripts/explorer/block.js))

### Bug Fixes

#### `brk_types`
- Fixed schemars example annotations on numeric newtypes using a by-reference form so serde-json serialises them correctly: `Dollars`, `FeeRate`, `RawLockTime`, `Sats`, `Timestamp`, `TxVersionRaw`, `Vin`, `Vout`, `VSize`, and `Weight` now all use `example = &literal` (rather than bare `literal`), which resolves the recent OpenAPI spec regression where these fields either lost their examples or rendered as the wrong JSON type ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.1/crates/brk_types/src/dollars.rs))

### Internal Changes

#### `website`
- Deleted the orphan `website/styles/panes/sim.css` (75 lines) and `website/styles/panes/table.css` (139 lines), which were no longer referenced after the explorer rewrite ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.1/website/styles/main.css))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.3.0-beta.0...v0.3.0-beta.1)

## [v0.3.0-beta.0](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.3.0-beta.0) - 2026-04-08

### Breaking Changes

#### `brk_types`
- `AddrChainStats` gained a required `realized_price: Dollars` field (average cost basis in USD), populated by the addr query. The struct no longer derives `Default` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.0/crates/brk_types/src/addr_chain_stats.rs))
- `AddrStats` gained a required `addr_type: OutputType` field so the `/api/address/{addr}` response reports the address script type (p2pkh, p2sh, v0_p2wpkh, …) alongside the existing chain and mempool stats ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.0/crates/brk_types/src/addr_stats.rs))

### New Features

#### `brk_types`
- Added `#[schemars(example = …)]` annotations to dozens of numeric fields across `BlockInfo`, `BlockExtras`, `BlockStatus`, `BlockTimestamp`, `BlockPool`, `TxVersionRaw`, `DifficultyEntry`, `DifficultyAdjustmentEntry`, `FeeRatePercentiles`, `HashrateEntry`, `HashrateSummary`, `HistoricalPrice`, `MempoolInfo`, `MerkleProof`, `PoolDetailInfo`, `PoolHashrateEntry`, `PoolInfo`, `PoolStats`, `PoolsSummary`, `RawLockTime`, `Sats`, `Timestamp`, `TxIndex`, `TxOutspend`, `Vin`, `Vout`, `VSize`, `Weight`, `Dollars`, `FeeRate`, and others, so the generated OpenAPI schema and type docs now carry realistic example values for every field ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.0/crates/brk_types/src/block_info.rs))
- `AddrValidation` now includes a boolean schemars example, and `HistoricalPrice`, `PoolSlug`, and other types grew richer doc comments ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.0/crates/brk_types/src/addr_validation.rs))

#### `brk_server`
- Added `CacheParams::tip(prefix)`, `block_bound(version, prefix)`, `mempool_hash(hash)`, and consolidated `static_version()` constructors. `CacheParams::resolve` now delegates to these constructors, and `cache_control` is stored as `&'static str`, with a shared `CACHE_CONTROL = "public, max-age=1, must-revalidate"` constant reused by every strategy ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.0/crates/brk_server/src/cache.rs))
- Added `/// doc comments` on every path parameter under `brk_server::params/*`: `AddrParam`, `BlockCountParam`, `BlockHashParam`, `BlockHashStartIndexParam`, `BlockHashTxIndexParam`, `HeightParam`, `PoolSlugParam`, `TimePeriodParam`, `TimestampParam`, `TxidParam`, so the OpenAPI/Scalar docs render descriptions for every route parameter ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.0/crates/brk_server/src/params/addr_param.rs))
- Added `TransformOperationExtended::binary_response()` and `not_modified()` helpers, and wired `.not_modified()` into the series endpoints (`/api/series/{name}/{index}/last`, `/length`, `/version`, plus the cost-basis cohorts/dates/histogram routes) so 304 responses are documented in the OpenAPI spec ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.0/crates/brk_server/src/extended/transform_operation.rs))
- `CACHE_CONTROL` moved from `api/series/mod.rs` into `cache::CACHE_CONTROL` and is re-used by both the series endpoints and every cache strategy, removing a duplicate constant ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.0/crates/brk_server/src/api/series/mod.rs))
- `AppState::cached_*` now computes the tip prefix once per request and reuses it for both the cache-key generation and the tip-change invalidation check (instead of resolving it twice), shaving a sync round-trip on each cached response ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.0/crates/brk_server/src/state.rs))

#### `brk_query`
- `Query::addr_stats` now populates `realized_price` from the address data's realized price (dollars) for funded addresses and `Dollars::default()` for empty ones, and sets `addr_type` from the decoded `OutputType`, backing the new `AddrChainStats`/`AddrStats` fields ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.0/crates/brk_query/src/impl/addr.rs))
- Rewrote `addr_txindices` to avoid the old "prefix scan then filter" pattern when paginating by `after_txid`: the new code computes `AddrIndexTxIndex::min_for_addr(type_index)` and the bound from `(type_index, after_tx_index)` and uses `store.range(min..bound).rev().take(limit)` for an O(limit) lookup. The no-pagination branch keeps the `prefix().rev().take(limit)` fast path ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.0/crates/brk_query/src/impl/addr.rs))
- Reworked `addr_utxos` to reuse block-hash / block-time per `height` via a `cached_block: Option<(Height, BlockHash, Timestamp)>` guard, so a batch of UTXOs in the same block only issues one blockhash read and one timestamp cursor advance ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.0/crates/brk_query/src/impl/addr.rs))
- Replaced the per-row `transactions_by_range(start, count)` bulk reader with a `transactions_by_indices(&[TxIndex])` helper used by `addr_txs`, `block_txs`, and `transaction_by_index`. The helper does batched range reads (txids/heights/locktimes/total_sizes/first_txin_indices/positions) and re-uses a `cached_block: Option<(Height, BlockHash, Timestamp)>` so a batch of txs in the same block only issues one blockhash + one timestamp lookup ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.0/crates/brk_query/src/impl/block/txs.rs))
- `Query::transaction_raw` now short-circuits on mempool txs: if the mempool has the txid, it returns the stored hex directly instead of falling through to the on-chain lookup ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.0/crates/brk_query/src/impl/tx.rs))
- `Query::outspend(txid, vout)` no longer calls `outspends` (which materialised every output). Two new private helpers are extracted in `tx.rs`: `resolve_tx_outputs(txid) -> (TxIndex, TxOutIndex, usize)` resolves the tx's first `TxOutIndex` and output count, and `resolve_outspend(txout_index: TxOutIndex) -> Result<TxOutspend>` looks up a single outspend. `outspend` bounds-checks `vout` against the count and calls `resolve_outspend(first_txout + vout)` for O(1) work; mempool txs return `TxOutspend::UNSPENT` immediately without a store lookup ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.0/crates/brk_query/src/impl/tx.rs))
- `Query::block_by_timestamp` and the mining `epochs`/`hashrate`/`pools` loops now advance dedicated cursors (`ts_cursor`, `height_cursor`, `difficulty_cursor`, `hr_cursor`) instead of calling `collect_one_at` per iteration, reducing the per-element overhead of repeated random reads ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.0/crates/brk_query/src/impl/block/timestamp.rs))
- `block_info` now fetches the block header and coinbase scriptsig in a single `reader.reader_at(position)` streamed pass instead of issuing separate `read_raw_bytes` calls for the header and coinbase — one seek per block, no intermediate 1000-byte buffer. A new `parse_coinbase_from_read` reads the rest of the coinbase transaction straight off the same reader ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.0/crates/brk_query/src/impl/block/info.rs))
- `Query::cpfp_info` returns an empty `CpfpInfo::default()` when the tx is absent from the mempool (removing an `Error::NotFound` branch) and removes an unused `pool_blocks` allocation from the mining pools path ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.0/crates/brk_query/src/impl/mempool.rs))

#### `brk_reader`
- Added `rlimit = "0.11.0"` and raised the process's `NOFILE` soft limit to at least 15000 on `ReaderInner::new` so concurrent blk file access doesn't hit the OS FD cap ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.0/crates/brk_reader/Cargo.toml))
- `ReaderInner` now holds a `blk_file_cache: RwLock<BTreeMap<u16, File>>` and an `ensure_blk_cached` helper that opens each blk file once and reuses the handle, replacing the old `File::open` + seek on every `read_raw_bytes` call. `read_raw_bytes` switched to `FileExt::read_at` (positional pread) so concurrent readers no longer contend on a shared seek cursor ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.0/crates/brk_reader/src/lib.rs))
- Added `Reader::reader_at(position) -> Result<BlkRead<'_>>`, a streaming `Read` impl that seeks once and XOR-decodes bytes on the fly as callers pull from it, avoiding the upfront buffer allocation for variable-length reads like full coinbase transactions ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.0/crates/brk_reader/src/lib.rs))
- Added `XORIndex::decode_at(buffer, offset, xor_bytes)` — a static helper equivalent to the old `Self::default(); add_assign(offset); bytes(buffer, xor_bytes)` sequence, now used by `read_raw_bytes` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.0/crates/brk_reader/src/xor_index.rs))

#### `brk_indexer`
- Dropped the `rlimit` dependency and the corresponding `Resource::NOFILE` bump in `forced_import_inner`, since the limit raise now lives in `brk_reader::ReaderInner::new` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.0/crates/brk_indexer/src/lib.rs))

#### `brk_mempool`
- `EntryPool` now maintains a `parent_to_children: FxHashMap<TxidPrefix, SmallVec<[TxidPrefix; 2]>>` adjacency map and exposes a `children(&prefix) -> &[TxidPrefix]` accessor. `insert` pushes the new tx onto each parent's child list, and `remove` walks `entry.depends` to unlink itself from each parent and drop empty entries, enabling O(1) descendant lookup for CPFP computations instead of a full entries scan ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.0/crates/brk_mempool/src/entry_pool.rs))

#### `brk_store`
- Added `Store::range(range: Range<B>)` returning a `DoubleEndedIterator<(K, V)>` by deserialising the keyspace's raw byte range. This is the primitive used by the new `addr_txindices` paginated scan ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.0/crates/brk_store/src/lib.rs))

#### `brk_bindgen` / generated clients
- Generated JavaScript client methods now accept an `options` bag with `signal?: AbortSignal` and `onUpdate?: (value) => void`. `getJson`, `getText`, and `get` all thread the `AbortSignal` into `fetch` (combined with the timeout signal via `AbortSignal.any(...)`), and `onUpdate` is invoked when either the cache or network branch resolves first, enabling stale-while-revalidate rendering in the frontend ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.0/crates/brk_bindgen/src/generators/javascript/client.rs))
- Each generated API method signature changed from `method(...params)` to `method(...params, { signal, onUpdate } = {})`, with the same forwarding for both JSON and CSV series endpoints ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.0/crates/brk_bindgen/src/generators/javascript/api.rs))

#### `website`
- Rewrote the explorer from the single `panes/explorer.js` (deleted, 401 lines) into a modular `website/scripts/explorer/` package with `index.js` (lifecycle + routing), `chain.js` (block list with dual sentinels and deep-linking), `block.js`, `tx.js`, `address.js` (new entity views), and `render.js` (shared row/table rendering). The module supports `/block/{height_or_hash}`, `/tx/{txid}`, and `/address/{addr}` URLs ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.0/website/scripts/explorer/index.js))
- Moved `website/scripts/chart/` into `website/scripts/utils/chart/` and moved `options/utils.js` to `utils/time.js`. Removed the standalone `website/scripts/chart/oklch.js` (107 lines) — its color utilities were merged into `website/scripts/utils/colors.js` which grew by ~125 lines ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.0/website/scripts/utils/colors.js))
- Deleted `website/scripts/panes/_table.js` (433 lines, unused after the explorer rewrite) and added `website/scripts/utils/cache.js` with ~30 lines of shared cache helpers used by the new explorer modules ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.0/website/scripts/utils/cache.js))
- Expanded `options/mining.js` (+150 lines) and rewrote `options/network.js` to match the new hashrate/pool series layout; extended `options/types.js` with the additional pattern types the rewritten options reference ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.0/website/scripts/options/mining.js))

### Bug Fixes

#### `brk_server`
- `ResponseExtended::new_not_modified` in the bulk/data/legacy series paths now sets the etag and cache-control headers on the 304 response instead of emitting a bare empty body, so conditional GETs see the same headers as the original 200 ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-beta.0/crates/brk_server/src/api/series/mod.rs))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.3.0-alpha.6...v0.3.0-beta.0)

## [v0.3.0-alpha.6](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.3.0-alpha.6) - 2026-04-05

### Breaking Changes

#### `brk_types`
- Renamed `Pool::unique_id()` to `Pool::mempool_unique_id()` (the 0-indexed value from `pools-v2.json`) and added a new `Pool::mempool_id()` helper that returns the 1-indexed value, matching mempool.space's `id` field. `PoolDetailInfo::id` and `PoolStats::pool_id` now serialize the 1-indexed `mempool_id()`, while the existing `unique_id`/`pool_unique_id` fields stay on the 0-indexed value ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.6/crates/brk_types/src/pool.rs))
- Reverted `BlockExtras::utxo_set_change` semantics: the field is once again computed as `total_outputs - total_inputs` (the signed delta including unspendable outputs like `OP_RETURN`), matching mempool.space and `bitcoin-cli`. The `utxo_set_size` doc comment now explicitly states it is the "total spendable UTXO set size" and intentionally differs from the change field ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.6/crates/brk_types/src/block_extras.rs))
- `TimePeriod` gained an `All` variant that parses and displays as `"all"` and maps to `usize::MAX` block count, allowing endpoints and lookups to select the entire chain history rather than a bounded window ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.6/crates/brk_types/src/time_period.rs))

### New Features

#### `brk_types`
- Added `Deserialize` derives to `BlockFeeRatesEntry` and `FeeRatePercentiles` (the types themselves existed before this release) so clients can round-trip the new `/api/v1/mining/blocks/fee-rates/{time_period}` response without manual deserialisation ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.6/crates/brk_types/src/feerate_percentiles.rs))
- Added `TxOutspend::is_deeply_spent(current_height)` which returns true when the output is spent and confirmed more than 6 blocks deep, used by the server to promote outspend responses to immutable caching ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.6/crates/brk_types/src/txout_spend.rs))
- Added a total-reward column to `PoolDetail` (the detail-view response, not the nested `PoolDetailInfo` metadata) as `total_reward: Option<Sats>`, reporting each pool's lifetime sats earned ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.6/crates/brk_types/src/pool_detail.rs))
- Relaxed `CpfpInfo::effective_fee_per_vsize`, `fee`, and `adjusted_vsize` to `Option<_>` and added `#[serde(skip_serializing_if = …)]` on `best_descendant`, `descendants`, `effective_fee_per_vsize`, `fee`, and `adjusted_vsize`. Empty fields now disappear from the JSON, but the field-type change is an API break for any client that was typing these as non-optional ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.6/crates/brk_types/src/cpfp.rs))

#### `brk_query`
- Implemented `Query::block_fee_rates(time_period)`: reads min/10/25/median/75/90/max from the effective fee-rate block distribution for the requested window, averages per sub-window using the same `BlockWindow` helper used by `block_fees`, and returns `Vec<BlockFeeRatesEntry>` (previously the endpoint returned `Error::not_implemented`) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.6/crates/brk_query/src/impl/mining/block_fee_rates.rs))
- Filled in `estimated_hashrate` on pool detail responses by multiplying the current-height day1 network hashrate by each pool's 24h share, removing the previous `TODO` zero placeholder ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.6/crates/brk_query/src/impl/mining/pools.rs))
- `block_window` and `pools` window lookups now handle `TimePeriod::All` by returning a `None` lookback (treated as 0, covering the full history) so every mining endpoint that takes a period accepts `all` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.6/crates/brk_query/src/impl/mining/block_window.rs))
- `Query::outspend` now returns `TxOutspend::UNSPENT` when the requested vout is out of range instead of `Error::OutOfRange`, matching mempool.space's behavior of reporting "unspent" for any unknown output ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.6/crates/brk_query/src/impl/tx.rs))
- `Query::cpfp_info` returns a default `CpfpInfo` when the transaction is not in the mempool instead of `Error::NotFound`, so confirmed-tx CPFP lookups respond with an empty object like mempool.space ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.6/crates/brk_query/src/impl/mempool.rs))
- Deduplicated `coinbase_addresses` in the block-info response so the list only contains each payout address once ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.6/crates/brk_query/src/impl/block/info.rs))

#### `brk_server`
- Added a tip-invalidating in-memory response cache: `AppState` now carries a `last_tip: Arc<AtomicU64>`, and every `cached_json` / `cached_text` call compares the freshly fetched tip prefix with the stored value. When the tip changes, `cache.clear()` is called before serving the response, so reorgs no longer leak stale `Tip`-strategy entries ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.6/crates/brk_server/src/state.rs))
- Added `CacheParams::immutable(version)` producing `etag=i{version}` with `cache-control: public, max-age=1, must-revalidate`, used by the new outspend immutability logic and the tx transactions module ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.6/crates/brk_server/src/cache.rs))
- Added `AppState::timestamp_cache(version, timestamp)` which returns `Immutable(version)` for timestamps older than 6 hours and `Tip` otherwise. Wired into `/api/v1/historical-price` and `/api/v1/mining/blocks/timestamp/{timestamp}` so historical queries stop being treated as tip-volatile ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.6/crates/brk_server/src/state.rs))
- `/api/tx/{txid}/outspend/{vout}` and `/api/tx/{txid}/outspends` now compute the outspend first, then pick `Immutable(v)` when every output is >6 blocks deep (or `Tip` otherwise), with a short-circuit `if immutable.matches_etag(headers)` check that avoids the query altogether on cache hits ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.6/crates/brk_server/src/api/mempool_space/transactions.rs))
- `addr_cache` gained a `chain_only: bool` flag. `/api/address/{addr}/txs/chain` passes `true` so it skips the mempool-activity check (confirmed-only responses do not depend on mempool state), while the other address endpoints pass `false` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.6/crates/brk_server/src/state.rs))
- `/api/v1/mining/pool/{slug}/blocks/{height}` now uses the existing `height_cache` helper to return immutable responses for deep historical heights instead of always `Tip` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.6/crates/brk_server/src/api/mempool_space/mining.rs))
- `/api/v1/mining/blocks/fee-rates/{time_period}` is no longer a stub: it routes through `cached_json` with a `Tip` strategy and advertises a `Vec<BlockFeeRatesEntry>` response in the OpenAPI spec (the old "work in progress" wording is gone) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.6/crates/brk_server/src/api/mempool_space/mining.rs))
- Added `ResponseExtended::static_bytes(headers, bytes, content_type, content_encoding)` helper and refactored `/scalar.js` to use it, giving pre-compressed static assets the same 304/etag short-circuit via `CacheParams::static_version()` that JSON responses already had (note: unlike JSON responses it sets `Content-Encoding` directly, so it does not emit `Vary: Accept-Encoding`) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.6/crates/brk_server/src/extended/response.rs))
- `HeaderMapExtended` gained an `insert_vary_accept_encoding()` helper and `insert_content_encoding` now calls it automatically, so every JSON/CSV response that goes through the helper (as opposed to a direct `h.insert(header::CONTENT_ENCODING, …)` call) sets `Vary: Accept-Encoding` and downstream caches can distinguish br/gzip/identity variants ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.6/crates/brk_server/src/extended/header_map.rs))
- `ResponseExtended::new_not_modified` now takes explicit `etag` and `cache_control` arguments (instead of building an empty response), and a new `new_not_modified_with(params)` convenience accepts a `CacheParams` to compute both. Series bulk/data/legacy endpoints and the static JSON path all go through these helpers ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.6/crates/brk_server/src/extended/response.rs))
- `POST /api/tx` broadcast_transaction now runs on the async `state.run` executor instead of the synchronous `state.sync`, avoiding blocking the tokio thread on upstream RPC latency ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.6/crates/brk_server/src/api/mempool_space/transactions.rs))

#### `website`
- Added 57 mining-pool SVG logos under `website/assets/pools/`, including light-theme variants for `default`, `unknown`, `foundryusa`, `ultimuspool`, and `whitepool`. Fetched via a new `website/assets/pools.sh` script that downloads the `mempool/mining-pool-logos` archive and prunes non-SVG files ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.6/website/assets/pools.sh))
- Rewrote the explorer infinite-scroll to use two sentinels: `olderSentinel` (bottom of the block list) and `newerSentinel` (top). A scroll listener with a 200px margin triggers `loadOlder`/`loadNewer` instead of `IntersectionObserver`, so scrolling up in the middle of the chain fetches newer blocks until the tip is reached. A `reachedTip` flag guards the `loadLatest` polling path ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.6/website/scripts/panes/explorer.js))
- Added deep-linking: `getStartHeight()` parses `/block/{height_or_hash}` from the URL, and the initial load uses `getBlocksV1FromHeight` when a start height is available. The selected block is then auto-scrolled into the centre of the viewport with `scrollIntoView({ block: "center" })` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.6/website/scripts/panes/explorer.js))

#### `scripts`
- Added `scripts/compare_bitcoin_cli.sh` to diff BRK's block/transaction responses against a local `bitcoin-cli` node, useful for validating mempool.space API compatibility ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.6/scripts/compare_bitcoin_cli.sh))

### Bug Fixes

#### `brk_types`
- Fixed the `TxIn` serializer leaking an empty `inner_redeem_script_asm` for P2SH inputs whose scriptsig happened to not decode: the `has_inner_redeem` field-count flag now keys off `is_p2sh && !is_coinbase` instead of `!inner_redeem.is_empty()`, ensuring the field is serialized for every real P2SH input and omitted for every non-P2SH input ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.6/crates/brk_types/src/txin.rs))

### Internal Changes

#### `brk_types`
- Added `crates/brk_types/pools.sh` with a `curl` that fetches `pools-v2.json` from `mempool/mining-pools`, giving the local pool metadata refresh a checked-in script ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.6/crates/brk_types/pools.sh))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.3.0-alpha.5...v0.3.0-alpha.6)

## [v0.3.0-alpha.5](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.3.0-alpha.5) - 2026-04-04

### Breaking Changes

#### `brk_types`
- Changed `Transaction::version` from the indexed `TxVersion` (u8) to a new `TxVersionRaw` (i32) type so that coinbase transactions which carry non-standard version numbers for miner signaling or branding are serialized as the actual protocol value instead of being remapped through the indexed table ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.5/crates/brk_types/src/tx.rs))
- Changed `OutputType` serde/strum representations for P2PK and multisig variants to match mempool.space's `scriptpubkey_type` values: both `P2PK65` and `P2PK33` now serialize as `p2pk`, and `P2MS` serializes as `multisig` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.5/crates/brk_types/src/output_type.rs))
- `TxOut` serialization now omits `scriptpubkey_address` for `P2PK65` and `P2PK33` outputs (P2PK has no standard address format), dropping the field entirely rather than emitting whatever `addr()` produced ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.5/crates/brk_types/src/txout.rs))

### New Features

#### `brk_types`
- Added `TxVersionRaw(i32)` wrapper with a `From<bitcoin::transaction::Version>` impl, exported from the crate root. Used by `Transaction` to expose the raw protocol version while the existing `TxVersion` (u8) remains available for indexed/aggregation use cases ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.5/crates/brk_types/src/tx_version_raw.rs))

### Bug Fixes

#### `brk_types`
- Fixed `TxIn` inner redeem-script detection: `inner_redeem_script_asm` now checks whether the previous output's `script_pubkey.is_p2sh()` instead of using the `has_scriptsig && has_witness` heuristic, so plain P2SH spends (no witness) also expose their redeem script and non-P2SH inputs that happen to have both a scriptsig and a witness no longer produce spurious redeem-script output ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.5/crates/brk_types/src/txin.rs))
- Fixed `TxIn::inner_witness_script_asm` for P2TR script-path spends: when `prevout.script_pubkey.is_p2tr()` and the witness has more than two items, the inner script is now read from the second-to-last witness item (the last item is the control block), not from the last item as was the case for P2WSH/P2SH-P2WSH ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.5/crates/brk_types/src/txin.rs))

#### `brk_query`
- Fixed `BlockExtras::utxo_set_change` reporting the signed output-minus-input delta instead of the real UTXO-set change. The query now reads `utxo_set_size` from one height before the range begin and computes `utxo_set_size - prev_utxo_set_size` per block, so the value matches the actual change in unspent outputs ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.5/crates/brk_query/src/impl/block/info.rs))
- Fixed `coinbase_signature` selection when the miner payout comes after a witness-commitment `OP_RETURN`: the search now picks the first non-`OP_RETURN` output (with a fallback to the first output) instead of "first output that decodes to a Bitcoin mainnet address", which misclassified some payout scripts ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.5/crates/brk_query/src/impl/block/info.rs))
- Block-transactions endpoint now derives `Transaction::version` directly from the decoded `bitcoin::Transaction` via `tx.version.into()` (`TxVersionRaw`) instead of looking up the indexed `tx_version` column, removing an unused bulk read and ensuring coinbase non-standard versions are preserved ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.5/crates/brk_query/src/impl/block/txs.rs))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.3.0-alpha.4...v0.3.0-alpha.5)

## [v0.3.0-alpha.4](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.3.0-alpha.4) - 2026-04-04

### Breaking Changes

#### `brk_types`
- Reordered `BlockInfo` fields so that `bits`, `nonce`, and `difficulty` serialize immediately after `timestamp`, followed by `merkle_root`, `tx_count`, `size`, `weight`, `previous_block_hash`, and `median_time`. The new order matches mempool.space's `/api/block/{hash}` field layout ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.4/crates/brk_types/src/block_info.rs))
- Changed `BlockPool::miner_names` from `Option<String>` to `Option<Vec<String>>` so pools that tag multiple miner names in a single coinbase (e.g. OCEAN DATUM) can surface each name separately ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.4/crates/brk_types/src/block_pool.rs))
- Changed `OutputType` serde/strum representations to match mempool.space's `scriptpubkey_type` values: `OpReturn` → `op_return`, `P2WPKH` → `v0_p2wpkh`, `P2WSH` → `v0_p2wsh`, `P2TR` → `v1_p2tr` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.4/crates/brk_types/src/output_type.rs))
- `TxOut` now serializes `scriptpubkey_address` only when an address is present: the struct serializer computes a field count of 5 (with address) or 4 (without), and omits the null field entirely when there is no address ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.4/crates/brk_types/src/txout.rs))

### New Features

#### `brk_types`
- Added `first_seen: Option<u64>` and `orphans: Vec<String>` fields to `BlockExtras` to match mempool.space's `/api/v1/blocks` payload shape. Both are currently populated as `None`/empty (noted in doc comments as "always null, not yet supported" and "always empty") ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.4/crates/brk_types/src/block_extras.rs))
- `TxIn` serialization now resolves `inner_witness_script_asm` for P2SH-wrapped P2WSH inputs: the `!has_scriptsig` guard on the witness-script branch was removed so that P2SH-P2WSH spends still report the inner witnessScript disassembly, and the P2SH `inner_redeem_script_asm` branch now skips coinbase inputs ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.4/crates/brk_types/src/txin.rs))
- Documented that `TxIn::vout` is stored as `u16` (coinbase sentinel `65535`) while mempool.space's `u32` sentinel is `4294967295`, clarifying the mapping in the JSON schema ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.4/crates/brk_types/src/txin.rs))

#### `brk_query`
- Added `parse_datum_miner_names()` helper that parses the OCEAN DATUM miner-name tag payload from a coinbase scriptsig: it skips the BIP34 height push, reads the tag-length byte (with `OP_PUSHDATA1` handling), splits the payload on `0x0F`, and keeps alphanumeric + space characters. Used only when `pool_slug == PoolSlug::Ocean` to populate `BlockPool::miner_names` with the list of tagged miners ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.4/crates/brk_query/src/impl/block/info.rs))
- Added `compact_size_len()` helper that returns the Bitcoin VarInt byte length for a given transaction count (1/3/5 bytes) so the coinbase offset can be computed from the block header size plus the VarInt prefix, removing the earlier bulk-read of all coinbase tx positions ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.4/crates/brk_query/src/impl/block/info.rs))
- `parse_coinbase_tx()` now takes an explicit `len: usize` argument so the exact coinbase byte range is read from the block file instead of a fixed 1000-byte window, and returns the raw scriptsig bytes as a sixth tuple element for the DATUM parser ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.4/crates/brk_query/src/impl/block/info.rs))
- Populated the new `BlockExtras::first_seen` (always `None`) and `orphans` (always empty `vec![]`) fields when constructing block responses ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.4/crates/brk_query/src/impl/block/info.rs))
- Reordered the `BlockInfo` struct literal sites in both the V2 and V1 code paths to match the new field order in `brk_types` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.4/crates/brk_query/src/impl/block/info.rs))
- Changed `coinbase_signature` selection from `tx.output.first()` to `tx.output.iter().find(|o| bitcoin::Address::from_script(&o.script_pubkey, Network::Bitcoin).is_ok()).or(tx.output.first())` so blocks with a leading witness-commitment `OP_RETURN` get their actual payout script as the signature. (This was refined again in v0.3.0-alpha.5 to skip `OP_RETURN` outputs directly rather than filtering on address decodability) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.4/crates/brk_query/src/impl/block/info.rs))

### Bug Fixes

#### `brk_query`
- Fixed `total_sigop_cost` for block transactions returning inaccurate values: the call now supplies a real previous-output lookup that scans `tx.input` for a matching outpoint and resolves the prevout `value` and `script_pubkey` via the input's cached prevout, instead of always returning `None` and under-counting witness sigops ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.4/crates/brk_query/src/impl/block/txs.rs))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.3.0-alpha.3...v0.3.0-alpha.4)

## [v0.3.0-alpha.3](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.3.0-alpha.3) - 2026-04-04

### New Features

#### `brk_types`
- Added `price: Dollars` field to `BlockExtras`, exposing the USD spot price at each block height on the `/api/v1/blocks` response ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.3/crates/brk_types/src/block_extras.rs))

#### `brk_computer`
- Added a hot-path price cache on `Prices`: `cached_spot_cents: CachedVec<Height, Cents>` wrapping the on-disk `price_cents.height` vec, plus `cached_spot_usd: LazyVecFrom1<Height, Dollars, Height, Cents>` built via `LazyVecFrom1::transformed::<CentsUnsignedToDollars>` on top of the cached cents vec. This keeps repeated spot lookups in memory instead of re-reading from disk on every compute pass ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.3/crates/brk_computer/src/prices/mod.rs))
- Migrated every compute caller of `prices.spot.cents.height` / `prices.spot.usd.height` to the new `prices.cached_spot_cents` / `prices.cached_spot_usd` fields across cointime reserve_risk and value, market ath/lookback/moving_average/range/returns, market technical MACD, investing returns, indicators realized_envelope, distribution profitability, distribution unrealized/full, distribution cohort all/basic/core/extended/minimal/type, and internal per_block amount/base, amount/block, and ratio/price_extended ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.3/crates/brk_computer/src/cointime/value/compute.rs))
- Relaxed `realized_envelope::compute_index` and `compute_score` signatures to accept `&impl ReadableVec<Height, Cents>` instead of a concrete `&EagerVec<PcoVec<Height, Cents>>`, so they can consume the new cached lazy price vecs ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.3/crates/brk_computer/src/indicators/realized_envelope.rs))

#### `brk_query`
- Populated the new `BlockExtras::price` field from `prices.cached_spot_usd` when assembling per-height block info, so every block returned by range queries carries its USD spot price ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.3/crates/brk_query/src/impl/block/info.rs))
- Removed the local private `max_height()` helper in `impl/block/info.rs` (which computed `blockhash.len().saturating_sub(1)`) and rewired `block_by_height` and `block_hash_by_height` to the existing public `Query::indexed_height()` accessor. `block_by_height_v1` was moved onto the `Query::height()` helper (min of indexed and computed heights) to stay consistent with the other series-bound paths ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.3/crates/brk_query/src/impl/block/info.rs))
- Switched the mining `block_window` computation to read prices from `cached_spot_cents` instead of `spot.cents.height` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.3/crates/brk_query/src/impl/mining/block_window.rs))

#### `brk_server`
- `/api/blocks/tip/height` now answers with `q.indexed_height()` (the last indexed block's height) instead of `q.height()`, matching the cleaner helper added in `brk_query` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.3/crates/brk_server/src/api/mempool_space/blocks.rs))

#### `website`
- Added a "Price" row to the explorer block-details pane, rendering `extras.price` as a formatted USD amount above the pool information ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.3/website/scripts/panes/explorer.js))

### Bug Fixes

#### `brk_computer`
- Fixed distribution aggregation contaminating stats with zeros when inputs are skipped: when `skip_count > 0`, `LazyDistribution::compute_range_at` now calls `values.retain(|v| *v > zero)` before computing min/max/quartiles so that skipped entries (e.g. coinbase, zero-fee txs) do not pull the distribution toward zero ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.3/crates/brk_computer/src/internal/per_block/computed/distribution.rs))
- Bumped the transactions-fees aggregation `VERSION` from 2 to 3 (comment now reads "skip coinbase, skip zero-fee") to force recomputation of all fee/feerate metrics under the new zero-filter semantics ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.3/crates/brk_computer/src/transactions/fees/import.rs))

### Internal Changes

#### `brk_logger`
- Re-added `fjall=off` and `lsm_tree=off` to the default `RUST_LOG` directive set so the embedded KV store stops logging at the default level ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.3/crates/brk_logger/src/lib.rs))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.3.0-alpha.2...v0.3.0-alpha.3)

## [v0.3.0-alpha.2](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.3.0-alpha.2) - 2026-04-03

### Breaking Changes

#### `brk_store`
- Removed `reset()` from the `AnyStore` trait and its `Store` implementation. The previous `keyspace.clear()`-based reset left a journal record that was replayed on every recovery, so the operation has been removed in favor of deleting the stores directory outright ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.2/crates/brk_store/src/any.rs))

#### `brk_indexer`
- Removed `Stores::reset()` method in line with the `brk_store` trait change ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.2/crates/brk_indexer/src/stores.rs))

### New Features

#### `brk_indexer`
- Added `Indexer::full_reset()` which deletes the on-disk `stores/` directory and rebuilds the store set from scratch via `Stores::forced_import`, providing a clean recovery path without leaving journal replay records behind ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.2/crates/brk_indexer/src/lib.rs))
- Wired `full_reset()` into the XOR key change handler and the data inconsistency recovery branch so that both reset paths use directory nuking instead of keyspace clearing ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.2/crates/brk_indexer/src/lib.rs))
- Added failure logging in `Stores::forced_import_inner`, so the reason a store open failed is printed before the retry path deletes the directory and reimports ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.2/crates/brk_indexer/src/stores.rs))

#### `website`
- Added a block details side pane in the explorer that renders full metadata for the currently selected block: hash, previous hash, merkle root, timestamp, median time, version, bits, nonce, difficulty, size, weight, transaction count, pool info (name/id/slug/miner names), reward and total fees, median/avg fee rate, fee range, fee percentiles, avg tx size, virtual size, input/output totals and amounts, UTXO set change and size, SegWit totals, and coinbase address/raw/signature fields ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.2/website/scripts/panes/explorer.js))
- Added click-to-select interaction on block cubes with a `selectedCube` highlight and a `blocksByHash` cache so the details pane can look up block data without refetching; the chain tip is auto-selected on first load ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.2/website/scripts/panes/explorer.js))
- Restyled the explorer pane to host the new details panel alongside the block chain view ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.2/website/styles/panes/explorer.css))

### Internal Changes

#### `brk_logger`
- Trimmed the default `RUST_LOG` directive set down to `bitcoin=off,bitcoincore_rpc=off,corepc=off,tracing=off,aide=off,tower_http=off`, dropping the per-crate overrides for `fjall`, `brk_fjall`, `lsm_tree`, `brk_rolldown`, `rolldown`, `rustls`, `notify`, and `oxc_resolver` that the embedded KV store and HTTP stack no longer need silenced by default ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.2/crates/brk_logger/src/lib.rs))

#### `workspace`
- Pinned `fjall` from `3.1.2` to `=3.0.4` in the workspace `Cargo.toml` to avoid the 3.1.x journal-replay regression that motivated the whole store reset rework in this release ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.2/Cargo.toml))

#### `brk_query`
- Replaced the manual ceiling division in `BlockWindowRange::count()` with the standard-library `div_ceil` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.2/crates/brk_query/src/impl/mining/block_window.rs))
- Refactored pool hashrate entry computation in `mining/pools.rs` to use let-chains for the `total_blocks > 0 && Some(hr) = …` check and read the daily hashrate via direct deref instead of `f64::from(**hr)` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.2/crates/brk_query/src/impl/mining/pools.rs))

#### `brk_client` (Rust)
- Reordered imports in `brk_client` to group `std` modules before external re-exports ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.2/crates/brk_client/src/lib.rs))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.3.0-alpha.1...v0.3.0-alpha.2)

## [v0.3.0-alpha.1](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.3.0-alpha.1) - 2026-04-03

### Breaking Changes

#### `brk_types`
- Changed `DifficultyAdjustment` time units from seconds to milliseconds for `estimated_retarget_date`, `remaining_time`, `time_avg`, and `adjusted_time_avg` to match mempool.space API format ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.1/crates/brk_types/src/difficulty_adjustment.rs))
- Changed `DifficultyEntry` field `timestamp` to `time` and added `adjustment: f64` field (ratio of new/previous difficulty) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.1/crates/brk_types/src/difficulty_entry.rs))
- Changed `Transaction` field ordering — `input` and `output` now serialize before `size`/`weight`/`fee`/`status` to match mempool.space format ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.1/crates/brk_types/src/tx.rs))
- Changed `TxIn` to include `witness: Vec<String>` and `inner_witness_script_asm` fields — witness data now hex-encoded and included in serialization; removed `script_sig_asm()` and `inner_redeemscript_asm()` methods (logic moved to custom `Serialize` impl that dynamically includes fields based on content) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.1/crates/brk_types/src/txin.rs))
- Removed `time: u32` field from `BlockHeader` — block timestamp is already present on the parent `BlockInfo` struct as `timestamp`, so the duplicate was removed ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.1/crates/brk_types/src/block_header.rs))
- Renamed `PoolDetailInfo.addrs` to `addresses` for mempool.space API compatibility ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.1/crates/brk_types/src/pool_detail.rs))
- Changed `PoolsSummary` to use `#[serde(rename_all = "camelCase")]` instead of per-field `#[serde(rename)]` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.1/crates/brk_types/src/pools_summary.rs))
- Moved all API parameter types (`AddrParam`, `BlockHashParam`, `HeightParam`, `TxidParam`, etc.) from `brk_types` into a new `brk_server::params` module — 17 param types relocated to keep `brk_types` focused on domain types ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.1/crates/brk_server/src/params/mod.rs))

#### `brk_server`
- Overhauled cache strategy system: renamed `Height` to `Tip` (etag based on tip block hash prefix instead of height), added `Immutable(Version)` for deep/confirmed data, added `BlockBound(Version, BlockHashPrefix)` for reorg-aware caching, changed etag format from `{VERSION}-{height}` to prefix-coded format (`t{hash:x}`, `i{version}`, `b{version}-{hash:x}`, `s{VERSION}`, `m{hash:x}`) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.1/crates/brk_server/src/cache.rs))
- Reorganized API route files from `api/addrs/`, `api/blocks/`, `api/fees/`, `api/general/`, `api/mempool/`, `api/mining/`, `api/transactions/` into `api/mempool_space/` directory ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.1/crates/brk_server/src/api/mempool_space/mod.rs))

### New Features

#### `brk_types`
- Added `error_locations: Option<Vec<usize>>` and `error: Option<String>` fields to `AddrValidation` for reporting validation errors on invalid addresses ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.1/crates/brk_types/src/addr_validation.rs))
- Added `previous_time: Timestamp` and `expected_blocks: f64` fields to `DifficultyAdjustment` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.1/crates/brk_types/src/difficulty_adjustment.rs))
- Added `From<(Sats, Weight)>` impl for `FeeRate` to compute fee rates from weight instead of only vsize ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.1/crates/brk_types/src/feerate.rs))
- Added `unique_id` field to `PoolDetailInfo` and `pool_unique_id` to `PoolStats` for pool identification across endpoints ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.1/crates/brk_types/src/pool_detail.rs))
- Added `last_estimated_hashrate3d` and `last_estimated_hashrate1w` fields to `PoolsSummary` for 3-day and 1-week hashrate estimates ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.1/crates/brk_types/src/pools_summary.rs))
- Added two new mining pools: `BraiinsSolo` and `SoloPool` (replacing dummy slots 168-169), increasing pool count to 170 ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.1/crates/brk_types/src/pool_slug.rs))

#### `brk_indexer`
- Added `tip_blockhash()` accessor that returns the current chain tip block hash via a shared `Arc<RwLock<BlockHash>>`, updated on each indexed block ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.1/crates/brk_indexer/src/lib.rs))
- Added `check_xor_bytes()` that detects Bitcoin Core XOR obfuscation key changes and triggers a full index reset when the key differs from the cached value ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.1/crates/brk_indexer/src/lib.rs))

#### `brk_server`
- Added smart cache strategy helpers on `AppState`: `height_cache()` returns `Immutable` for blocks >6 deep and `Tip` for recent; `addr_cache()` checks mempool activity; `block_cache()` and `block_status_cache()` use `BlockBound` for reorg-aware caching; `tx_cache()` selects strategy based on confirmation depth ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.1/crates/brk_server/src/state.rs))

#### `brk_rpc`
- Added witness data to `TxIn` construction — each witness stack item is now hex-encoded and included in the `witness` field ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.1/crates/brk_rpc/src/lib.rs))
- Added `inner_witness_script_asm` field to `TxIn` for P2WSH transactions — decodes the last witness item as a script and formats in ASM ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.1/crates/brk_rpc/src/lib.rs))

### Bug Fixes

#### `brk_cohort`
- Fixed off-by-one error in profit threshold iterator `iter_ge_thresholds()` — range was missing one cohort per threshold ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.1/crates/brk_cohort/src/profit.rs))
- Fixed off-by-one error in loss threshold iterator — range included one extra cohort per threshold ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.1/crates/brk_cohort/src/loss.rs))

### Internal Changes

#### `brk_computer`
- Bumped profitability aggregate version to `Version::TWO` to trigger recomputation with corrected cohort threshold ranges ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.1/crates/brk_computer/src/distribution/metrics/profitability.rs))
- Bumped pools version from 3 to 4 for the new BraiinsSolo and SoloPool additions ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.1/crates/brk_computer/src/pools/mod.rs))

#### `brk_indexer`
- Added export phase logging with total elapsed time (`"Exporting..."` / `"Exported in {:?}"`) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.1/crates/brk_indexer/src/lib.rs))

#### `brk_types`
- Added doc comments to `Transaction`, `TxIn`, `DifficultyAdjustmentEntry`, `DifficultyEntry`, and `RewardStats` fields ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.1/crates/brk_types/src/tx.rs))
- Trimmed verbose `#[schemars(example)]` annotations on `TxIn` fields to reduce generated schema size ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.1/crates/brk_types/src/txin.rs))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.3.0-alpha.0...v0.3.0-alpha.1)

## [v0.3.0-alpha.0](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.3.0-alpha.0) - 2026-04-01

### Breaking Changes

#### `brk_types`
- Changed `BlockInfo` struct to include a flattened `BlockHeader` field and `median_time: Timestamp`, and changed `tx_count` from `usize` to `u32` — existing consumers of `BlockInfo` must update to the new field layout ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_types/src/block_info.rs))
- Changed `Block::coinbase_tag()` return type from `Cow<'_, str>` to `CoinbaseTag` — callers must use `.as_str()` to get a string ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_types/src/block.rs))
- Simplified `get_percentile` to use nearest-rank method (no interpolation), removing `Add` and `Div` trait bounds — only `Clone` is now required ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_types/src/percentile.rs))

#### `brk_indexer`
- Bumped indexer data VERSION from 25 to 26 — requires full re-index when upgrading ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_indexer/src/constants.rs))
- Removed `height_to_coinbase_tag` KV store — coinbase tags migrated from `brk_store` to indexed vec storage ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_indexer/src/stores.rs))
- Changed `index()` and `checked_index()` to accept `&Reader` instead of `&Blocks`, removing the `brk_iterator` dependency ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_indexer/src/lib.rs))

#### `brk_computer`
- Removed `positions` module entirely — block/tx positions now indexed directly by `brk_indexer` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_computer/src/lib.rs))
- Removed `reader: &Reader` parameter from `Computer::compute()` since positions are no longer needed at compute time ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_computer/src/lib.rs))

#### `brk_store`
- Removed `Kind::Sequential` store variant and its `is_sequential()` method ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_store/src/kind.rs))

### New Features

#### `brk_types`
- Added `BlockExtras` struct matching mempool.space `/api/v1/blocks` extras format with 25 fields: totalFees, medianFee, feeRange, reward, pool, avgFee, avgFeeRate, coinbaseRaw, coinbaseAddress, coinbaseAddresses, coinbaseSignature, coinbaseSignatureAscii, avgTxSize, totalInputs, totalOutputs, totalOutputAmt, medianFeeAmt, feePercentiles, segwitTotalTxs, segwitTotalSize, segwitTotalWeight, header, utxoSetChange, utxoSetSize, totalInputAmt, virtualSize ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_types/src/block_extras.rs))
- Added `BlockHeader` struct matching mempool.space format with version, previousblockhash, merkle_root, time, bits, nonce — includes `From<bitcoin::block::Header>` conversion ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_types/src/block_header.rs))
- Added `BlockInfoV1` struct combining `BlockInfo` with `BlockExtras` for the mempool.space v1 blocks endpoint ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_types/src/block_info_v1.rs))
- Added `BlockPool` struct for mining pool identification (id, name, slug) in block extras ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_types/src/block_pool.rs))
- Added `CoinbaseTag` struct — fixed 101-byte record (1-byte length + 100 bytes data) with latin-1 decoding via `as_str()`, proper JSON escaping for control characters, and `Bytes`/`Formattable` implementations for vec storage ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_types/src/coinbase_tag.rs))
- Added `CpfpInfo` and `CpfpEntry` structs for Child-Pays-For-Parent transaction data ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_types/src/cpfp.rs))
- Added `Prices`, `HistoricalPrice`, `HistoricalPriceEntry`, and `ExchangeRates` structs matching mempool.space `/api/v1/prices` format ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_types/src/historical_price.rs))
- Added `MempoolRecentTx` struct with txid, fee, vsize, value — constructed from `(&Txid, &Transaction)` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_types/src/mempool_recent_tx.rs))
- Added `MerkleProof` struct with block_height, merkle path, and position ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_types/src/merkle_proof.rs))
- Added `PoolHashrateEntry` struct with timestamp, avg_hashrate, share, and pool_name ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_types/src/pool_hashrate_entry.rs))
- Added `PoolSlugAndHeightParam` for endpoints requiring both pool slug and height ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_types/src/pool_slug_param.rs))
- Added `fee_histogram` field to `MempoolInfo` — incrementally maintained `BTreeMap<FeeRate, VSize>` that updates on tx add/remove, serialized as `[[fee_rate, vsize], ...]` sorted by descending fee rate ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_types/src/mempool_info.rs))

#### `brk_indexer`
- Added `coinbase_tag: BytesVec<Height, CoinbaseTag>` to `BlocksVecs` — stores coinbase scriptSig tags as indexed vec data for fast range queries ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_indexer/src/vecs/blocks.rs))
- Added `position: PcoVec<Height, BlkPosition>` to `BlocksVecs` — indexes each block's file position for random-access reads from blk files ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_indexer/src/vecs/blocks.rs))
- Added `position: PcoVec<TxIndex, BlkPosition>` to `TransactionsVecs` — indexes each transaction's file position ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_indexer/src/vecs/transactions.rs))
- Added per-block segwit tracking: `segwit_txs` (count), `segwit_size` (bytes), `segwit_weight` (weight units) — computed during block processing ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_indexer/src/vecs/blocks.rs))
- Added `is_segwit()` and `weight()` methods to `ComputedTx` for detecting segwit transactions and computing tx weight ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_indexer/src/processor/types.rs))

#### `brk_reader`
- Added `read_rev()` method for reverse-order block reading (newest first) by scanning `.blk` files from the tail in 5MB chunks — efficient for reading recent blocks without scanning from genesis ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_reader/src/lib.rs))
- Added `after()` method that streams blocks from `hash + 1` to chain tip — replaces the `Blocks` iterator pattern ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_reader/src/lib.rs))
- Extracted block scanning logic into `scan.rs` module with reusable `scan_bytes()` function and `ScanResult` struct, shared by both forward and reverse reading ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_reader/src/scan.rs))

#### `brk_query`
- Added `block_by_height_v1()` returning `BlockInfoV1` with full extras (pool, fees, segwit stats, coinbase data, UTXO set changes) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_query/src/impl/block/info.rs))
- Added `blocks_v1()` and `blocks_v1_range()` for batch v1 block queries with all extras data ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_query/src/impl/block/info.rs))
- Added `block_header_hex()` that reads the raw 80-byte header from blk files and returns it as hex ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_query/src/impl/block/info.rs))
- Added `block_hash_by_height()` for direct height-to-hash lookups ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_query/src/impl/block/info.rs))
- Block queries now read block headers from raw blk data and compute `median_time` (median of last 11 block timestamps) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_query/src/impl/block/info.rs))
- Added `transaction_raw()` returning raw transaction bytes by reading from blk files via indexed position ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_query/src/impl/tx.rs))
- Added `broadcast_transaction()` that forwards raw transaction hex to the RPC client for broadcasting ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_query/src/impl/tx.rs))
- Added `merkle_proof()` returning a `MerkleProof` with block height, merkle path hashes, and tx position within the block ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_query/src/impl/tx.rs))
- Added `merkleblock_proof()` returning a BIP37-format merkleblock proof as hex for SPV verification ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_query/src/impl/tx.rs))
- Added `mempool_recent()` returning the last 10 transactions to enter the mempool ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_query/src/impl/mempool.rs))
- Added `cpfp()` computing CPFP (Child-Pays-For-Parent) relationships by walking ancestor/descendant dependency chains in the mempool entry pool ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_query/src/impl/mempool.rs))
- Added `transaction_times()` returning first-seen timestamps for a batch of txids from mempool entries ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_query/src/impl/mempool.rs))

#### `brk_server`
- Added `/api/block/{hash}` endpoint returning `BlockInfo` with full header fields and median time ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_server/src/api/blocks/mod.rs))
- Added `/api/v1/block/{hash}` endpoint returning `BlockInfoV1` with extras (fees, pool, segwit, coinbase, UTXO stats) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_server/src/api/blocks/mod.rs))
- Added `/api/v1/blocks` and `/api/v1/blocks/{height}` endpoints returning blocks with extras data ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_server/src/api/blocks/mod.rs))
- Added `/api/block/{hash}/header` endpoint returning the raw 80-byte block header as hex text ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_server/src/api/blocks/mod.rs))
- Added `/api/block-height/{height}` endpoint returning block hash as plain text ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_server/src/api/blocks/mod.rs))
- Added `POST /api/tx` endpoint for broadcasting raw transaction hex to the Bitcoin network ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_server/src/api/transactions/mod.rs))
- Added `/api/tx/{txid}/raw` endpoint returning raw transaction bytes ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_server/src/api/transactions/mod.rs))
- Added `/api/tx/{txid}/merkle-proof` endpoint returning JSON merkle inclusion proof (block_height, merkle path, position) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_server/src/api/transactions/mod.rs))
- Added `/api/tx/{txid}/merkleblock-proof` endpoint returning BIP37-format merkleblock proof as hex ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_server/src/api/transactions/mod.rs))
- Added `/api/v1/cpfp/{txid}` endpoint returning CPFP ancestor/descendant relationships and effective fee rate ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_server/src/api/mempool/mod.rs))
- Added `/api/mempool/recent` endpoint returning the last 10 transactions to enter the mempool ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_server/src/api/mempool/mod.rs))
- Added bundled Scalar API docs viewer (`scalar.js` + `scalar.html`) for interactive OpenAPI documentation ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_server/src/api/scalar.html))

#### `brk_rpc`
- Added `send_raw_transaction()` to both `bitcoincore` and `corepc` RPC backends for broadcasting raw transaction hex ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_rpc/src/lib.rs))

#### `brk_mempool`
- Added `get_entries()` method to expose the entry pool for direct access ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_mempool/src/sync.rs))
- Added `first_seen: Timestamp` field to mempool `Entry` — records when each transaction was first observed ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_mempool/src/entry.rs))
- Added recent transactions tracking to `TxStore` — maintains the last 10 transactions with a `recent()` accessor for the mempool recent transactions endpoint ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_mempool/src/tx_store.rs))

#### `brk_computer`
- Added `output_volume` to mining rewards — computes transfer volume minus fees per block ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_computer/src/mining/rewards/vecs.rs))

#### `website`
- Added block explorer pane with isometric 3D cube visualization — each block displays height, miner name, median fee, and fee range; supports infinite scroll for older blocks and auto-polls every 15 seconds for new blocks (localhost/127.0.0.1 only) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/website/scripts/panes/explorer.js))
- Renamed "Invert" button to "Theme" for clarity ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/website/scripts/utils/theme.js))

### Internal Changes

#### `brk_server`
- Renamed `.ok_response` to `.json_response` across all OpenAPI endpoint specifications for consistency ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_server/src/api/addrs/mod.rs))

#### `brk_indexer`
- Changed per-block indexing log level from `info!` to `debug!`, with `info!` only emitted every 100 blocks — reduces log noise during bulk indexing ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_indexer/src/lib.rs))
- Changed stores export/commit/persist log level from `info!` to `debug!` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_indexer/src/stores.rs))

#### `brk_computer`
- Distribution block loop now logs at `debug!` level for every block, with `info!` only every 100 blocks ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_computer/src/distribution/compute/block_loop.rs))
- Pool identification now reads coinbase tags from indexed vec instead of KV store, with a version mismatch warning for debugging ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_computer/src/pools/mod.rs))

#### `brk_bindgen`
- Added `sanitize_ident()` for JavaScript query parameters that clash with reserved words ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_bindgen/src/generators/javascript/api.rs))

#### `brk_cli`
- Removed `brk_iterator` dependency — indexer now uses `Reader` directly for block streaming ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.3.0-alpha.0/crates/brk_cli/src/main.rs))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.2.5...v0.3.0-alpha.0)

## [v0.2.5](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.2.5) - 2026-03-29

### New Features

#### `brk_website`
- Added comprehensive static file serving tests covering path sanitization, index.html serving for root and SPA routes, static asset cache headers (`max-age=31536000, immutable` in release, `max-age=1, must-revalidate` in debug), directory traversal protection, and 404 responses for missing files ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.5/crates/brk_website/src/handlers.rs))

### Internal Changes

#### `brk_computer`
- Switched all background compaction calls from `compact()` to `compact_deferred_default()` across all 14 compute modules (blocks, cointime, indicators, inputs, investing, market, mining, outputs, pools, positions, prices, scripts, supply, transactions), deferring compaction work to reduce I/O contention during block processing ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.5/crates/brk_computer/src/blocks/compute.rs))

#### `brk_indexer`
- Added 5-second delay before background compaction tasks execute, allowing recent writes to settle before compaction begins ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.5/crates/brk_indexer/src/lib.rs))
- Removed `db.flush()` call from background tasks — background compaction now only calls `db.compact()` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.5/crates/brk_indexer/src/lib.rs))

#### `brk_website`
- Added `Debug` derive to `Error` struct to support test assertions and diagnostic output ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.5/crates/brk_website/src/error.rs))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.2.4...v0.2.5)

## [v0.2.4](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.2.4) - 2026-03-27

### New Features

#### `website`
- Added "all" range preset button to chart toolbar that selects 1w resolution and scrolls to show the full chart history ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.4/website/scripts/chart/index.js))
- Added touch device support for chart toolbar — `pointer: coarse` media query enables pointer events on touch screens ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.4/website/styles/chart.css))

### Bug Fixes

#### `website`
- Fixed potential division-by-zero in pane stretch factor calculation when chart height is zero ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.4/website/scripts/chart/index.js))

### Internal Changes

#### `website`
- Switched h1/h2/h3 headings to "Instrument" font family with `letter-spacing: 0.05rem` and `font-weight: 400` for a distinct heading style ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.4/website/styles/elements.css))
- Set h1 to fixed `2rem` and h3 to fixed `1.5rem` font sizes instead of CSS variables ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.4/website/styles/elements.css))
- Renamed `types.js` to `_types.js` to follow underscore-prefix convention for generated/private files ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.4/website/scripts/_types.js))
- Simplified CSS reset by removing redundant Tailwind-style rules that were already handled elsewhere ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.4/website/styles/reset.css))
- Reduced mobile bottom padding and removed standalone display-specific extra padding ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.4/website/styles/elements.css))
- Adjusted gradient fade stop from 90% to 85% for earlier fade-out effect ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.4/website/styles/main.css))
- Tightened range preset button spacing and adjusted chart heading letter-spacing from `0.075rem` to `0.05rem` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.4/website/styles/chart.css))
- Added `padding: 0` and `letter-spacing: inherit` to input elements, and explicit `color: var(--color)` to labels ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.4/website/styles/elements.css))

#### `brk_client`
- Bumped `brk-client` VERSION to v0.2.3 across Rust, JavaScript, and Python client packages ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.4/crates/brk_client/src/lib.rs))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.2.3...v0.2.4)

## [v0.2.3](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.2.3) - 2026-03-26

### New Features

#### `brk_computer`
- Added new `investing` module with complete Dollar-Cost Averaging (DCA) and lump-sum investment analysis — computes DCA stack (cumulative sats purchased at $100/day), cost basis, returns, and CAGR by rolling period (1w, 1m, 3m, 6m, 1y through 10y); lump-sum stack and returns by rolling period; and DCA stack, cost basis, and returns by year class (2015 through 2026). Extracted from `market::dca` into a standalone top-level module with parallel import and compute ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.3/crates/brk_computer/src/investing/mod.rs))
- Added `RealizedEnvelope` indicator that computes the tightest percentile bounds across 10 pricing models (realized price, investor price, STH/LTH variants, cointime vaultedness/activity/true market mean/cointime price), producing 8 envelope price bands (0.5th through 99.5th percentile), a zone index (-4 to +4) based on spot price position relative to envelope bands, and a composite score (-40 to +40) summing band crossings across all models ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.3/crates/brk_computer/src/indicators/realized_envelope.rs))
- Expanded `RatioPerBlockPercentiles` from 6 to 8 percentile bands, adding 0.5th and 99.5th percentiles alongside the existing 1st/2nd/5th/95th/98th/99th — `ExpandingPercentiles` Fenwick tree computation also widened from 6-quantile to 8-quantile output ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.3/crates/brk_computer/src/internal/per_block/ratio/percentiles.rs))
- Consolidated timestamp data into a new `indexes::timestamp::Timestamps` struct — moved `timestamp_monotonic`, `date`, and per-resolution timestamp lookups from `blocks::time::Vecs` into the indexes module, making timestamp data accessible without depending on the blocks module ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.3/crates/brk_computer/src/indexes/timestamp.rs))

#### `brk_indexer`
- Added `take_all_pending_ingests()` to batch all KV store puts/deletes into closures that can be executed on a background thread, enabling the indexer to hand off fjall store commits to `run_bg()` instead of blocking the main indexing loop ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.3/crates/brk_indexer/src/stores.rs))
- Extracted `stamped_write()` from `flush()` so vec stamping can happen on the main thread while compaction and store ingests run in the background ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.3/crates/brk_indexer/src/vecs/mod.rs))

#### `brk_store`
- Added `take_pending_ingest()` method that drains buffered puts/deletes and returns a `Send` closure for background ingestion into the fjall keyspace ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.3/crates/brk_store/src/lib.rs))

#### `website`
- Added range preset buttons (1w, 1m, 3m, 6m, 1y, 4y, 8y, YTD, all) to the chart that automatically select the appropriate sub-day resolution index (30min through 1w) and scroll the visible range to that time window ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.3/website/scripts/chart/index.js))
- Added value-dependent coloring support (`colorFn`) for histogram and baseline chart series, enabling per-bar colors based on data values ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.3/website/scripts/chart/index.js))
- Added "Realized Envelope" chart to market indicators showing 8-level percentile price bands as dashed lines, a color-coded zone index histogram, and a score baseline ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.3/website/scripts/options/market.js))
- Added `percentileBands()` and `priceBands()` shared helpers for displaying 8-level percentile bands with dedicated colors per level, reusable across ratio and price chart types ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.3/website/scripts/options/shared.js))
- Added subtle grid lines to charts using a new `offBorder` color variable ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.3/website/scripts/chart/index.js))

### Internal Changes

#### `brk_computer`
- Switched all module `compute()` methods to use `db.run_bg()` for background compaction instead of synchronous `db.compact()`, and added `db.sync_bg_tasks()` at compute entry to await prior background work — applies to blocks, cointime, distribution, indicators, inputs, investing, market, mining, outputs, pools, positions, prices, scripts, supply, and transactions ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.3/crates/brk_computer/src/blocks/compute.rs))
- Removed `market::dca` sub-module — DCA types (`ByDcaClass`, `ByDcaPeriod`, `ByDcaCagr`) and computation logic moved to the new top-level `investing` module; `market::returns` now imports `ByDcaPeriod` from `investing` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.3/crates/brk_computer/src/market/mod.rs))
- Removed `blocks::time` sub-module — `timestamp_monotonic` compute logic and per-resolution timestamp imports relocated to `indexes::timestamp::Timestamps` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.3/crates/brk_computer/src/blocks/mod.rs))
- Changed `lookback::compute()` to take `&indexes::Vecs` instead of `&time::Vecs`, sourcing monotonic timestamps from the indexes module ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.3/crates/brk_computer/src/blocks/lookback.rs))
- Changed `market::compute()` parameter order: now takes `(prices, indexes, blocks)` instead of `(indexes, prices, blocks)` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.3/crates/brk_computer/src/market/compute.rs))

#### `brk_indexer`
- Moved indexer store ingest and fjall persist to background via `run_bg()`, running compaction, store commit, and fjall `SyncData` persist concurrently with the next indexing batch ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.3/crates/brk_indexer/src/lib.rs))

#### `brk_client`
- Added `Pct0Pct1Pct2Pct5Pct95Pct98Pct99Pattern` replacing `Pct1Pct2Pct5Pct95Pct98Pct99Pattern` to include the new 0.5th and 99.5th percentile bands ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.3/crates/brk_client/src/lib.rs))
- Added `SeriesTree_Investing` with full period/class sub-trees for DCA stack, cost basis, returns, CAGR, and lump-sum series ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.3/crates/brk_client/src/lib.rs))
- Added `SeriesTree_Indicators_RealizedEnvelope` with percentile price bands, index, and score series ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.3/crates/brk_client/src/lib.rs))
- Added `SeriesTree_Indexes_Timestamp` with monotonic and per-resolution timestamp series ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.3/crates/brk_client/src/lib.rs))
- Removed `date` and `timestamp_monotonic` from `SeriesTree_Blocks_Time`, simplified to only expose `timestamp` as a per-resolution pattern ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.3/crates/brk_client/src/lib.rs))

#### `brk_query`
- Updated all mining query endpoints (`day1_iter`, `difficulty`, `epochs`, `hashrate`) and series timestamp resolution to read from `indexes.timestamp` instead of `blocks.time.timestamp` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.3/crates/brk_query/src/impl/series.rs))

#### `website`
- Refactored investing chart options to use the new `investing` tree path instead of `market.dca` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.3/website/scripts/options/investing.js))
- Added dedicated percentile color palette (`_0_5` through `_99_5`) replacing the previous 6-color scheme with 8 distinct colors ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.3/website/scripts/utils/colors.js))
- Added `createRatioChart()` and `groupedWindowsCumulative()` shared chart builders for reuse across ratio-based chart options ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.3/website/scripts/options/shared.js))

#### `docker`
- Switched health check from `curl http://localhost:3110/health` to `pgrep -x brk`, replacing `curl` package dependency with `procps` and reducing start period from 60s to 10s ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.3/docker/docker-compose.yml))

#### `workspace`
- Bumped Rust toolchain from 1.94.0 to 1.94.1 ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.3/rust-toolchain.toml))
- Bumped `quickmatch-js` from 0.4.0 to 0.4.1 ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.3/modules/quickmatch-js/0.4.1/src/index.js))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.2.2...v0.2.3)

## [v0.2.2](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.2.2) - 2026-03-23

### New Features

#### `website`
- Created a comprehensive LLM-readable API reference (`llms-full.txt`) documenting every endpoint with curl examples, response shapes, parameter descriptions, and series categories — enabling LLM agents to discover and use the BRK API via the [llms.txt standard](https://llmstxt.org/) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.2/website/llms-full.txt))
- Rewrote `llms.txt` from a minimal overview into a structured quick-start guide with live links to key endpoints (search, series data, blocks, transactions, addresses, fees, live price) and links to the full reference, OpenAPI specs, and interactive docs ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.2/website/llms.txt))
- Added `llms-full.txt` to `robots.txt` as a sitemap entry so crawlers and LLM agents can discover it ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.2/website/robots.txt))

#### `brk_server`
- Added Open Graph and Twitter Card meta tags to the Scalar API documentation page, providing proper title, description, and image for social media link previews ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.2/crates/brk_server/src/api/scalar.html))
- Renamed the API docs page title from "BRK API" to "BRK API — Bitcoin Research Kit" with a richer meta description emphasizing the free, no-auth nature of the API ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.2/crates/brk_server/src/api/scalar.html))

### Internal Changes

#### `workspace`
- Re-enabled `cargo build --workspace --release` in the release script (was previously commented out) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.2/scripts/quick-release.sh))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.2.1...v0.2.2)

## [v0.2.1](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.2.1) - 2026-03-23

### Breaking Changes

#### `brk_rpc`
- Made `corepc` the default feature — `brk_rpc` now uses the `brk-corepc-client` RPC backend by default instead of requiring explicit feature opt-in; users relying on `bitcoincore-rpc` must now explicitly enable it ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.1/crates/brk_rpc/Cargo.toml))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.2.0...v0.2.1)

## [v0.2.0](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.2.0) - 2026-03-23

This is a major architectural release. The most significant changes are:

1. **Self-contained, oracle-only pricing**: The computation pipeline no longer uses exchange APIs for price data. All prices are now derived on-chain via the `brk_oracle` crate from block 550,000 onward, with pre-computed historical prices embedded for earlier blocks. `brk_fetcher` remains as a crate but is no longer used by `brk_computer` or `brk_cli`. Bitcoin Core is now the only runtime dependency — the toolkit runs fully offline and produces deterministic, reproducible results.

2. **Height-only storage**: All series now store only the per-block (height-indexed) vec on disk. Previously each series stored both a height vec and a date-indexed vec. All non-height resolutions (minute10 through year10, halving, epoch — 15 total, up from 8) are now computed lazily on demand from the height data using `LazyAggVec` with flat height-to-period mappings. This roughly halves on-disk vec count while nearly doubling the number of available resolutions.

3. **Flat index architecture**: The old cascading index hierarchy (height → date → week → month → quarter → year → decade) is replaced by a flat system where every period type maps directly to Height. This eliminates intermediate stored mappings and enables sub-day resolutions (10min, 30min, 1h, 4h, 12h) that were previously impossible.

4. **Profitability cohorts**: New UTXO bucketing by unrealized profit/loss percentage — 25 ranges from ">1000% in profit" to "90-100% in loss", plus 14 aggregate profit thresholds and 9 loss thresholds, powered by a 190K-bucket Fenwick tree for O(log N) per-block computation.

As a consequence of height-only storage, temporal aggregation shifted from date-based (daily sum, daily last, daily cumulative) to **rolling windows** (24h, 1w, 1m, 1y) computed from height data using precomputed lookback start positions (`CachedWindowStarts`). Most series now expose a `block` value, `cumulative` sum, and `RollingComplete` (rolling sums + rolling averages + rolling distribution with min/max/median/percentiles per window) — all derived from the single height vec.

Resolution data is served through a popularity-based caching layer: up to 256 height-source vecs are cached in memory with LRU eviction based on access frequency, while period-to-height index mappings are always cached since they're small and shared across all series.

### Breaking Changes

#### `brk_types`
- Renamed all `Address`/`Addresses` types to `Addr`/`Addrs` across the entire public API: `Address` → `Addr`, `AddressBytes` → `AddrBytes`, `AddressHash` → `AddrHash`, `AddressStats` → `AddrStats`, `AddressChainStats` → `AddrChainStats`, `AddressMempoolStats` → `AddrMempoolStats`, `AddressParam` → `AddrParam`, `AddressValidation` → `AddrValidation`, `AnyAddressIndex` → `AnyAddrIndex`, `FundedAddressData` → `FundedAddrData`, `EmptyAddressData` → `EmptyAddrData`, etc. ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_types/src/addr.rs))
- Renamed all `Metric`/`Metrics` types to `Series`: `MetricParam` → `SeriesParam`, `MetricData` → `SeriesData`, `MetricOutput` → `SeriesOutput`, `MetricCount` → `SeriesCount`, `MetricSelection` → `SeriesSelection`, `MetricsPaginated` → `SeriesPaginated`, `MetricWithIndex` → `SeriesNameWithIndex` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_types/src/series_data.rs))
- Renamed `DateIndex` to `Day1` and removed `DecadeIndex`, `WeekIndex`, `MonthIndex`, `QuarterIndex`, `SemesterIndex`, `YearIndex` — replaced with a comprehensive resolution system: `Minute10`, `Minute30`, `Hour1`, `Hour4`, `Hour12`, `Day1`, `Day3`, `Week1`, `Month1`, `Month3`, `Month6`, `Year1`, `Year10` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_types/src/day1.rs))
- Renamed `DifficultyEpoch` to `Epoch` and `HalvingEpoch` to `Halving` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_types/src/epoch.rs))
- Renamed `CentsUnsigned` to `Cents` and `CentsUnsignedCompact` to `CentsCompact` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_types/src/cents.rs))
- Adopted snake_case for all module file names (e.g. `blockinfo` → `block_info`, `blocktimestamp` → `block_timestamp`, `feeratepercentiles` → `feerate_percentiles`, `txstatus` → `tx_status`, `poolslug` → `pool_slug`, etc.)

#### `brk_computer`
- **All series now store height-indexed data only on disk** — previously each metric stored both a `height: EagerVec` and a `dateindex: EagerVec` (and sometimes cumulative/sum variants at each level). Now `PerBlock<T>` has `height: EagerVec` + `resolutions: Box<Resolutions<T>>` where all 15 resolutions are `LazyAggVec` instances computed on demand. This roughly halves the on-disk vec count per series ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_computer/src/internal/per_block/computed/base.rs))
- **Replaced cascading index hierarchy with flat height-to-period mappings** — old system chained height→dateindex→weekindex→monthindex→yearindex→decadeindex; new system maps every period type directly to Height via `EagerIndexes`, enabling all resolutions to derive from height data without intermediate stored vecs ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_computer/src/indexes/mod.rs))
- Restructured `internal/` SDK from `single`/`multi` hierarchy to concept-oriented modules: `per_block/`, `per_tx/`, `algo/`, `transform/`, `containers/`, `indexes/` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_computer/src/internal/mod.rs))
- Moved `blocks/mining/` and `blocks/rewards/` into a dedicated top-level `mining/` module with `rewards/` and `hashrate/` sub-modules ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_computer/src/mining/mod.rs))
- Moved `market/indicators/` to a top-level `indicators/` module with expanded scope ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_computer/src/indicators/mod.rs))
- Renamed `price` module to `prices` with restructured sub-modules: `by_unit.rs` (multi-currency structs), `ohlcs.rs` (OHLC aggregation), `compute.rs` (oracle-based price computation) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_computer/src/prices/mod.rs))
- Renamed `cointime/pricing` to `cointime/prices` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_computer/src/cointime/prices/mod.rs))
- Renamed `distribution/address` to `distribution/addr` and `distribution/cohorts/address` to `distribution/cohorts/addr`
- Replaced all `Clone`-derived `Vecs` structs with generic `StorageMode` parameter (`Vecs<M: StorageMode = Rw>`) across every computation module (blocks, transactions, market, distribution, supply, etc.) for type-safe read-only sharing
- Removed `brk_fetcher` dependency — price computation is now fully on-chain via the oracle, eliminating exchange API calls (Binance, Kraken) and the 12-hour retry/HAR-import fallback logic
- Removed `traits/` module (pricing traits) and `utils.rs`
- `Computer::forced_import` no longer accepts a `Fetcher` parameter — signature simplified from `(path, indexer, fetcher)` to `(path, indexer)`
- Restructured all market sub-modules with new type-safe containers replacing ad-hoc naming: `price_1w_sma` → `sma._1w`, `price_ath` → `high`, `price_drawdown` → `drawdown`, `price_returns` → `periods`, `price_ago` → `price_past`, etc.
- Restructured ATH vecs: `price_ath` → `high.cents`, `price_drawdown` → `drawdown`, `days_since_price_ath` → `days_since`, `max_days_between_price_aths` → `max_days_between` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_computer/src/market/ath/vecs.rs))
- Restructured DCA vecs: split into `PeriodVecs` (stack, cost_basis, return, cagr, lump_sum) and `ClassVecs` (stack, cost_basis, return), removing explicit days-in-profit/loss and min/max return fields ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_computer/src/market/dca/vecs.rs))
- Restructured volatility vecs: replaced individual `price_Xw_volatility`, `sharpe_Xw`, `sortino_Xw` fields with `Windows<LazyPerBlock<StoredF32>>` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_computer/src/market/volatility/vecs.rs))
- Restructured returns vecs: replaced individual period fields with `ByLookbackPeriod<PercentPerBlock>`, added `sd_24h: Windows<StdDevPerBlock>` replacing explicit 1w/1m/1y standard deviation and downside fields ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_computer/src/market/returns/vecs.rs))
- Restructured range vecs: replaced 8 individual min/max price fields with `PriceMinMaxVecs` containing `min`/`max` groups, and added choppiness index as `PercentPerBlock` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_computer/src/market/range/vecs.rs))
- Restructured moving average vecs: split into `SmaVecs` and `EmaVecs` using `PriceWithRatioPerBlock<M>` for each period, added Mayer Multiple bands (`_200d_x2_4`, `_200d_x0_8`) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_computer/src/market/moving_average/vecs.rs))
- Restructured burned supply: merged `opreturn` and `unspendable` into single `total: AmountPerBlockCumulative` with inline computation ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_computer/src/supply/burned/vecs.rs))
- Restructured transaction volume: replaced `sent_sum`/`received_sum`/`annualized_volume` with single `transfer_volume: AmountPerBlockCumulativeRolling`, wrapped throughput metrics in `Windows<PerBlock>` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_computer/src/transactions/volume/vecs.rs))
- Removed `distribution/compute/aggregates.rs` — aggregate computation moved into metric tiers
- Removed `distribution/range_map.rs` — range mapping moved to `brk_types::RangeMap`

#### `brk_query`
- Renamed `address()`/`address_txids()`/`address_utxos()` methods to `addr()`/`addr_txids()`/`addr_utxos()` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_query/src/impl/addr.rs))
- Renamed `metrics` query module to `series` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_query/src/impl/series.rs))
- Removed `resolved.rs` — resolution handling moved inline

#### `brk_server`
- Renamed `/api/address/*` routes and `AddressRoutes` trait to `AddrRoutes` (redirects preserved from old paths) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_server/src/api/addrs/mod.rs))
- Renamed `/api/series/*` routes (previously `/api/metrics/*`) — legacy `/api/metrics/*` routes preserved as redirects ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_server/src/api/series/mod.rs))
- Removed `brk_fetcher` dependency
- Removed `Client` from `AppState` — server no longer holds a direct RPC client reference

#### `brk_client`
- Switched HTTP backend from `minreq` to `ureq`
- Removed `fetch_prices.rs` example

#### `brk_fetcher`
- Switched HTTP backend from `minreq` to `ureq`

#### `brk_rpc`
- Added `corepc` feature integrating `brk-corepc-client` and `brk-corepc-jsonrpc` as alternative RPC backends ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_rpc/Cargo.toml))

#### `brk_cohort`
- Renamed `AddressGroups` to `AddrGroups` with renamed fields: `ge_amount` → `over_amount`, `lt_amount` → `under_amount`, `ByGreatEqualAmount` → `OverAmount`, `ByLowerThanAmount` → `UnderAmount`, `ByAmountRange` → `AmountRange` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_cohort/src/addr.rs))
- Renamed `ByAgeRange` to `AgeRange` with renamed fields: `up_to_1h` → `under_1h`, `from_15y` → `over_15y` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_cohort/src/age_range.rs))
- Renamed file names from concatenated (`by_age_range.rs`, `by_amount_range.rs`) to snake_case (`age_range.rs`, `amount_range.rs`)

### New Features

#### `brk_computer`
- Added `indicators/` module computing on-chain indicators: Puell Multiple, RHODL Ratio, NVT Ratio, Thermocap Multiple, Supply-Adjusted CDD, Supply-Adjusted CYD, Supply-Adjusted Dormancy, Dormancy Flow, Stock-to-Flow, Seller Exhaustion Constant, and Gini coefficient ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_computer/src/indicators/compute.rs))
- Added `mining/` module with dedicated hashrate computations: hash rate with 1w/1m/2m/1y SMAs, hash rate ATH and drawdown, hash price and hash value per TH/s and PH/s, hash price/value minimums and rebound metrics ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_computer/src/mining/hashrate/compute.rs))
- Added `mining/rewards/` with coinbase rewards, subsidy, fee dominance, unclaimed rewards — each with block/cumulative/rolling views and sats/btc/usd units ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_computer/src/mining/rewards/compute.rs))
- Added `market/technical/` module implementing RSI with Stochastic RSI (RSI, StochRSI, K-line, D-line with configurable RMA/SMA periods) and MACD (fast/slow EMA, signal line, histogram) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_computer/src/market/technical/rsi.rs))
- Added Fenwick tree (Binary Indexed Tree) data structure supporting O(log N) point-update, prefix-sum, and multi-target kth walk-down queries ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_computer/src/internal/algo/fenwick.rs))
- Added `ExpandingPercentiles` tracker using Fenwick tree for O(log N) percentile queries with 0.1% resolution, supporting bulk-load initialization ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_computer/src/internal/algo/expanding_percentiles.rs))
- Added `CostBasisFenwick` — 4-field Fenwick tree (all_sats, sth_sats, all_usd, sth_usd) for per-block accurate cost basis percentiles, supply density queries (±5% of spot price), and profitability range computation across 25 ranges with all/STH splits ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_computer/src/distribution/cohorts/utxo/fenwick.rs))
- Added sliding distribution, sliding median, sliding window, and drawdown algorithms in `internal/algo/` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_computer/src/internal/algo/mod.rs))
- Added `Resolutions<T>` — a `PerResolution` of 15 `LazyAggVec` instances that lazily derive all supported resolutions from a single height-indexed source vec, using flat height-to-period mappings and a "last value in period" aggregation strategy ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_computer/src/internal/per_block/computed/resolutions.rs))
- Added `DerivedResolutions<T, S1T>` — doubly-lazy resolution system for `LazyPerBlock` that chains `UnaryTransform` on top of source resolutions, enabling zero-storage derived series at all 15 resolutions ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_computer/src/internal/per_block/lazy/derived_resolutions.rs))
- Added popularity-based resolution caching: `CachedVec` wrapping with a global budget of 256 slots, minimum 2 accesses before caching, and LRU eviction that replaces the least-accessed cached vec when a more popular one requests caching ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_computer/src/internal/cache_budget.rs))
- Added `prices/` module with `SplitByUnit` (open/high/low/close in USD/cents/sats), `OhlcByUnit`, and `PriceByUnit` structured types for multi-currency price access ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_computer/src/prices/by_unit.rs))
- Added `ProfitabilityMetrics` computing per-block supply, realized cap, unrealized PnL, and NUPL across 25 profitability ranges plus 14 profit thresholds and 9 loss thresholds, each with all/STH splits ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_computer/src/distribution/metrics/profitability.rs))
- Restructured distribution metrics into trait-based tiered system with `ActivityLike`, `RealizedLike`, `UnrealizedLike` trait hierarchies — each metric type has core/basic/minimal/full variants enabling flexible per-cohort metric composition ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_computer/src/distribution/metrics/cohort/mod.rs))
- Added `distribution/metrics/relative/` sub-module with 6 variants: `RelativeToAll`, `RelativeForAll`, `RelativeWithExtended`, `RelativeFull`, `RelativeExtendedOwnMarketCap`, `RelativeExtendedOwnPnl` for cohort-to-total ratio metrics ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_computer/src/distribution/metrics/relative/mod.rs))
- Added `distribution/addr/activity.rs` tracking per-block address activity counts (receiving, sending, reactivated, both) globally and per address type, with rolling averages ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_computer/src/distribution/addr/activity.rs))
- Added `distribution/addr/delta.rs` computing rolling address count deltas with change magnitude and basis-point rates ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_computer/src/distribution/addr/delta.rs))
- Added `distribution/state/pending.rs` with `PendingDelta`, `PendingCapDelta`, `PendingInvestorCapDelta` for batched cost basis state updates
- Added maturation tracking to age cohorts: `tick_tock_next_block` now returns `AgeRange<Sats>` tracking how many sats mature from each age range into the next older one per block, stored as `matured: AgeRange<AmountPerBlockCumulativeRolling>` on `UTXOCohorts` with cumulative and rolling window views for all 21 age ranges ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_computer/src/distribution/cohorts/utxo/tick_tock.rs))
- Added `pools/major.rs` and `pools/minor.rs` separating major pools (with cumulative rolling rewards and dominance rolling windows) from minor pools (blocks mined with cumulative rolling and dominance ratio) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_computer/src/pools/major.rs))
- Added `blocks/lookback.rs` for precomputed rolling window lookback start vectors used across all windowed computations
- Added `cache_budget.rs` system for managing memory cache allocation across vecs
- Added `tree.rs` example for inspecting the full series tree structure

#### `brk_types`
- Added 11 new resolution index types expanding from 8 resolutions (day, week, month, quarter, semester, year, decade, difficulty epoch) to 15: `Minute10`, `Minute30`, `Hour1`, `Hour4`, `Hour12` (sub-day — entirely new), `Day3`, `Month3`, `Month6` (new intermediate periods), `Year10` (replaces decade), plus renamed `Day1` (was DateIndex), `Week1` (was WeekIndex), `Month1` (was MonthIndex), `Year1` (was YearIndex), `Halving` (was HalvingEpoch), `Epoch` (was DifficultyEpoch) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_types/src/hour1.rs))
- Added `FromCoarser` trait enabling automatic derivation of finer-grained resolution data from coarser sources ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_types/src/from_coarser.rs))
- Added basis points types: `BasisPoints16`, `BasisPoints32`, `BasisPointsSigned16`, `BasisPointsSigned32` for precision ratio/percentage storage without floating point ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_types/src/basis_points_32.rs))
- Added `StoredI64` type for signed 64-bit stored values ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_types/src/stored_i64.rs))
- Added `RangeIndex` and `RangeMap` types for range-based lookups ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_types/src/range_index.rs))
- Added `SearchQuery` type for series full-text search ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_types/src/search_query.rs))
- Added `SeriesInfo` type carrying metadata about each data series ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_types/src/series_info.rs))
- Added `DataRange` as a dedicated type (previously inline) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_types/src/data_range.rs))
- Added `pools-v2.json` with expanded mining pool identification data
- Added `SeriesList` and `SeriesName` types for typed series enumeration

#### `brk_server`
- Added structured JSON error responses with RFC 9457-inspired format: `type` (error category), `code` (machine-readable), `message` (human-readable), `doc_url` (link to API docs) — covers all BRK error variants with proper HTTP status mapping ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_server/src/error.rs))
- Added `X-Response-Time` header (in microseconds) on all responses for latency observability
- Added Vary header consolidation middleware merging duplicate Vary headers into a single comma-separated value
- Added custom panic handler extracting panic messages into structured JSON error responses instead of empty 500s
- Added `ContentEncoding` module with server-side content encoding negotiation (zstd > br > gzip > identity) and transparent pre-compression of cached responses via brotli, flate2, and zstd ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_server/src/extended/encoding.rs))
- Added pre-compressed Brotli encoding for the Scalar API documentation viewer (`scalar.js.br`) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_server/src/api/scalar.js.br))
- Extracted `finish_openapi()` and `generate_bindings()` as public functions for external use ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_server/src/lib.rs))
- Made `ApiRoutes` trait public for external router composition

#### `brk_query`
- Added `list.rs` example for enumerating all available series names ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_query/examples/list.rs))

#### `brk_cohort`
- Added `ProfitabilityRange<T>` with 25 buckets from ">1000% in profit" to "90-100% in loss", with boundary prices computed dynamically from spot price via `compute_profitability_boundaries()` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_cohort/src/profitability_range.rs))
- Added `Profit<T>` with 14 aggregate "at least X% profit" thresholds (prefix sums over ranges) and `Loss<T>` with 9 aggregate "at least X% loss" thresholds (suffix sums over ranges) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_cohort/src/profit.rs))
- Added `AgeRange::from_array()` constructor for building age range structs from fixed-size arrays ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_cohort/src/age_range.rs))
- Derived `Traversable` on `AddrGroups` via proc macro (previously manual `Traversable` impl on `AddressGroups`)

#### `brk_traversable`
- Added `iter_any_visible()` method to the `Traversable` trait — allows structs to expose all vecs for disk operations while hiding some from the public series tree ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_traversable/src/lib.rs))
- Added `Traversable` impls for `LazyAggVec`, `LazyDeltaVec`, `ReadOnlyCompressedVec`, `ReadOnlyRawVec` — enabling lazy and read-only vecs to appear in the series tree

#### `brk_traversable_derive`
- Added `#[traversable(hidden)]` attribute at struct and field level — hidden structs return empty tree nodes and empty `iter_any_visible()` while still participating in `iter_any_exportable()` for disk I/O ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_traversable_derive/src/lib.rs))
- Added automatic `ReadOnlyClone` derive generation — the proc macro now generates `impl ReadOnlyClone` alongside `impl Traversable`, mapping `Rw` to `Ro` storage mode for all fields with `StorageMode` parameters
- Added multi-level `wrap` paths (`#[traversable(wrap = "a/b")]`) for creating nested tree structure
- Preserved struct field declaration order in tree key ordering (previously normal and flattened fields were separated)

#### `brk_oracle`
- Lowered `START_HEIGHT` from 575,000 to 550,000 — oracle begins computing 25,000 blocks earlier ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_oracle/src/lib.rs))

#### `brk_reader`
- Added timestamp-based pre-filtering in block decoding — blocks are skipped by header timestamp before computing block hash, avoiding expensive RPC calls for out-of-range blocks ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_reader/src/lib.rs))
- Added `find_magic()` function with XOR-decoded sliding window for blk file scanning, replacing byte-by-byte loop
- Replaced batch-based block decoding pipeline (accumulated blocks, sleep-based backpressure) with direct `par_bridge()` streaming — simpler, no sleep delays

#### `brk_bindgen`
- Added template-based pattern system with discriminator support — `try_detect_template()` handles suffix discriminators (e.g. `ratio_sd` vs `ratio_sd_4y`) and embedded discriminators (e.g. `ratio_pct99_bps` vs `ratio_pct1_bps`) for smarter client code generation ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.2.0/crates/brk_bindgen/src/analysis/positions.rs))
- Added two-pass field part analysis: first pass collects instance analyses bottom-up, second pass fills mixed-empty field parts using shortest leaf names
- Added `owned_expr()`, `disc_arg_expr()`, `template_expr()` to `LanguageSyntax` trait for language-specific discriminator formatting
- Fixed pattern normalization to only erase leaf types when all leaves share the same type (prevents incorrect genericization of mixed-type signatures)

#### `brk_client` (Rust)
- Switched HTTP backend from `minreq` to `ureq`
- Removed `fetch_prices.rs` example

#### `brk_client` (JavaScript)
- Added `tests/consistency.js` — verifies all series sharing the same index have the same length (catches stale state after reorg rollback)
- Upgraded `quickmatch` 0.3.1 → 0.4.0: expanded default separators (`_- :/`), added prefix indexing and compound word indexing (e.g. "hashrate" now matches "hash_rate"), added `minScore` threshold to reduce false positives, replaced per-match object allocation with pre-allocated `Uint32Array` scoring

#### `brk_client` (Python)
- Added `DateSeriesData` subclass with date-aware methods (`.dates()`, `.date_items()`, `.to_date_dict()`) — date-based indexes return `DateSeriesData`, non-date indexes return `SeriesData`
- Added new API methods: `get_series_data()`, `get_series_latest()`, `get_series_len()`, `get_series_version()`, `date_to_index()`
- Added `DetailedSeriesCount` with `distinct_series`, `total_endpoints`, `lazy_endpoints`, `stored_endpoints` fields
- Added `ErrorDetail`/`ErrorBody` types matching the server's structured error responses
- Range parameters now accept `date` and `datetime` objects in addition to integers

### Internal Changes

#### `brk_computer`
- Rewrote the `internal/` SDK: replaced the `single`/`multi` hierarchy (160+ files with per-combination types like `lazy_binary_computed_full`, `value_lazy_sum_cum`, `ComputedFromHeightAndDateLast`, `ComputedFromHeightSumCum`) with a composable system organized by concept (`per_block/`, `per_tx/`, `algo/`, `transform/`, `containers/`, `indexes/`). Concrete example: block count went from ~15 on-disk vecs (`ComputedFromHeightSumCum` + 4 rolling start vecs + 4 `ComputedFromHeightLast`) down to ~2 on-disk vecs (`PerBlockCumulativeRolling`) with all resolutions lazy
- Added `UnaryTransform` trait system in `internal/transform/` replacing ad-hoc closures: `arithmetic.rs`, `bps.rs`, `currency.rs`, `derived.rs`, `ratio.rs`, `specialized.rs`
- Added container types in `internal/containers/`: `per_resolution`, `windows`, `windows_from_1w`, `windows_to_1m`, `window_24h`, `distribution_stats`, `constant`, `percent`
- Added per-block type variants: `PerBlock`, `PerBlockFull`, `PerBlockCumulative`, `PerBlockCumulativeWithSums`, `PerBlockRolling`, `PerBlockAggregated`, `LazyPerBlock`, `LazyPerBlockRolling`, plus `AmountPerBlock`, `AmountPerBlockCumulative`, `AmountPerBlockCumulativeRolling`, `AmountPerBlockWithDeltas`, `FiatPerBlock`, `PercentPerBlock`, `RatioPerBlock`, `PerBlockRollingAverage`, `PercentRollingWindows`, `PriceWithRatioPerBlock`, `StdDevPerBlock`
- Added rolling types: `RollingComplete`, `LazyRollingComplete`, `RollingDistribution`, `LazyRollingSums`, `LazyRollingDeltasFromHeight`
- Added per-tx types: `PerTxDerived`, `PerTxDistribution`, `LazyPerTxDerived`, `LazyPerTxDistribution`, `LazyPerTxDistributionTransformed`
- Added eager/lazy index helpers in `internal/indexes/`
- Introduced `CachedWindowStarts` for shared precomputed lookback window start positions across all modules
- Split distribution UTXO cohort vecs into `core.rs`, `minimal.rs`, `type.rs` sub-modules for tiered storage
- Added `sum_others` macro in distribution metrics for computing aggregate cohort fields by summing constituent cohorts
- Removed `brk_fetcher` dependency — oracle prices are computed directly in the `prices/` module
- Removed `distribution/compute/aggregates.rs` — aggregate computation replaced by `compute_from_stateful` / `compute_sum_of_others` within each metric tier

#### `brk_indexer`
- Bumped reindex version 24 → 25 (forces full reindex on upgrade)
- Added `StorageMode` generic parameter on `Indexer<M>` and `Vecs<M>` with `ReadOnlyClone` impl producing `Indexer<Ro>` for type-safe read-only sharing
- Parallelized block processing pipeline: inputs and outputs now processed in parallel via `rayon::join`, finalization of outputs+inputs runs in parallel with tx metadata storage
- Added `BlockBuffers` struct with reusable `FxHashMap`/`FxHashSet` allocations cleared per block, eliminating per-block allocation overhead
- Added `AddrTypeVecs<I, B>` and `ScriptTypeVecs<I>` generic sub-structs for uniform per-type vec organization, replacing individually named fields
- Added `TxMetadataVecs` sub-struct with `split_for_finalize()` for separating tx metadata vecs from index vecs during parallel finalization
- Added `AddrReaders` with `script_pubkey(&self, output_type, type_index) -> ScriptBuf` for typed address-to-script lookup
- Block size and weight now computed from pre-computed `ComputedTx.base_size`/`total_size` fields instead of re-serializing transactions
- Removed 512MB thread stack size workaround — main function runs directly
- Added `schemars` and `serde` dependencies for OpenAPI-compatible schema generation

#### `brk_server`
- Applied `NormalizePathLayer` as an outer wrapping layer (via `ServiceExt`) instead of an inner router layer, fixing route matching for trailing slashes
- Reduced in-memory response cache from 5,000 to 1,000 entries
- Moved `CatchPanicLayer` after compression in the middleware stack with a custom handler
- Restructured response caching to include content encoding in cache keys, pre-compressing responses per-encoding for cache-friendly serving
- Added `brotli`, `flate2`, and `zstd` dependencies for server-side compression
- Added `color-eyre` for panic reporting

#### `brk_query`
- Removed thread stack-size workaround in the query example — main function now runs directly
- Added `parking_lot` and `serde_json` dependencies

#### `brk_rpc`
- Added `serde` and `serde_json` dependencies for `corepc` feature

#### `brk_store`
- Removed `insert_if_needed()` and `remove_if_needed()` — callers now use plain `insert()`/`remove()`
- Changed `clear_caches()` to drop allocations entirely (`FxHashMap::default()`) instead of clearing in place

#### `brk_reader`
- Removed batch-based block decoding pipeline — simplified to streaming `par_bridge()`
- Removed `AnyBlock` enum, replaced with `decode_block()` standalone function
- Added `find_magic()` with XOR-decoded sliding window for efficient blk file scanning

#### `brk_logger`
- Replaced `EnvFilter` with `Targets` for simpler log filter configuration
- Separated `LOG` (default level) from `RUST_LOG` (full directive control) environment variables
- Added `corepc=off` to default filter list

#### `brk_error`
- Added `brk-corepc-client` and `ureq` error conversions, removed `minreq` error conversions

#### `brk_cli`
- Removed `--fetch` CLI flag and `brk_fetcher` dependency — price fetching handled by the oracle
- Removed 512MB thread stack size workaround

#### `docker`
- Switched base image from `rustlang/rust:nightly` to `rust:1.93-bookworm` (stable, pinned)
- Replaced `pgrep + nc` healthcheck with `curl -sf http://localhost:3110/health`
- Removed `docker-build.sh` helper script and docker-specific `.dockerignore`
- Removed all `environment:` variables from `docker-compose.yml` — configuration now via `command:` args only

#### `scripts`
- Added `pool_major_threshold.py` — utility to determine major vs minor pool classification based on rolling dominance thresholds across multiple time windows

#### `workspace`
- Upgraded Rust toolchain to edition 2024
- Updated `.dockerignore` to exclude `docker/` directory

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.1.9...v0.2.0)

## [v0.1.9](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.1.9) - 2026-02-13

### New Features

#### `brk`
- Added `oracle` feature flag re-exporting `brk_oracle` from the `brk` umbrella crate, making the on-chain price oracle available via `brk::oracle` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.9/crates/brk/src/lib.rs))
- Added `brk_oracle` to the crates table in the umbrella crate README ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.9/crates/brk/README.md))

### Internal Changes

#### `brk`
- Added `brk_oracle` to the Rust publish script ordering ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.9/scripts/rust-publish.sh))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.1.8...v0.1.9)

## [v0.1.8](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.1.8) - 2026-02-13

### Breaking Changes

#### `brk_types`
- Renamed `Sats::is_round_btc()` to `is_common_round_value()` and rewrote the algorithm: replaces a hardcoded array of 19 specific round sat values with a general integer-based approach using `ilog10()` to detect any value matching `d × 10^n` where `d ∈ {1, 2, 3, 5, 6}` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.8/crates/brk_types/src/sats.rs))

#### `brk_server`
- Renamed `CacheStrategy::MaxAge(u64)` to `CacheStrategy::MempoolHash(u64)`, switching mempool endpoints from time-based `Cache-Control: max-age=N` to content-addressed ETags derived from the next projected block hash ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.8/crates/brk_server/src/cache.rs))

### New Features

#### `brk_oracle`
- Added new `brk_oracle` crate: a pure on-chain BTC/USD price oracle that derives the bitcoin price from round-dollar transaction output patterns ($1, $5, $10, ... $10,000) without any exchange data ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.8/crates/brk_oracle/src/lib.rs))
- Algorithm maps outputs to a log-scale histogram (2,400 bins, 200 per decade), smooths with an EMA over a 12-block ring buffer, then slides a 19-point stencil representing round-dollar spikes to find the best-fit price with parabolic sub-bin interpolation
- Operates from height 575,000 (May 2019) onward; pre-oracle exchange prices for heights 0–630,000 included in `prices.txt` for bootstrapping
- Median per-block error 0.10%, 95th percentile 0.55%; zero blocks exceed 10% error since 2022
- Inspired by UTXOracle by @SteveSimple, with per-block resolution, single-pass stencil scoring, and rolling EMA operation

#### `brk_computer`
- Enabled oracle price computation with full OHLC data at all period levels (date, week, month, quarter, semester, year, decade, height, difficulty epoch) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.8/crates/brk_computer/src/price/oracle/compute.rs))
- Added `live_oracle()` method that seeds an oracle from the last committed price and replays recent blocks for real-time price estimation ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.8/crates/brk_computer/src/price/oracle/compute.rs))
- Added `market_cap_growth_rate` metric: 365-day percentage change of market cap ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.8/crates/brk_computer/src/supply/vecs.rs))
- Added `realized_cap_growth_rate` metric: 365-day percentage change of realized cap
- Added `cap_growth_rate_diff` metric: lazy difference between market cap and realized cap growth rates
- Added net sentiment computation for UTXO cohorts: computes greed minus pain per separate cohort, weighted average for aggregate cohorts, and dateindex for all cohorts ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.8/crates/brk_computer/src/distribution/cohorts/utxo/groups.rs))

#### `brk_server`
- Added server-side response caching via `get_or_insert()` on `AppState`, backed by `quick_cache` with 50ms guard timeout for request deduplication ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.8/crates/brk_server/src/state.rs))
- Added `GET /api/mempool/price` endpoint returning the current BTC/USD price in dollars, derived from on-chain round-dollar output patterns in the last 12 blocks plus mempool ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.8/crates/brk_server/src/api/mempool/mod.rs))
- Added `CF-Connecting-IP` header detection for requests arriving from loopback addresses through Cloudflare, rewriting the socket address to apply non-loopback rate limits ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.8/crates/brk_server/src/lib.rs))
- Switched address mempool endpoint to content-based cache invalidation using a hash of the address's mempool state

#### `brk_query`
- Added `live_price()` method returning the oracle-derived BTC/USD price, seeded from the last committed price with replay of the last window of blocks and mempool transactions ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.8/crates/brk_query/src/impl/price.rs))
- Added `address_mempool_hash()` method returning a `u64` hash of an address's mempool state for content-based cache invalidation ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.8/crates/brk_query/src/impl/address.rs))

#### `brk_mempool`
- Added `Snapshot::next_block_hash()` returning a hash of the first projected block for content-based cache keys ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.8/crates/brk_mempool/src/projected_blocks/snapshot.rs))
- Added `Sync::next_block_hash()` and `Sync::address_hash()` for exposing content hashes at the sync layer ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.8/crates/brk_mempool/src/sync.rs))

#### `brk_types`
- Derived `Hash` on `Sats` for use in content-based cache invalidation ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.8/crates/brk_types/src/sats.rs))
- Derived `Hash` on `AddressMempoolStats` for per-address mempool hashing ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.8/crates/brk_types/src/addressmempoolstats.rs))

#### `brk_client`
- Added `get_live_price()` method for the `/api/mempool/price` endpoint ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.8/crates/brk_client/src/lib.rs))
- Added `MetricsTree_Price_Oracle` struct exposing oracle price metrics (`price_cents`, `ohlc_cents`, `split`, `ohlc`, `ohlc_dollars`)
- Added `market_cap_growth_rate`, `realized_cap_growth_rate`, and `cap_growth_rate_diff` fields to `MetricsTree_Supply`

#### `website`
- Replaced Kraken WebSocket price feed with HTTP polling to the oracle-based `/api/mempool/price` endpoint every 5 seconds, with re-poll on tab visibility change ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.8/website/scripts/utils/price.js))
- Added Oracle candlestick chart under the Market section showing on-chain derived BTC/USD price ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.8/website/scripts/options/market.js))
- Expanded Capitalization into a tree with Market Cap, Realized Cap, and Growth Rate sub-charts showing market cap growth rate, realized cap growth rate, and their difference
- Added dynamic color assignment via `at(index, length)` for palette-aware spacing and `seq(keys)` for named color maps, replacing hardcoded color mappings across all chart options ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.8/website/scripts/utils/colors.js))

### Internal Changes

#### `brk_computer`
- Flattened supply submodules (`circulating/`, `inflation/`, `market_cap/`) into the parent supply module, inlining their logic directly into `vecs.rs`, `import.rs`, and `compute.rs` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.8/crates/brk_computer/src/supply/mod.rs))
- Changed `CostBasisDistribution::serialize_iter` to accept `merged.into_iter()` and write to a path variable

#### `brk_server`
- Centralized response caching in `state.rs` with `cached_json()`, `cached_text()`, and `cached_bytes()` now accepting a `Uri` parameter for server-side cache keying, removing per-handler `GuardResult` boilerplate
- Removed `ResponseExtended::new_text_cached()` and `new_bytes_cached()` in favor of inline handling in the state caching methods
- Updated all API handlers to destructure `State(state)` and pass `&uri` for cache keying

#### `website`
- Split monolithic `components.css` into separate files: `main.css`, `nav.css`, `search.css`, `chart.css` for better organization
- Converted chart option `top` and `bottom` properties from eager values to lazy functions with memoized evaluation for faster startup ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.8/website/scripts/options/full.js))
- Refactored chart component: simplified pane management, converted legends from named object to array, consolidated time data into a single object with `setIndex()` and `fetch()` methods ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.8/website/scripts/chart/index.js))
- Optimized navigation highlight tracking to only clear previously highlighted items instead of iterating all entries
- Removed shadow divs from HTML and `<div id="simulation">` pane
- Removed unused utility files (`ws.js`, `date.js`, `serde.js`) and functions (`range()`, `numberToDollars()`, `numberToPercentage()`, `createShadow()`, `localhost`)

#### `clients`
- Bumped JavaScript and Python client versions

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.1.7...v0.1.8)

## [v0.1.7](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.1.7) - 2026-02-07

### New Features

#### `brk_computer`
- Added `lower_price_band` metric per cohort, computed as realized_price² / investor_price, representing a floor price estimate ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.7/crates/brk_computer/src/distribution/metrics/realized.rs))
- Added `upper_price_band` metric per cohort, computed as investor_price² / realized_price, representing a ceiling price estimate
- Added `LazyBinaryPriceFromHeight` composite type for fully lazy binary price metrics providing both USD and sats representations at all time levels ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.7/crates/brk_computer/src/internal/multi/from_height/lazy_binary_price.rs))
- Added `DollarsSquaredDivide` binary transform implementing `a² / b` for Dollars values ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.7/crates/brk_computer/src/internal/single/transform/dollars_squared_divide.rs))

#### `brk_types`
- Added `Log200` variant to `CostBasisBucket` for logarithmic bucketing with 200 buckets per decade ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.7/crates/brk_types/src/cost_basis_bucket.rs))
- Added `From<CentsSigned> for i128` and `From<i128> for CentsSigned` conversions for wider arithmetic operations ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.7/crates/brk_types/src/cents_signed.rs))

#### `brk_website`
- Added ETag-based HTTP 304 Not Modified responses for HTML pages in release mode, reducing bandwidth by returning empty body when content hasn't changed ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.7/crates/brk_website/src/handlers.rs))
- Compute and cache a hash-based ETag for index.html on first request, used for subsequent conditional requests ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.7/crates/brk_website/src/website.rs))

#### `website`
- Added upper price band (I²/R) and lower price band (R²/I) series to the price comparison chart ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.7/website/scripts/options/distribution/prices.js))

### Bug Fixes

#### `brk_types`
- Fixed unrealized value calculation in cost basis distribution to compute `(spot - cost_basis) × supply` instead of `spot × supply`, correctly reflecting unrealized profit/loss per bucket ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.7/crates/brk_types/src/cost_basis_distribution.rs))
- Fixed `Dollars * Sats` multiplication to use `i128` intermediate values, preventing overflow on large values ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.7/crates/brk_types/src/dollars.rs))

### Internal Changes

#### `brk_computer`
- Moved price rounding logic and unrealized state cache from `CohortState` into `CostBasisData`, encapsulating all cost basis concerns in a single structure ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.7/crates/brk_computer/src/distribution/state/cost_basis/data.rs))
- Added `compute_unrealized_states()` method on `CostBasisData` that combines cache management and unrealized computation in one call
- Removed `CachedUnrealizedState` from public API, making it `pub(super)` only
- Removed `range()` method from `CostBasisData` (unrealized computation now accesses the map directly)
- Added binary transform constructors (`from_block_last_and_lazy_block_last`, `from_lazy_block_last_and_block_last`, `from_binary`) across height, date, and height-derived lazy metric levels to support mixed computed/lazy binary operations

#### `website`
- Changed shared time data type from `number[]` to `MetricData<number>` throughout the chart system, propagating stamp metadata alongside data
- Added `lastTimeStamp` tracking to prevent redundant chart updates when time data hasn't changed

#### `clients`
- Bumped JavaScript and Python client versions

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.1.6...v0.1.7)

## [v0.1.6](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.1.6) - 2026-02-05

### New Features

#### `brk_types`
- Added `CostBasisDistribution` struct with pco-compressed serialization/deserialization for storing price-to-sats distributions, and a `format()` method supporting bucket aggregation and value type transformation ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.6/crates/brk_types/src/cost_basis_distribution.rs))
- Added `CostBasisBucket` enum with 7 aggregation strategies: `raw` (no aggregation), `lin200`/`lin500`/`lin1000` (linear buckets by dollar amount), and `log10`/`log50`/`log100` (logarithmic buckets per decade) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.6/crates/brk_types/src/cost_basis_bucket.rs))
- Added `CostBasisValue` enum with three output modes: `supply` (BTC at each price), `realized` (USD cost basis), `unrealized` (USD at spot price) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.6/crates/brk_types/src/cost_basis_value.rs))
- Added `Cohort`, `CostBasisParams`, `CostBasisCohortParam`, and `CostBasisQuery` types for cost basis API path and query parameters ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.6/crates/brk_types/src/cost_basis_params.rs))
- Added `round_to()` and `round_to_dollar()` methods on `CentsUnsigned` and `CentsUnsignedCompact` for rounding prices to N significant digits ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.6/crates/brk_types/src/cents_unsigned.rs))
- Implemented `FromStr` for `Date` type enabling parsing from "YYYY-MM-DD" format ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.6/crates/brk_types/src/date.rs))

#### `brk_computer`
- Added daily cost basis snapshot writing for all, sth, and lth UTXO cohorts, persisting the merged price-to-sats distribution to disk per date for historical querying ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.6/crates/brk_computer/src/distribution/cohorts/utxo/groups.rs))
- Added configurable price rounding for cost basis data: UTXO cohorts use 5 significant digits and address cohorts use 4 significant digits, reducing unique price points for more efficient storage and aggregation ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.6/crates/brk_computer/src/distribution/state/cohort/base.rs))

#### `brk_query`
- Added cost basis query methods: `cost_basis_cohorts()` to list available cohorts, `cost_basis_dates()` to list available dates per cohort, `cost_basis_distribution()` to retrieve raw data, and `cost_basis_formatted()` to get bucketed/value-transformed output ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.6/crates/brk_query/src/impl/cost_basis.rs))

#### `brk_server`
- Added three new API endpoints for cost basis distribution: `GET /api/metrics/cost-basis` (list cohorts), `GET /api/metrics/cost-basis/{cohort}/dates` (list dates), and `GET /api/metrics/cost-basis/{cohort}/{date}?bucket=&value=` (get distribution data) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.6/crates/brk_server/src/api/metrics/mod.rs))

#### `brk_client`
- Added `get_cost_basis_cohorts()`, `get_cost_basis_dates()`, and `get_cost_basis()` methods to the Rust client for querying cost basis distributions ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.6/crates/brk_client/src/lib.rs))

#### `brk_bindgen`
- Added wildcard (`*`) and `Object` type mapping to `serde_json::Value` in Rust type generation ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.6/crates/brk_bindgen/src/generators/rust/types.rs))

### Bug Fixes

#### `website`
- Fixed chart range restoration on Safari by wrapping the range-set logic in `requestAnimationFrame` for browser compatibility ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.6/website/scripts/chart/index.js))

### Internal Changes

#### `brk_computer`
- Reorganized cost basis state storage: height-based snapshots now stored under `by_height/` subdirectory, renamed `cost_basis_data` module to `data`
- Moved pco compression dependency from `brk_computer` to `brk_types` for reuse across crates
- Refactored the K-way merge in aggregate percentile computation to collect merged entries with price deduplication during the merge pass

#### `brk_error`
- Added `pco` feature flag and `Pco` error variant for pco compression errors ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.6/crates/brk_error/src/lib.rs))

#### `workspace`
- Added `*.csv` to `.gitignore`

#### `clients`
- Bumped JavaScript and Python client versions

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.1.5...v0.1.6)

## [v0.1.5](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.1.5) - 2026-02-05

### New Features

#### `website`
- Added in-memory data cache for chart metric and time data, enabling instant visual feedback when switching between chart indexes without re-fetching from the server ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.5/website/scripts/chart/index.js))
- Implemented cache-first loading strategy: cached data is rendered immediately while fresh data is fetched in the background, making index switching feel instantaneous

### Bug Fixes

#### `website`
- Fixed URL range being overwritten during chart initialization by adding an `initialLoadComplete` guard that prevents range persistence until the first data load completes, and resets on rebuild ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.5/website/scripts/chart/index.js))
- Fixed temporal dead zone (TDZ) error by moving zoom handler registration (`onZoomChange.add`) to after series creation instead of before it ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.5/website/scripts/chart/index.js))

### Internal Changes

#### `website`
- Simplified showLine visibility calculation to use the already-tracked `visibleBarsCount` variable instead of re-reading the visible logical range from the chart

#### `clients`
- Bumped JavaScript and Python client versions

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.1.4...v0.1.5)

## [v0.1.4](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.1.4) - 2026-02-04

### Breaking Changes

#### `brk_computer`
- Changed VOCDD (Value of Coin Days Destroyed) calculation to be supply-adjusted: `price × (CDD / circulating_supply)` instead of `price × CDD`, accounting for growing supply over time ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.4/crates/brk_computer/src/cointime/value/compute.rs))
- Changed Reserve Risk calculation to use 365-day rolling median instead of 365-day SMA for VOCDD smoothing, providing more robust values resistant to outliers ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.4/crates/brk_computer/src/cointime/reserve_risk/vecs.rs))
- Changed `net_sentiment` computation for aggregate cohorts to use capital-weighted average of component cohorts instead of simple greed - pain formula, producing values that properly represent the weighted contribution of each cohort ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.4/crates/brk_computer/src/distribution/metrics/mod.rs))
- Changed drawdown computation formula from `(ath - current) / ath * -100` to `(current - ath) / ath * 100`, where positive values now indicate performance above ATH and negative values indicate drawdown below ATH ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.4/crates/brk_computer/src/traits/mod.rs))

### New Features

#### `brk_computer`
- Added `hash_rate_ath` metric tracking the all-time high hash rate at each block ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.4/crates/brk_computer/src/blocks/mining/vecs.rs))
- Added `hash_rate_drawdown` metric showing percentage drawdown from hash rate all-time high ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.4/crates/brk_computer/src/blocks/mining/compute.rs))
- Added `_30d_change` metric for all address type counts (p2pkh, p2sh, p2wpkh, p2wsh, p2tr, p2pk33, p2pk65, p2a), tracking 30-day percentage change in address counts ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.4/crates/brk_computer/src/distribution/address/address_count.rs))
- Added `utxo_count_30d_change` metric to OutputsMetrics tracking 30-day percentage change in UTXO count per cohort ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.4/crates/brk_computer/src/distribution/metrics/outputs.rs))

#### `brk_types`
- Added `From<StoredU64>` conversion for `StoredF64` enabling direct u64 to f64 stored value conversion ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.4/crates/brk_types/src/stored_f64.rs))

### Internal Changes

#### `brk_computer`
- Generalized `ComputeDrawdown` trait to work with any value types convertible to f64, not just `Close<Dollars>` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.4/crates/brk_computer/src/traits/mod.rs))
- Removed `NegRatio32` transform (no longer needed after drawdown formula change) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.4/crates/brk_computer/src/internal/single/transform/mod.rs))
- Separated net_sentiment computation into `compute_net_sentiment_height` for separate cohorts and `compute_net_sentiment_from_others` for aggregate cohorts ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.4/crates/brk_computer/src/distribution/metrics/unrealized.rs))
- Added `AddrCountVecs` struct grouping address count with its 30d_change metric ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.4/crates/brk_computer/src/distribution/address/address_count.rs))
- Refactored aggregate UTXO cohort computation with `for_each_aggregate` helper method for cleaner code organization
- Added unit tests for HODL Bank and Reserve Risk formula verification ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.4/crates/brk_computer/src/cointime/reserve_risk/compute.rs))

#### `brk_indexer`
- Removed debug logging from transaction metadata storage for cleaner logs ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.4/crates/brk_indexer/src/processor/tx.rs))

#### `website`
- Reorganized chart options into new module structure with dedicated files for activity, profitability, cost-basis, holdings, prices, and valuation
- Consolidated color utilities into `website/scripts/utils/colors.js` module

#### `clients`
- Bumped JavaScript and Python client versions

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.1.3...v0.1.4)

## [v0.1.3](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.1.3) - 2026-02-03

### Breaking Changes

#### `brk_types`
- Renamed `LoadedAddressIndex` to `FundedAddressIndex` throughout the codebase ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.3/crates/brk_types/src/fundedaddressindex.rs))
- Renamed `LoadedAddressData` to `FundedAddressData` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.3/crates/brk_types/src/fundedaddressdata.rs))
- Renamed `OHLCCents` to `OHLCCentsUnsigned` for consistency with unsigned cents types ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.3/crates/brk_types/src/ohlc.rs))
- Removed `Cents`, `CentsCompact`, and `CentsSignedCompact` types (consolidated into unsigned variants)

### New Features

#### `brk_types`
- Added `SatsSigned` type (i64-based) for signed satoshi values used in changes, deltas, and profit/loss calculations ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.3/crates/brk_types/src/sats_signed.rs))
- Added `CentsSats` type (u128-based) for price × sats calculations with widening multiplication to prevent overflow ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.3/crates/brk_types/src/cents_sats.rs))
- Added `CentsSquaredSats` type (u128-based) for price² × sats calculations used in investor cap metrics ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.3/crates/brk_types/src/cents_squared_sats.rs))

#### `brk_computer`
- Added `investor_price` metric - dollar-weighted average acquisition price with both USD and sats representations ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.3/crates/brk_computer/src/distribution/metrics/realized.rs))
- Added `cap_raw` metric storing raw Σ(price × sats) for precise realized cap aggregation across cohorts
- Added `investor_cap_raw` metric storing raw Σ(price² × sats) for precise investor_price aggregation
- Added `realized_profit_7d_ema`, `realized_loss_7d_ema`, and `net_realized_pnl_7d_ema` metrics for smoothed realized PnL analysis
- Added `profit_value_created` and `profit_value_destroyed` metrics splitting value flows by profit transactions
- Added `loss_value_created` and `loss_value_destroyed` metrics splitting value flows by loss transactions
- Added `capitulation_flow` as a lazy alias for loss_value_destroyed (coins sold at a loss)
- Added `profit_flow` as a lazy alias for profit_value_created (coins sold at a profit)
- Added `peak_regret` metric: Σ((peak - sell_price) × sats) measuring how much more could have been made by selling at peak ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.3/crates/brk_computer/src/distribution/metrics/realized.rs))
- Added `peak_regret_rel_to_realized_cap` expressing peak regret as percentage of realized cap
- Added `invested_capital_in_profit` and `invested_capital_in_loss` metrics tracking cost basis of UTXOs by profit/loss status ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.3/crates/brk_computer/src/distribution/metrics/unrealized.rs))
- Added raw aggregation values for unrealized metrics: `invested_capital_in_profit_raw`, `invested_capital_in_loss_raw`, `investor_cap_in_profit_raw`, `investor_cap_in_loss_raw`
- Added `pain_index` metric: investor_price_of_losers - spot, measuring average distance underwater weighted by USD invested
- Added `greed_index` metric: spot - investor_price_of_winners, measuring average distance in profit weighted by USD invested
- Added `net_sentiment` metric: greed_index - pain_index, positive values indicate greedy market, negative indicate painful market
- Added `unrealized_peak_regret` metric for age-range UTXO cohorts
- Added `invested_capital` percentiles providing USD-weighted cost basis distribution (complementing sat-weighted percentiles) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.3/crates/brk_computer/src/distribution/metrics/cost_basis.rs))
- Added `spot_cost_basis_percentile` metric showing what percentile of cost basis is below current spot price (sat-weighted)
- Added `spot_invested_capital_percentile` metric showing what percentile of invested capital is below current spot price (USD-weighted)
- Added `ValueChangeFromDate` module for computing N-day value changes stored as signed sats ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.3/crates/brk_computer/src/internal/multi/from_date/value_change.rs))
- Added `LazyValueChangeDateDerived` module for lazy computation of bitcoin and dollar values from signed sats changes ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.3/crates/brk_computer/src/internal/multi/from_date/value_change_derived.rs))
- Added `LazyPriceFromCents` module providing lazy price wrapper with both USD and sats representations from a cents base ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.3/crates/brk_computer/src/internal/multi/from_height/lazy_price_from_cents.rs))
- Added `CentsUnsignedToDollars` transform for converting cents to dollars ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.3/crates/brk_computer/src/internal/single/transform/cents_unsigned_to_dollars.rs))
- Added `CentsUnsignedToSatsFract` transform for converting cents to sats exchange rate ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.3/crates/brk_computer/src/internal/single/transform/cents_unsigned_to_sats_fract.rs))

#### `brk_cohort`
- Added `compute_relative()` method to `Filter` that returns false for edge-case output types (Empty, P2MS, Unknown) which have insufficient volume for meaningful ratio analysis ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.3/crates/brk_cohort/src/filter.rs))

### Internal Changes

#### `brk_computer`
- Replaced `PriceToAmount` struct with `CostBasisData` providing more efficient storage with raw cap and investor_cap values for precise aggregation ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.3/crates/brk_computer/src/distribution/state/cost_basis/cost_basis_data.rs))
- Added `Percentiles` struct that computes both sat-weighted and USD-weighted percentiles in a single pass ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.3/crates/brk_computer/src/distribution/state/cost_basis/percentiles.rs))
- Changed `UnrealizedState` to use `CentsUnsigned` instead of `Dollars` for unrealized profit/loss values
- Changed `realized_cap` to derive from `realized_cap_cents` via lazy transform for consistent precision
- Aggregate percentile computation now supports both sat-weighted and USD-weighted metrics with spot price parameter
- Removed `ClosePriceTimesRatio` transform (functionality consolidated into other transforms)

#### `brk_bindgen`
- Added pattern deduplication by name to prevent duplicate patterns when different signatures normalize to the same name ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.3/crates/brk_bindgen/src/analysis/patterns.rs))
- Changed to BTreeMap/BTreeSet for deterministic pattern generation order
- Changed pattern naming to generate stable names from first word of each field (deduped, sorted)

#### `brk_fetcher`
- Changed return types from `OHLCCents` to `OHLCCentsUnsigned` for consistency ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.3/crates/brk_fetcher/src/lib.rs))

#### `brk_traversable`
- Changed `TreeNode::Branch` internal storage from `BTreeMap` to `IndexMap` to preserve insertion order in API tree responses ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.3/crates/brk_traversable/src/lib.rs))

#### `website`
- Removed `website/scripts/options/market/` subdirectory structure (averages.js, bands.js, index.js, investing.js, momentum.js, onchain.js, performance.js, volatility.js)
- Consolidated market options into top-level `market.js` and `investing.js` files
- Added new `mining.js` and `network.js` option modules
- Removed `chain.js` module

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.1.2...v0.1.3)

## [v0.1.2](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.1.2) - 2026-01-29

### New Features

#### `brk_bindgen`
- Added `indexToDate(index, i)` and `isDateIndex(index)` helper functions to JavaScript client for converting index values to Date objects ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_bindgen/src/generators/javascript/client.rs))
- Added `index_to_date(index, i)` and `is_date_index(index)` helper functions to Python client ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_bindgen/src/generators/python/client.rs))
- Added rich helper methods to JavaScript `MetricData` response object:
  - `dates()` - convert index range to Date array
  - `indexes()` - get index range as number array
  - `toDateMap()` / `toIndexMap()` - convert to Map keyed by date or index
  - `dateEntries()` / `indexEntries()` - get as `[key, value]` pair arrays
  - `iter()` / `iterDates()` - generator functions for iteration
  - `[Symbol.iterator]()` - enable `for...of` loop support
- Added rich helper methods to Python `MetricData` dataclass:
  - `dates()` - convert index range to date list
  - `indexes()` - get index range as list
  - `to_date_dict()` / `to_index_dict()` - convert to dict
  - `date_items()` / `index_items()` - get as tuple lists
  - `iter()` / `iter_dates()` - iterators for (index, value) or (date, value)
  - `to_polars(with_dates)` / `to_pandas(with_dates)` - convert to DataFrame with optional date column
- Added `index` field to MetricData JSON response indicating the index type used for the query

#### `brk_types`
- Added `CentsSigned` type (i64-based) for signed cent values used in profit/loss calculations ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_types/src/cents_signed.rs))
- Added `CentsSignedCompact` type (i32-based) for memory-efficient signed cents in map keys ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_types/src/cents_signed_compact.rs))
- Added `CentsUnsigned` type (u64-based) for unsigned cent values used in invested capital and realized cap ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_types/src/cents_unsigned.rs))
- Added `CentsUnsignedCompact` type (u32-based) for memory-efficient unsigned cents ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_types/src/cents_unsigned_compact.rs))
- Added `is_date_based()` method to `Index` enum to check if an index type represents dates ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_types/src/index.rs))
- Added `index_to_date(i)` method to `Index` enum for converting index values to `Date` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_types/src/index.rs))
- Added `From` implementations to convert date-based index types (`WeekIndex`, `MonthIndex`, `YearIndex`, `QuarterIndex`, `SemesterIndex`, `DecadeIndex`) to `Date` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_types/src/date.rs))

#### `brk_computer`
- Added `invested_capital_in_profit` and `invested_capital_in_loss` fields to `UnrealizedState` for tracking cost basis of positions ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_computer/src/distribution/state/cost_basis/unrealized.rs))

#### `brk_server`
- Added higher API weight limit (50MB) for localhost requests compared to remote requests (650KB) to support larger local data queries ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_server/src/api/metrics/mod.rs))

#### `brk_logger`
- Added `LOG` environment variable support for simple log level control (e.g., `LOG=debug brk`) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_logger/src/lib.rs))

#### `brk_cli`
- Added `ENVIRONMENT` and `CONFIG` sections to help output documenting `LOG`/`RUST_LOG` variables and config file location ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_cli/src/config.rs))

#### `workspace`
- Added GitHub Actions workflow to check for outdated dependencies daily ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/.github/workflows/outdated.yml))
- Added SIMD instruction flags (BMI1, BMI2, AVX2) for x86_64 targets to accelerate pcodec decompression ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/.cargo/config.toml))

### Bug Fixes

#### `brk_indexer`
- Fixed rollback consistency: deduplicate `addressindex_txindex` removals to prevent double deletion when same address appears multiple times in a transaction ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_indexer/src/stores.rs))
- Fixed rollback cache consistency: clear txid caches after rollback to prevent stale reads ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_indexer/src/stores.rs))

#### `brk_computer`
- Fixed rollback recovery to use actual consistent height instead of target height for state imports ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_computer/src/distribution/compute/recover.rs))
- Fixed detection of failed rollbacks when height lands ahead of target, now falls back to fresh start ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_computer/src/distribution/compute/recover.rs))
- Fixed address index lookups to use `get_any_or_read_at_unwrap` instead of `get_pushed_or_read_at_unwrap` to properly check updated layer after rollback ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_computer/src/distribution/address/indexes/any.rs))
- Fixed height subtraction overflow using `saturating_sub` in computer example ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_computer/examples/computer.rs))

#### `brk_cli`
- Fixed config file not being overwritten on every startup, preserving user modifications ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_cli/src/config.rs))

### Internal Changes

#### `brk_bindgen`
- Switched from `HashMap` to `BTreeMap` in pattern analysis for deterministic code generation order ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_bindgen/src/analysis/patterns.rs))
- Added `write_if_changed()` utility to skip file writes when content is unchanged, avoiding unnecessary cargo rebuilds ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_bindgen/src/generators/mod.rs))

#### `brk_store`
- Added `clear_caches()` method to clear all partition caches after bulk removals like rollback ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_store/src/lib.rs))

#### `brk_indexer`
- Removed unused `COLLISIONS_CHECKED_UP_TO` constant ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_indexer/src/constants.rs))
- Added debug logging for transaction metadata storage showing inserted/skipped counts ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_indexer/src/processor/tx.rs))
- Added error logging for unknown TXID cases with full context including store result and current txindex ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_indexer/src/processor/txin.rs))

#### `brk_computer`
- Added extensive debug and warning logging throughout rollback recovery process ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_computer/src/distribution/compute/recover.rs))

#### `brk_server`
- Added middleware to extract client socket address and pass to API handlers ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_server/src/lib.rs))

#### `brk_logger`
- Changed log file naming format from `{prefix}.{date}` to `{prefix}_{date}.txt` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_logger/src/rate_limit.rs))

#### `brk_cli`
- Increased server startup delay from 3 to 10 seconds when indexing is far behind ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_cli/src/main.rs))
- Added separator lines around "Indexing blocks" message for visibility ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_cli/src/main.rs))

#### `brk_types`
- Added comprehensive unit tests for `Date` from index type conversions ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_types/src/date.rs))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.1.1...v0.1.2)

## [v0.1.1](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.1.1) - 2026-01-27

### Bug Fixes

#### `brk_website`
- Fixed HTML file caching rules to properly detect `.html` files and apply `must-revalidate` cache policy instead of immutable caching ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.1/crates/brk_website/src/handlers.rs))

#### `brk_client`
- Fixed metric name mappings in `ClassDaysInLossPattern` (changed from `max_drawdown` to `days_in_profit`)
- Regenerated client code with corrected metric patterns

### Internal Changes

#### `scripts`
- Split release scripts into separate components for better modularity

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.1.0...v0.1.1)

## [v0.1.0](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.1.0) - 2026-01-27

### New Features

#### `brk_computer`
- Added sats-denominated versions of all price metrics alongside USD versions ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0/crates/brk_computer/src/internal/multi/from_date/price.rs))
  - New `Price` wrapper struct provides both `.dollars` and `.sats` representations
  - Derefs to dollars for backward compatibility with existing code
  - Sats values computed via `DollarsToSatsFract` transform
- Added address activity tracking metrics ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0/crates/brk_computer/src/distribution/address/activity.rs))
  - `receiving` - Unique addresses that received funds in each block
  - `sending` - Unique addresses that sent funds in each block
  - `reactivated` - Addresses that were empty and now have funds
  - `both` - Addresses that both sent AND received in same block
  - `balance_increased` - Receive-only addresses
  - `balance_decreased` - Send-only addresses
  - Available globally and per address type (P2PKH, P2SH, P2WPKH, etc.)
- Added address growth rate metrics ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0/crates/brk_computer/src/distribution/address/growth_rate.rs))
  - Computes `new_addr_count / total_addr_count` ratio globally and per type
  - Includes distribution statistics (min, max, average, percentiles)
- Added new address count metrics per block
- Added total address count tracking
- Added `RatioU64F32` transform for u64 to f32 ratio calculations
- Added `U64Plus` transform for u64 addition operations
- Added price-aware multi modules: `lazy_binary_price`, `lazy_price`, `unary_last`
- Added height-based distribution and price modules

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.1.0-beta.1...v0.1.0)

## [v0.1.0-beta.1](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.1.0-beta.1) - 2026-01-26

### New Features

#### `brk_types`
- Added `SatsFract` type for fractional satoshi representation ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-beta.1/crates/brk_types/src/satsfract.rs))
  - Stores f64 values representing sub-satoshi amounts
  - Useful for expressing USD prices in sats when price is high (e.g., at $100k, $0.0001 = 0.1 sats)
  - Includes arithmetic operations and NaN handling

#### `brk_computer`
- Added `DollarsToSatsFract` transform for converting USD prices to sats exchange rate ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-beta.1/crates/brk_computer/src/internal/single/transform/dollars_to_sats_fract.rs))
- Added `CloseDollarsToSatsFract` variant for close price conversion

#### `website`
- Added more investing data and charts

### Internal Changes

#### `scripts`
- Updated release workflow scripts

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.1.0-beta.0...v0.1.0-beta.1)

## [v0.1.0-beta.0](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.1.0-beta.0) - 2026-01-25

### Breaking Changes

#### `brk_mcp`
- Removed `brk_mcp` crate from workspace (MCP server functionality removed)

### New Features

#### `brk_computer`
- Added Reserve Risk metric to cointime module ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-beta.0/crates/brk_computer/src/cointime/reserve_risk/mod.rs))
  - Computes VOCDD 365-day SMA (Value-weighted Outstanding Coin Days Destroyed)
  - Calculates HODL Bank accumulation metric
  - Derives Reserve Risk indicator for market cycle analysis
- Added `return_i8` transform for small integer returns

#### `brk_website` (New Crate)
- Created standalone website serving crate without BRK data layer dependencies ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-beta.0/crates/brk_website/src/lib.rs))
- Supports both embedded website and filesystem path serving
- Provides `router()` function for Axum integration
- Added example demonstrating standalone server usage

#### `brk_playground` (New Standalone Crate)
- Created experimental playground crate for on-chain price analysis (not published to crates.io) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-beta.0/crates/brk_playground/src/lib.rs))
- Implements phase histogram analysis of UTXO patterns
- Provides filter-based output selection for price signal extraction
- Includes on-chain OHLC price oracle derivation with confidence metrics
- Features anchor-based price calibration using weekly OHLC data

#### `brk_logger`
- Added log hook system for custom log message handling ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-beta.0/crates/brk_logger/src/hook.rs))
- Added rate-limited file writer (100 writes/second max) to prevent log flooding ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-beta.0/crates/brk_logger/src/rate_limit.rs))
- Added custom log format module

#### `brk_client`
- Added `fetch_prices.rs` example demonstrating price data fetching

#### `brk_types`
- Added `StoredI8` type for signed 8-bit integer storage

#### `brk_server`
- Added Scalar API documentation JavaScript

### Internal Changes

#### `brk_computer`
- Refactored vecs.rs files to remove verbose comments
- Reduced verbosity and switched to vecdb cumulative function for cleaner code

#### `website`
- Replaced uFuzzy search library with quickmatch for better performance
- Major cleanup and refactoring of frontend code

#### `scripts`
- Updated release scripts with improved workflow

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.1.0-alpha.6...v0.1.0-beta.0)

## [v0.1.0-alpha.6](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.1.0-alpha.6) - 2026-01-18

### Bug Fixes

#### `brk_client`
- Fixed minreq HTTP client feature flag: changed from `serde_json` to `json-using-serde` for proper JSON serialization support
- Regenerated client code with corrected HTTP handling

#### `scripts`
- Added full workspace compilation check to release script to catch feature flag errors before publishing

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.1.0-alpha.5...v0.1.0-alpha.6)

## [v0.1.0-alpha.5](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.1.0-alpha.5) - 2026-01-17

### Bug Fixes

#### `brk_query`
- Fixed `tokio` feature flag to properly propagate to `brk_error` dependency, enabling async error handling when tokio feature is enabled

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.1.0-alpha.4...v0.1.0-alpha.5)

## [v0.1.0-alpha.4](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.1.0-alpha.4) - 2026-01-17

### New Features

#### `brk_computer`
- Implemented Phase Oracle V2 algorithm using round USD template cross-correlation for on-chain price discovery ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.4/crates/brk_computer/src/price/oracle/phase_v2.rs))
  - Uses 200-bin phase histogram with weighted round USD template ($1, $5, $10, $20, etc.)
  - Weekly OHLC anchors constrain search range for accuracy
  - Cross-correlates satoshi values with expected USD fingerprint patterns
- Added `cents_to_dollars` transform for price conversions ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.4/crates/brk_computer/src/internal/single/transform/cents_to_dollars.rs))

#### `brk_query`
- Added `ResolvedQuery` struct for efficient metric query resolution with ETag generation ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.4/crates/brk_query/src/resolved.rs))
- Two-phase query processing: resolve metadata (cheap) then format output (expensive, cached)

#### `brk_server`
- Added bulk metrics API endpoint with ETag-based caching and 304 Not Modified support ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.4/crates/brk_server/src/api/metrics/bulk.rs))
- Implemented `CacheStrategy` module with Height, Static, and MaxAge caching strategies ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.4/crates/brk_server/src/cache.rs))
- Added compact OpenAPI spec generator optimized for LLM consumption ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.4/crates/brk_server/src/api/openapi/compact.rs))
  - Removes redundant fields (error responses, descriptions, examples)
  - Simplifies schemas and flattens allOf/anyOf constructs
  - Compacts responses to "returns": "Type" format
- Added dedicated error handling module
- Added website file serving module with symlink to website directory

#### `brk_types`
- Added `Etag` type for HTTP ETag header handling ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.4/crates/brk_types/src/etag.rs))
- Added `Output` enum for JSON and CSV metric output formats ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.4/crates/brk_types/src/output.rs))
- Added `MetricOutput` struct wrapping output with metadata for ETag generation ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.4/crates/brk_types/src/metricoutput.rs))
- Added `OracleBins` type for 100-bin phase histogram storage used in price discovery ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.4/crates/brk_types/src/oracle_bins.rs))
- Added `PairOutputIndex` for indexing 2-output transactions (oracle pair candidates) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.4/crates/brk_types/src/pairoutputindex.rs))
- Added `Port` type with default server port 3110 ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.4/crates/brk_types/src/port.rs))

#### `brk_fetcher`
- Added fetcher example demonstrating price data fetching

### Internal Changes

#### `brk_server`
- Reorganized OpenAPI generation into dedicated `openapi/` module
- Added Scalar API documentation HTML template

#### `modules/brk-client`
- Regenerated documentation with new types (OracleBins, PairOutputIndex, SyncStatus)
- Added README with usage examples

#### `packages/brk_client`
- Regenerated documentation and updated README

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.1.0-alpha.3...v0.1.0-alpha.4)

## [v0.1.0-alpha.3](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.1.0-alpha.3) - 2026-01-14

### Breaking Changes

#### `brk_bundler`
- Removed `brk_bundler` crate from workspace (JavaScript bundling functionality removed)

### New Features

#### `brk_computer`
- Implemented UTXOracle trustless on-chain price discovery algorithm that derives Bitcoin prices from transaction data without external price feeds ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.3/crates/brk_computer/src/price/oracle/mod.rs))
  - Detects round USD amounts ($10, $20, $50, $100, etc.) in transaction outputs
  - Uses histogram-based stencil matching with Gaussian smoothing
  - Refines prices via geometric median convergence
  - Filters "clean" transactions: 2 outputs, ≤5 inputs, no OP_RETURN, simple signatures
- Added `price/cents/` module for cent-based price storage with split components ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.3/crates/brk_computer/src/price/cents/mod.rs))
- Created dedicated index modules for time-based metric aggregation:
  - `indexes/dateindex.rs` - Daily index with date, first_height, height_count, weekindex, monthindex mappings
  - `indexes/weekindex.rs` - Weekly aggregation
  - `indexes/monthindex.rs` - Monthly aggregation
  - `indexes/quarterindex.rs` - Quarterly aggregation
  - `indexes/semesterindex.rs` - Semester (half-year) aggregation
  - `indexes/yearindex.rs` - Yearly aggregation
  - `indexes/decadeindex.rs` - Decade aggregation
  - `indexes/halvingepoch.rs` - Halving epoch indexing
  - `indexes/difficultyepoch.rs` - Difficulty adjustment epoch indexing
  - `indexes/height.rs` - Block height indexing
  - `indexes/txindex.rs`, `txinindex.rs`, `txoutindex.rs` - Transaction-level indexing
  - `indexes/address.rs` - Address type indexing with vecs for all output types (P2PK33, P2PK65, P2PKH, P2SH, P2TR, P2WPKH, P2WSH, P2A, P2MS, empty, unknown, OP_RETURN)
- Added comprehensive `internal/multi/` module with 100+ metric aggregation strategies ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.3/crates/brk_computer/src/internal/multi/mod.rs)):
  - `from_height/` - Height-based metric derivation with lazy, binary, and value variants
  - `from_date/` - Date-based aggregation with percentiles, ratios, statistics
  - `from_height_and_date/` - Combined height+date metrics including OHLC
  - `from_tx/` - Transaction-level distributions
  - `height_derived/` - Height-to-higher-index derivations
  - `date_derived/` - Date-to-higher-index derivations (average, first, last, min, max, spread, sum)
  - `tx_derived/` - Transaction-derived distributions
  - `height_and_date/` - Combined aggregations for OHLC and bytes
- Added `internal/single/` module with specialized metric computations ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.3/crates/brk_computer/src/internal/single/mod.rs)):
  - `transform/` - 35+ value transformations (price conversions, ratios, percentages, RSI, volatility)
  - `lazy/` - Lazy evaluation for sum, average, cumulative, first, last, min, max, spread
  - `lazy_transform/` - Lazy binary operations with percentiles and statistics
  - `vec/` - Vector-based aggregations (percentiles, sum, average)
  - `group/` - Group statistics (min/max, average, percentiles, distribution)
  - `height/` - Height-indexed value derivations
  - `tx/` - Transaction-level distributions
  - `difficultyepoch/` - Difficulty epoch lazy values
- Added `internal/compute.rs` for unified computation orchestration
- Added `internal/traits.rs` for shared metric computation traits
- Added `distribution/metrics/outputs.rs` for output-specific distribution metrics

#### `brk_client`
- Added `basic.rs` example demonstrating typed metrics API with method chaining ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.3/crates/brk_client/examples/basic.rs))
- Added `tree.rs` example for navigating the metrics tree structure

#### `brk_fetcher`
- Implemented retry mechanism for network requests with exponential backoff ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.3/crates/brk_fetcher/src/retry.rs))
- Added permanent network error detection to skip retries for blocked endpoints

#### `brk_indexer`
- Added `vecs/addresses.rs` for address-specific vector storage
- Added `vecs/inputs.rs` for input vector organization
- Added `vecs/outputs.rs` for output vector organization
- Added `vecs/transactions.rs` for transaction vector organization
- Added `vecs/scripts.rs` for script vector organization

#### `brk_types`
- Added `DiskUsage` type for tracking storage consumption per component ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.3/crates/brk_types/src/diskusage.rs))
- Added `FormatResponse` type for API response formatting ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.3/crates/brk_types/src/formatresponse.rs))
- Added `SyncStatus` type for indexer synchronization status ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.3/crates/brk_types/src/syncstatus.rs))

#### `brk_bindgen`
- Added `generate/constants.rs` for constant generation
- Added `generate/tree.rs` for tree structure generation
- Added catalog test suite ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.3/crates/brk_bindgen/tests/catalog_test.rs))

#### `brk_server`
- Added `/api/server/sync` endpoint returning `SyncStatus` with indexed_height, tip_height, blocks_behind, and last indexed timestamp ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.3/crates/brk_server/src/api/server/mod.rs))
- Added `/api/server/disk` endpoint returning `DiskUsage` with storage consumption per component
- Added `/api/server/health` endpoint for health checks

#### `brk_store`
- Added `any.rs` for type-erased store access

#### `modules/brk-client`
- Generated comprehensive TypeScript-style documentation with 300+ interface and type definitions
- Added test suites: `basic.js` and `tree.js`
- Added CLAUDE.md with development instructions

#### `packages/brk_client`
- Added Python documentation generation with pydoc-markdown
- Added DOCS.md with generated API documentation
- Added test suites: `test_basic.py`, `test_tree.py`

#### `website`
- Restructured from `websites/bitview/` to unified `website/` directory
- Added Progressive Web App (PWA) support with manifest and service worker ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.3/website/manifest.webmanifest))
- Added 40+ Apple splash screen images for iOS home screen support
- Added search pane (`panes/search.js`) and navigation pane (`panes/nav.js`)
- Added units utility (`utils/units.js`) for value formatting
- Reorganized options system with dedicated modules for chain, cohorts, cointime, market, and series configuration

#### `scripts`
- Added `js-docs.sh` for JavaScript documentation generation
- Added `js-publish.sh` for JavaScript package publishing
- Added `python-docs.sh` for Python documentation generation
- Added `python-publish.sh` for Python package publishing to PyPI
- Added `rust-publish.sh` for Rust crate publishing
- Added `release.sh` for coordinated multi-language releases

### Internal Changes

#### `workspace`
- Added build.rs scripts to all crates for consistent build configuration
- Shortened percentiles path in metric tree for cleaner API

#### `brk_computer`
- Reorganized traits into dedicated `traits/` module with `pricing.rs`
- Removed specialized percentiles, ratio, stddev modules from `internal/specialized/`

#### `brk_logger`
- Added example demonstrating logger usage

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.1.0-alpha.2...v0.1.0-alpha.3)

## [v0.1.0-alpha.2](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.1.0-alpha.2) - 2026-01-04

### Breaking Changes

#### `brk_binder` → `brk_bindgen`
- Replaced `brk_binder` crate with completely rewritten `brk_bindgen` crate featuring new architecture with separate `generators/`, `backends/`, and `analysis/` modules ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.2/crates/brk_bindgen/src/lib.rs))

#### `brk_grouper` → `brk_cohort`
- Migrated cohort filtering functionality from `brk_grouper` to new `brk_cohort` crate with expanded filtering capabilities ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.2/crates/brk_cohort/src/lib.rs))

#### `brk_computer`
- Replaced `brk_grouper` dependency with `brk_cohort` throughout the crate
- Removed monolithic `chain/` module containing compute.rs, import.rs, and mod.rs
- Removed monolithic `cointime.rs` in favor of modular `cointime/` directory structure
- Removed `stateful/` module tree including address cohorts, UTXO cohorts, and state management
- Removed `fetched.rs`, `grouped/`, `indexes.rs`, and `price.rs` modules

### New Features

#### `brk_alloc` (New Crate)
- Created global allocator crate using mimalloc for consistent memory allocation across all brk crates ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.2/crates/brk_alloc/src/lib.rs))
- Added `Mimalloc::collect()` function for eager memory release back to OS at natural pause points

#### `brk_bindgen` (New Crate)
- Implemented `ClientOutputPaths` builder for configuring output file paths per language ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.2/crates/brk_bindgen/src/lib.rs))
- Added `generate_clients()` function that generates all configured language clients from OpenAPI spec
- Created analysis module with name resolution, pattern detection, position tracking, and tree traversal ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.2/crates/brk_bindgen/src/analysis/mod.rs))
- Implemented language-specific backends for JavaScript, Python, and Rust code generation ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.2/crates/brk_bindgen/src/backends/mod.rs))
- Created generators module with separate API, client, tree, and types generation per language ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.2/crates/brk_bindgen/src/generators/mod.rs))
- Added syntax utilities for code generation formatting
- Implemented schema extraction and type metadata handling ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.2/crates/brk_bindgen/src/types/mod.rs))

#### `brk_client` (New Crate)
- Created Rust client crate with build-time CPU optimization for release builds ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.2/crates/brk_client/build.rs))
- Generated client library using brk_types for strong typing

#### `brk_cohort` (New Crate)
- Implemented comprehensive UTXO and address cohort filtering system ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.2/crates/brk_cohort/src/lib.rs))
- Added address type filtering for all output types: P2PK65, P2PK33, P2PKH, P2SH, P2WPKH, P2WSH, P2TR, P2A ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.2/crates/brk_cohort/src/by_address_type.rs))
- Added spendable and unspendable type filtering ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.2/crates/brk_cohort/src/by_spendable_type.rs))
- Implemented `CohortContext` for automatic metric name prefix generation based on cohort type ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.2/crates/brk_cohort/src/cohort_context.rs))
- Added `CohortName` system for generating consistent cohort identifiers
- Implemented `StateLevel` tracking for cohort state management
- Added year-based filtering with `ByYear` grouper
- Added `ByAnyAddress` for filtering across all address types
- Migrated and extended age range, amount range, epoch, term, min/max age, ge/lt amount filters from brk_grouper

#### `brk_computer`
- Created modular `blocks/` module with separate submodules for count, difficulty, halving, interval, mining, rewards, size, time, and weight metrics ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.2/crates/brk_computer/src/blocks/mod.rs))
- Created modular `cointime/` module with submodules for activity, adjusted, cap, pricing, supply, and value calculations ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.2/crates/brk_computer/src/cointime/mod.rs))
- Created `distribution/` module for UTXO distribution metrics with address, block, cohorts, compute, metrics, and state submodules ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.2/crates/brk_computer/src/distribution/mod.rs))
- Reorganized `indexes/` into modular structure with address, block, time, and transaction submodules
- Reorganized `inputs/` into count and spent submodules
- Reorganized `outputs/` into count and spent submodules
- Reorganized `market/` into ath, dca, indicators, lookback, moving_average, range, returns, and volatility submodules
- Reorganized `price/` into ohlc, sats, and usd submodules
- Reorganized `supply/` into burned, circulating, inflation, market_cap, and velocity submodules
- Reorganized `transactions/` into count, fees, size, versions, and volume submodules
- Reorganized `scripts/` into count and value submodules
- Added internal module with builder, computed, lazy, specialized, and value submodules for metric computation infrastructure

#### `brk_indexer`
- Refactored processor into modular structure with separate metadata, tx, txin, txout, and types submodules ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.2/crates/brk_indexer/src/processor/mod.rs))

#### `brk_bundler`
- Added bundle example demonstrating bundler usage ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.2/crates/brk_bundler/examples/bundle.rs))

#### `brk_types`
- Added `Age` type for UTXO age representation
- Added `CentsCompact` type for compact cent storage
- Added `Hex` type for hexadecimal string handling
- Added `Indexes` module for index type collections
- Added `OptionExt` trait for option extensions
- Added `Percentile` type for percentile values
- Added `SupplyState` type for supply tracking state
- Added `Term` type for short-term/long-term holder classification

#### `packages/brk_client` (Python)
- Created Python client package with httpx for HTTP requests ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.2/packages/brk_client/pyproject.toml))
- Added typed dataclass-based client with full metric catalog support
- Included test suite for client functionality

### Internal Changes

#### `brk_computer`
- Removed debug_indexer.rs and pools.rs examples
- Simplified constants.rs by removing unused constant definitions
- Consolidated address data structures into distribution module

#### `brk_indexer`
- Removed BENCH.md benchmarking documentation

#### `brk_mempool`
- Removed DESIGN.md design documentation

#### `workspace`
- Added brk_alloc as dev-dependency for benchmarks using mimalloc

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.1.0-alpha.1...v0.1.0-alpha.2)

## [v0.1.0-alpha.1](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.1.0-alpha.1) - 2025-12-21

### New Features

#### `brk_binder`
- Implemented complete multi-language client generation system that produces typed API clients from the metric catalog and OpenAPI specification ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.1/crates/brk_binder/src/lib.rs))
- Added JavaScript client generator with full JSDoc type annotations for IDE autocomplete support across 20k+ metrics ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.1/crates/brk_binder/src/javascript.rs))
- Added Python client generator with type hints and httpx for HTTP requests ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.1/crates/brk_binder/src/python.rs))
- Added Rust client generator with strong typing using reqwest ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.1/crates/brk_binder/src/rust.rs))
- Implemented OpenAPI 3.1 integration using the `oas3` crate for parsing endpoint definitions ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.1/crates/brk_binder/src/openapi.rs))
- Created structural pattern detection system that identifies repeating tree structures for type reuse ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.1/crates/brk_binder/src/types/patterns.rs))
- Added generic pattern detection that groups type-parameterized structures to reduce generated code size
- Created `ClientMetadata` for extracting catalog structure, patterns, and index sets from `brk_query::Vecs` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.1/crates/brk_binder/src/types/mod.rs))

#### `brk_types`
- Added `MetricLeaf` struct containing metric name, value type, and available indexes ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.1/crates/brk_types/src/treenode.rs))
- Added `MetricLeafWithSchema` that wraps `MetricLeaf` with a JSON Schema for client type generation
- Changed `TreeNode::Leaf` from `String` to `MetricLeafWithSchema` to carry full metadata through the tree
- Added `JsonSchema` derive to byte array types (`U8x2`, `U8x20`, `U8x32`) with custom implementations for `U8x33` and `U8x65`
- Added `JsonSchema` derive to OHLC types (`OHLCCents`, `OHLCDollars`, `OHLCSats`, `Open`, `High`, `Low`, `Close`)
- Added `JsonSchema` derive to all index types (date, week, month, quarter, semester, year, decade, halving epoch, difficulty epoch)
- Added `JsonSchema` derive to address index types (P2PKH, P2SH, P2WPKH, P2WSH, P2TR, P2PK33, P2PK65, P2A, OP_RETURN, empty, unknown)
- Implemented index merging when collapsing tree nodes with the same metric name

#### `brk_traversable`
- Added `make_leaf` helper function that generates `MetricLeafWithSchema` nodes with schemars-based JSON Schema generation ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.1/crates/brk_traversable/src/lib.rs))
- Updated all `Traversable` implementations to require `JsonSchema` bound and generate full leaf metadata

#### `brk_computer`
- Added `neg_realized_loss` metric (realized_loss * -1) for charting convenience ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.1/crates/brk_computer/src/stateful/metrics/realized.rs))
- Added `net_realized_pnl` metric (realized_profit - realized_loss)
- Added `realized_value` metric (realized_profit + realized_loss)
- Added `total_realized_pnl` at both height and dateindex levels
- Added `realized_price` metric (realized_cap / supply)
- Added `realized_cap_30d_delta` for 30-day realized cap changes
- Added `sopr` (Spent Output Profit Ratio) with 7-day and 30-day EMA variants
- Added `adjusted_sopr` with EMA variants for coinbase-adjusted analysis
- Added `sell_side_risk_ratio` (realized_value / realized_cap) with 7-day and 30-day EMAs
- Added realized profit/loss ratios relative to realized cap
- Added `net_realized_pnl_cumulative_30d_delta` with ratios relative to realized cap and market cap
- Added `neg_unrealized_loss_rel_to_market_cap` and `net_unrealized_pnl_rel_to_market_cap` metrics ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.1/crates/brk_computer/src/stateful/metrics/relative.rs))
- Added `supply_in_profit/loss_rel_to_circulating_supply` metrics
- Added unrealized profit/loss relative to own market cap at both height and indexes levels
- Added full benchmark example with indexer, computer, and bencher integration ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.1/crates/brk_computer/examples/full_bench.rs))

#### `brk_grouper`
- Added public constants for age boundaries (`DAYS_1D`, `DAYS_1W`, `DAYS_1M`, etc.) for external use ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.1/crates/brk_grouper/src/by_age_range.rs))
- Added `get_mut_by_days_old()` method to `ByAgeRange` for O(1) direct bucket access by days
- Added `AmountBucket` type for O(1) amount range classification ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.1/crates/brk_grouper/src/by_amount_range.rs))
- Added `amounts_in_different_buckets()` helper for cheap bucket comparison
- Optimized `get()` and `get_mut()` in `ByAmountRange` using match on bucket index instead of if-else chain

#### `brk_server`
- Integrated automatic client generation on startup when `brk_binder/clients/` directory exists ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.1/crates/brk_server/src/lib.rs))
- Added panic catching for client generation to prevent server startup failures

#### `brk_cli`
- Enabled distribution via cargo-dist (`dist = true` in package metadata)
- Added performance benchmarks section to README with timing and resource usage data

#### `workspace`
- Added `rust-toolchain.toml` pinning toolchain to Rust 1.92.0
- Created comprehensive `scripts/publish.sh` for automated crate publishing in dependency order ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.1/scripts/publish.sh))
- Updated `scripts/update.sh` to also update rust-toolchain version

### Internal Changes

#### `brk_computer`
- Removed `FenwickTree` state module (O(log n) prefix sum data structure)
- Removed `PriceBuckets` state module (logarithmic price bucket distribution)
- Simplified cohort state management after removal of Fenwick-based percentile computation

#### `brk_indexer`
- Renamed `push_if_needed()` to `checked_push()` throughout for API consistency ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.1/crates/brk_indexer/src/processor.rs))
- Renamed `Indexes::push_if_needed()` to `Indexes::checked_push()`

#### `brk_cli`
- Updated `zip` dependency from 6.0.0 to 7.0.0

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.1.0-alpha.0...v0.1.0-alpha.1)

## [v0.1.0-alpha.0](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.1.0-alpha.0) - 2025-12-18

### Breaking Changes
#### `brk_structs` → `brk_types`
- Renamed `brk_structs` crate to `brk_types` with complete reorganization of all Bitcoin data types into 150+ dedicated modules ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.0/crates/brk_types/src/lib.rs))

#### `brk_parser` → `brk_reader`
- Renamed `brk_parser` crate to `brk_reader` with simplified scope focused exclusively on BLK file reading and XOR decryption ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.0/crates/brk_reader/src/lib.rs))
- Moved block iteration logic to new `brk_iterator` crate

#### `brk_interface`
- Removed `brk_interface` crate entirely, replacing it with the more comprehensive `brk_query` crate

#### `brk_store`
- Upgraded storage backend from fjall v2.11.2 to fjall v3.0.0-rc.6 with breaking API changes ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.0/crates/brk_store/Cargo.toml))

#### `brk_indexer`
- Replaced `brk_parser::Parser` with `brk_iterator::Blocks` for block iteration ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.0/crates/brk_indexer/src/lib.rs))
- Renamed `OutputIndex` and `InputIndex` to `TxOutIndex` and `TxInIndex` throughout the codebase for clarity
- Changed address indexing from `addressindex->txoutindex` to `addressindex->txindex` and `addressindex->outpoint` patterns for more flexible queries

#### `brk_computer`
- Replaced `brk_parser::Parser` with `brk_reader::Reader` for block file access
- Reorganized stateful computation architecture with new cohort-based grouping system
- Removed `states` module, integrating state management directly into `stateful` module

### New Features

#### `brk_mempool` (New Crate)
- Created comprehensive mempool monitoring crate with real-time transaction tracking and fee estimation ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.0/crates/brk_mempool/src/lib.rs))
- Implemented CPFP-aware block builder algorithm using dependency graph analysis and heap-based transaction selection ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.0/crates/brk_mempool/src/block_builder/mod.rs))
- Created `Selector` component that greedily selects highest fee-rate transactions while respecting ancestor dependencies
- Implemented `Partitioner` that groups selected transactions into projected blocks of ~1MB vsize each (8 blocks projected)
- Added `Package` abstraction for atomic transaction groups where children pay for parents (CPFP)
- Created `Graph` structure tracking transaction dependencies with ancestor fee/size aggregation
- Implemented `RecommendedFees` computation providing fee estimates for fastest, half-hour, hour, economy, and minimum confirmation targets ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.0/crates/brk_mempool/src/projected_blocks/fees.rs))
- Created `AddressTracker` for monitoring mempool transactions affecting specific addresses with add/remove tracking ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.0/crates/brk_mempool/src/addresses.rs))
- Implemented `EntryPool` with slot-based entry management using generation counters for efficient reuse
- Added `Snapshot` system capturing point-in-time mempool state with per-block statistics (tx count, vsize, fees, fee range) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.0/crates/brk_mempool/src/projected_blocks/snapshot.rs))
- Created `TxStore` for mempool transaction storage with prefix-based lookups using TxidPrefix
- Implemented `MempoolInfo` tracking aggregate statistics: tx count, total vsize, total fees
- Added automatic synchronization loop with 1-second update interval and rate-limited rebuilds (minimum 1 second between rebuilds) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.0/crates/brk_mempool/src/sync.rs))
- Created dirty flag mechanism for efficient change detection and rebuild triggering

#### `brk_query` (New Crate)
- Created unified query interface combining indexer, computer, reader, and mempool access into single `Query` struct ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.0/crates/brk_query/src/lib.rs))
- Implemented address query methods ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.0/crates/brk_query/src/impl/address.rs)):
  - `address()` - Returns `AddressStats` with chain stats (funded/spent txo counts and sums, tx count) and optional mempool stats
  - `address_txids()` - Returns paginated transaction IDs for an address with `after_txid` cursor support
  - `address_utxos()` - Returns all unspent outputs for an address with full status information
  - `address_mempool_txids()` - Returns up to 50 unconfirmed transaction IDs affecting an address
  - `resolve_address()` - Helper converting address string to output type and type_index
- Implemented block query methods ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.0/crates/brk_query/src/impl/block/)):
  - `block()` / `block_by_height()` - Returns `BlockInfo` with hash, height, timestamp, difficulty, size, weight, tx count
  - `blocks()` - Returns last 10 blocks, optionally starting from a specific height
  - `block_status()` - Returns `BlockStatus` with in_best_chain flag, height, and next_best hash
  - `block_timestamp()` - Returns `BlockTimestamp` for timestamp-based block lookup
  - `block_txids()` - Returns all transaction IDs in a block
  - `block_txs()` - Returns paginated full transactions (25 per page)
  - `block_txid_at_index()` - Returns single txid at specific index within block
  - `block_raw()` - Returns raw block bytes read directly from blk file with XOR decoding
  - `block_by_timestamp()` - Finds block closest to given UNIX timestamp using binary search
- Implemented transaction query methods ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.0/crates/brk_query/src/impl/transaction.rs)):
  - `transaction()` - Returns full `Transaction` with inputs (including prevout values), outputs, fee, status; checks mempool first for unconfirmed txs
  - `transaction_by_index()` - Internal method reading tx from blk file and reconstructing full transaction object
  - `transaction_status()` - Returns `TxStatus` with confirmed flag, block height/hash/time
  - `transaction_hex()` - Returns raw transaction as hex string
  - `outspend()` - Returns `TxOutspend` for single output with spending tx details if spent
  - `outspends()` - Returns spend status for all outputs in a transaction
  - `outspend_details()` - Helper computing spending txid, vin, and status from txinindex
- Implemented mempool query methods ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.0/crates/brk_query/src/impl/mempool.rs)):
  - `mempool_info()` - Returns `MempoolInfo` with aggregate statistics
  - `mempool_txids()` - Returns all transaction IDs currently in mempool
  - `recommended_fees()` - Returns `RecommendedFees` with fee rate targets
  - `mempool_blocks()` - Returns `Vec<MempoolBlock>` with projected block statistics
- Implemented mining query methods ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.0/crates/brk_query/src/impl/mining/)):
  - `mining_pools()` - Returns `PoolsSummary` with pool statistics for time period (24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y)
  - `all_pools()` - Returns `Vec<PoolInfo>` with all 166 known mining pools
  - `pool_detail()` - Returns `PoolDetail` with block counts/shares for all time, 24h, and 1 week
  - `hashrate()` - Returns `HashrateSummary` with network hashrate and difficulty data
  - `difficulty_adjustment()` - Returns current `DifficultyAdjustment` with epoch progress and retarget estimate
  - `difficulty_adjustments()` - Returns historical `Vec<DifficultyAdjustmentEntry>` (timestamp, height, difficulty, change%)
  - `block_fees()` - Returns `Vec<BlockFeesEntry>` with average fees per time period
  - `block_rewards()` - Returns `Vec<BlockRewardsEntry>` with average coinbase rewards
  - `block_sizes_weights()` - Returns `BlockSizesWeights` with average sizes and weights
  - `reward_stats()` - Returns `RewardStats` for last N blocks
- Implemented metrics query methods ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.0/crates/brk_query/src/impl/metrics.rs)):
  - `metric_count()` - Returns count of available metrics
  - `indexes()` - Returns all available index types with accepted aliases
  - `metrics()` - Returns paginated list of metrics with offset/limit support
  - `metrics_catalog()` - Returns hierarchical `TreeNode` of all metrics organized by category
  - `match_metric()` - Fuzzy search for metrics by name with configurable result limit
  - `metric_to_indexes()` - Returns supported indexes for a specific metric
  - `metric_data()` - Returns `MetricData` with values for metric/index combination and date range
- Added async query support via optional `tokio` feature for non-blocking database access

#### `brk_iterator` (New Crate)
- Created `Blocks` factory for iterating over Bitcoin blocks with smart source selection ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.0/crates/brk_iterator/src/lib.rs))
- Implemented three source modes:
  - `Smart` - Auto-selects RPC for ranges ≤10 blocks, Reader for larger ranges
  - `Rpc` - Always uses Bitcoin Core RPC for block retrieval
  - `Reader` - Always uses BLK file reader for block retrieval
- Created flexible range specifications:
  - `range(start, end)` - Iterate over specific block range (inclusive)
  - `start(height)` - Iterate from height to chain tip
  - `end(height)` - Iterate from genesis to height
  - `last(n)` - Iterate over last n blocks
  - `after(hash)` - Iterate after a specific block hash (for incremental syncing)
- Implemented `BlockIterator` with chain reorganization detection that stops iteration on prev_hash discontinuity
- Added `BlockRange` enum for type-safe range specification
- Created `State` struct managing iteration progress with RPC or Reader backend

#### `brk_rpc` (New Crate)
- Created Bitcoin Core RPC client wrapper with automatic retry logic and configurable timeouts ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.0/crates/brk_rpc/src/lib.rs))
- Implemented comprehensive RPC methods:
  - `get_blockchain_info()` - Chain state and sync status
  - `get_block()` / `get_block_count()` / `get_last_height()` - Block retrieval and chain height
  - `get_block_hash()` / `get_block_header()` / `get_block_info()` / `get_block_header_info()` - Block metadata
  - `get_transaction()` / `get_raw_transaction()` / `get_raw_transaction_hex()` - Transaction retrieval
  - `get_tx_out()` - UTXO lookup with optional mempool inclusion
  - `get_raw_mempool()` - Mempool transaction IDs
  - `get_raw_mempool_verbose()` - Returns `Vec<MempoolEntryInfo>` with fee/ancestor data for all mempool entries
  - `get_mempool_transaction()` - Returns `TxWithHex` with full transaction data including resolved prevouts
  - `is_in_main_chain()` - Check if block is in best chain
  - `get_closest_valid_height()` - Find closest valid ancestor for reorg recovery
  - `wait_for_synced_node()` - Block until node headers == blocks
- Created `ClientInner` with retry mechanism (default 1M retries, 1s delay) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.0/crates/brk_rpc/src/inner.rs))
- Added default path resolution for macOS (`~/Library/Application Support/Bitcoin`) and Linux (`~/.bitcoin`)

#### `brk_types` (New Crate)
- Created comprehensive type library with 150+ Bitcoin-related types organized into dedicated modules ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.0/crates/brk_types/src/lib.rs))
- Added mempool types: `MempoolBlock` (tx_count, total_vsize, total_fee, fee_range), `MempoolEntryInfo`, `MempoolInfo`, `RecommendedFees` (fastest_fee, half_hour_fee, hour_fee, economy_fee, minimum_fee)
- Created API parameter types with serde deserialization: `AddressParam`, `AddressTxidsParam`, `BlockHashParam`, `BlockCountParam`, `HeightParam`, `TxidParam`, `TxidVout`, `LimitParam`, `TimePeriodParam`, `PoolSlugParam`, `TimestampParam`, `ValidateAddressParam`
- Added mining types: `Pool` (id, name, slug, addresses, tags, link), `PoolDetail`, `PoolDetailInfo`, `PoolInfo`, `PoolStats`, `PoolBlockCounts`, `PoolBlockShares`, `PoolsSummary`, `HashrateSummary`, `HashrateEntry`, `DifficultyAdjustment`, `DifficultyAdjustmentEntry`, `DifficultyEntry`, `DifficultyEpoch`, `RewardStats`
- Implemented metric types: `Metric`, `MetricCount`, `MetricData`, `MetricParam`, `Metrics`, `MetricSelection`, `MetricSelectionLegacy`, `MetricWithIndex`, `PaginatedMetrics`, `DataRange`, `DataRangeFormat`
- Added block types: `BlockInfo`, `BlockStatus`, `BlockTimestamp`, `BlockSizesWeights`, `BlockFeesEntry`, `BlockFeeRatesEntry`, `BlockRewardsEntry`, `BlockSizeEntry`, `BlockWeightEntry`
- Created transaction types: `Transaction`, `TxIn`, `TxOut`, `TxStatus`, `TxOutspend`, `TxWithHex`, `TxIndex`, `TxInIndex`, `TxOutIndex`
- Added address types: `Address`, `AddressBytes`, `AddressHash`, `AddressChainStats`, `AddressMempoolStats`, `AddressStats`, `AddressValidation`, `AnyAddressIndex`, `EmptyAddressIndex`, `LoadedAddressIndex`, with separate types for each output type (P2PKH, P2SH, P2WPKH, P2WSH, P2TR, P2PK33, P2PK65, P2A, P2MS, OpReturn, Unknown)
- Implemented index types: `Index` enum (Height, DateIndex, WeekIndex, MonthIndex, QuarterIndex, SemesterIndex, YearIndex, DecadeIndex, TxIndex, P2PKHIndex, etc.), `IndexInfo`
- Added stored numeric types: `StoredBool`, `StoredF32`, `StoredF64`, `StoredI16`, `StoredU8`, `StoredU16`, `StoredU32`, `StoredU64`, `StoredString`
- Created utility types: `Health`, `TreeNode`, `Unit`, `Pagination`, `PaginationIndex`, `Limit`, `OutPoint`, `Utxo`, `Vin`, `Vout`

#### `brk_grouper` (New Crate)
- Created cohort filtering and grouping infrastructure for UTXO and address analysis ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.0/crates/brk_grouper/src/lib.rs))
- Implemented filter modules:
  - `ByAddressType` - Filter by output type (P2PKH, P2SH, P2WPKH, etc.)
  - `ByAgeRange` - Filter by UTXO age in blocks
  - `ByAmountRange` - Filter by satoshi value range
  - `ByEpoch` - Filter by halving epoch
  - `ByTerm` - Filter by holder term classification (STH/LTH)
  - `ByYear` - Filter by creation year
  - `ByMinAge` / `ByMaxAge` - Filter by minimum/maximum UTXO age
  - `ByGeAmount` / `ByLtAmount` - Filter by amount thresholds
  - `BySpendableType` / `ByUnspendableType` - Filter by spendability
  - `ByAnyAddress` - Filter by specific address membership
  - `ByType` / `ByValue` - Generic type and value filters
- Created `AmountFilter` and `TimeFilter` base traits for composable filtering
- Implemented `CohortContext` for managing filter state during cohort analysis
- Added `Filtered` wrapper for filtered iterators with lazy evaluation
- Created `StateLevel` enum for controlling computation granularity
- Implemented `Term` type for STH (Short Term Holder) / LTH (Long Term Holder) classification
- Added `AddressCohort` and `UtxoCohort` traits for cohort membership testing

#### `brk_traversable` and `brk_traversable_derive` (New Crates)
- Created `Traversable` trait for vector tree navigation ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.0/crates/brk_traversable/src/lib.rs)):
  - `to_tree_node()` - Converts struct to hierarchical `TreeNode` representation
  - `iter_any_exportable()` - Returns iterator over all exportable vectors in the tree
- Implemented trait for all vecdb vector types: `BytesVec`, `ZeroCopyVec`, `PcoVec`, `LZ4Vec`, `ZstdVec`, `EagerVec`, `LazyVecFrom1/2/3`
- Added implementations for container types: `Box<T>`, `Option<T>`, `BTreeMap<K, V>`
- Created derive macro for automatic `Traversable` implementation on structs ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.0/crates/brk_traversable_derive/src/lib.rs))
- Added `TreeNode` type with `Leaf(String)` and `Branch(BTreeMap<String, TreeNode>)` variants

#### `brk_bencher` and `brk_bencher_visualizer` (New Crates)
- Created benchmarking infrastructure with multi-metric monitoring ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.0/crates/brk_bencher/src/lib.rs)):
  - `DiskMonitor` - Tracks directory size changes over time
  - `MemoryMonitor` - Tracks process RSS memory using system APIs
  - `IoMonitor` - Tracks read/write bytes using process I/O statistics
  - `ProgressionMonitor` - Tracks computation progress via log message pattern matching
- Implemented `Bencher` struct with:
  - Automatic benchmark directory creation under `workspace_root/benches/{crate_name}/{timestamp}/`
  - Background monitoring thread with 5-second sample interval
  - Logger hook registration for progress tracking
  - CSV output for all metrics with millisecond timestamps
- Created `brk_bencher_visualizer` for generating SVG charts from benchmark data ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.0/crates/brk_bencher_visualizer/src/lib.rs)):
  - `Chart` struct for SVG chart generation with configurable dimensions
  - `Data` module for CSV parsing and data transformation
  - `Format` module for human-readable byte/number formatting
  - Command-line tool for batch chart generation from benchmark directories

#### `brk_reader` (Renamed from brk_parser)
- Implemented thread-safe BLK file reader with parallel block decoding ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.0/crates/brk_reader/src/lib.rs))
- Created multi-stage pipeline:
  - Stage 1: Sequential BLK file reading with magic byte detection and XOR decoding
  - Stage 2: Parallel block parsing using dedicated rayon thread pool (half of available threads)
  - Stage 3: Block ordering with future block buffering for out-of-order handling
- Added binary search optimization for finding starting BLK file index when parsing from specific heights
- Created `read_raw_bytes()` method for reading arbitrary byte ranges from blk files with XOR decoding
- Implemented chain continuity verification that detects prev_hash discontinuities and logs errors
- Added `BlkIndexToBlkPath` mapping with automatic BLK file discovery and caching
- Created `XORBytes` and `XORIndex` types for efficient XOR decryption state management

#### `brk_server` - REST API
- Added comprehensive OpenAPI documentation using aide with Scalar UI at `/api` endpoint ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.0/crates/brk_server/src/api/openapi.rs))
- Created Address API endpoints ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.0/crates/brk_server/src/api/addresses/mod.rs)):
  - `GET /api/address/{address}` - Address information with chain and mempool stats
  - `GET /api/address/{address}/txs` - Paginated transaction IDs with `after_txid` and `limit` params
  - `GET /api/address/{address}/utxo` - Unspent transaction outputs
  - `GET /api/address/{address}/txs/mempool` - Unconfirmed transactions (max 50)
  - `GET /api/validate-address/{address}` - Address validation with type detection
- Created Block API endpoints ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.0/crates/brk_server/src/api/blocks/mod.rs)):
  - `GET /api/blocks` - Last 10 blocks
  - `GET /api/blocks/{height}` - 10 blocks backwards from height
  - `GET /api/block/{hash}` - Block information by hash
  - `GET /api/block/{hash}/status` - Block status (in_best_chain, next_best)
  - `GET /api/block/{hash}/txids` - All transaction IDs in block
  - `GET /api/block/{hash}/txs/{start_index}` - Paginated transactions (25 per page)
  - `GET /api/block/{hash}/txid/{index}` - Single txid at index
  - `GET /api/block/{hash}/raw` - Raw block bytes
  - `GET /api/block-height/{height}` - Block by height
  - `GET /api/v1/mining/blocks/timestamp/{timestamp}` - Block by timestamp
- Created Transaction API endpoints ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.0/crates/brk_server/src/api/transactions/mod.rs)):
  - `GET /api/tx/{txid}` - Full transaction data with inputs/outputs
  - `GET /api/tx/{txid}/status` - Confirmation status
  - `GET /api/tx/{txid}/hex` - Raw transaction hex
  - `GET /api/tx/{txid}/outspend/{vout}` - Single output spend status
  - `GET /api/tx/{txid}/outspends` - All output spend statuses
- Created Mempool API endpoints ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.0/crates/brk_server/src/api/mempool/mod.rs)):
  - `GET /api/mempool/info` - Mempool statistics (tx count, vsize, fees)
  - `GET /api/mempool/txids` - All mempool transaction IDs
  - `GET /api/v1/fees/recommended` - Recommended fee rates for confirmation targets
  - `GET /api/v1/fees/mempool-blocks` - Projected blocks with fee statistics
- Created Mining API endpoints ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.0/crates/brk_server/src/api/mining/mod.rs)):
  - `GET /api/v1/difficulty-adjustment` - Current difficulty adjustment info
  - `GET /api/v1/mining/pools` - List all known mining pools
  - `GET /api/v1/mining/pools/{time_period}` - Pool statistics for time period
  - `GET /api/v1/mining/pool/{slug}` - Detailed pool information
  - `GET /api/v1/mining/hashrate` / `GET /api/v1/mining/hashrate/{time_period}` - Network hashrate
  - `GET /api/v1/mining/difficulty-adjustments` / `GET /api/v1/mining/difficulty-adjustments/{time_period}` - Historical adjustments
  - `GET /api/v1/mining/blocks/fees/{time_period}` - Block fee statistics
  - `GET /api/v1/mining/blocks/rewards/{time_period}` - Block reward statistics
  - `GET /api/v1/mining/blocks/sizes-weights/{time_period}` - Block size/weight statistics
  - `GET /api/v1/mining/reward-stats/{block_count}` - Reward stats for last N blocks
- Created Metrics API endpoints ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.0/crates/brk_server/src/api/metrics/mod.rs)):
  - `GET /api/metrics/count` - Total metric count
  - `GET /api/metrics/indexes` - Available indexes with aliases
  - `GET /api/metrics/list` - Paginated metric list
  - `GET /api/metrics/catalog` - Hierarchical metric tree
  - `GET /api/metrics/search/{metric}` - Fuzzy metric search
  - `GET /api/metric/{metric}` - Supported indexes for metric
  - `GET /api/metric/{metric}/{index}` - Metric data with date range filtering
  - `GET /api/metrics/bulk` - Bulk metric query (max 650KB response weight)
  - `GET /api/vecs/{variant}` - Legacy variant endpoint (deprecated, sunset 2027-01-01)
  - `GET /api/vecs/query` - Legacy query endpoint (deprecated)
- Created Server API endpoints:
  - `GET /version` - API version
  - `GET /health` - Health check with timestamp
  - `GET /api.json` - OpenAPI specification
  - `GET /api` - Scalar API documentation UI
- Implemented `CacheStrategy` enum for response caching: `Static` (immutable), `Height` (ETag based on block height), `MaxAge(seconds)` (Cache-Control max-age)
- Added response transformations in `extended` module: `HeaderMapExtended`, `ResponseExtended`, `TransformResponseExtended`

#### `brk_computer`
- Achieved ~3x computation speed improvement through optimized vecdb iterators and major stateful processing optimizations
- Added `Traversable` derive macro support for automatic vector tree generation
- Implemented parallel import for indexes, fetched data, and blks vectors using 512MB stack-size threads ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.0/crates/brk_computer/src/lib.rs))
- Created new `blks` module with `txindex_to_position` and `txindex_to_len` vectors for transaction location tracking

#### `brk_indexer`
- Achieved ~4x indexing speed improvement (~12h → ~3h for full chain) through parallel TXID computation, parallel input/output processing, efficient same-block spend detection, fjall v3, and mimalloc
- Implemented parallel import for vecs and stores using scoped threads ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.0/crates/brk_indexer/src/lib.rs))
- Added `Readers` struct providing typed vector iterators for efficient batch data access
- Created `Processor` for block processing with address and transaction indexing
- Added automatic file handle limit increase at startup (minimum 10,000 via rlimit)

#### `brk_binder`
- Added Rust binding generator for type-safe metric access alongside existing JavaScript generator ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.0/crates/brk_binder/src/rust.rs))

### Internal Changes
#### `brk_indexer`
- Split indexer code into dedicated modules: `constants`, `indexes`, `processor`, `readers`, `stores`, `vecs`
- Moved address vector handling into nested `vecs/address.rs` module
- Separated block, transaction, txin, and txout vectors into dedicated submodules

#### `brk_computer`
- Major refactoring of stateful computation architecture with new module structure
- Split `cohorts` into `address.rs`, `address_cohorts.rs`, `traits.rs`, `utxo.rs`, and `utxo_cohorts/` (mod, receive, send, tick_tock)
- Created `compute` module with `aggregates`, `block_loop`, `context`, `readers`, `recover`, and `write` submodules
- Reorganized `metrics` into `activity`, `config`, `price_paid`, `realized`, `relative`, `supply`, and `unrealized` submodules
- Added `process` module with `address_updates`, `cache`, `inputs`, `lookup`, `outputs`, `range_map`, `received`, `sent`, `tx_counts`, `with_source`
- Created `states` module with `address_cohort`, `block`, `cohort`, `fenwick`, `price_buckets`, `price_to_amount`, `realized`, `supply`, `transacted`, `unrealized`, `utxo_cohort`
- Added `address` module in stateful with `address_count`, `any_address_indexes`, `data`, `height_type_vec`, `type_index_map`, `type_vec`
- Created `addresstype` module with `addresscount`, `height_to_addresscount`, `height_to_vec`, `indexes_to_addresscount`, `typeindex_tree`, `vec`

#### `brk_fetcher`
- Restructured fetcher into dedicated source modules: `binance.rs`, `brk.rs`, `kraken.rs`
- Added `retry.rs` module for fetch retry logic with exponential backoff
- Created `ohlc.rs` module for OHLC data aggregation and transformation
- Added `source.rs` module for abstracting data source selection

#### `brk_store`
- Simplified store implementation to use `brk_types` instead of `brk_structs`
- Added `rustc-hash` for faster FxHashMap operations

#### `brk_logger`
- Added hook registration system via `register_hook()` for external log message monitoring ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.0/crates/brk_logger/src/lib.rs))

### Documentation
#### Benchmarks
- Added benchmark data and visualizations for `brk_computer` and `brk_indexer` across multiple hardware configurations
- Created benchmark directories with disk, I/O, memory, and progress CSV/SVG files:
  - `benches/brk_computer/` - Computer benchmark visualizations
  - `benches/brk_indexer/mac_mini_m4_16gb_ext_ssd/` - Mac Mini M4 with external SSD
  - `benches/brk_indexer/mbp_m3_pro_36gb_int_ssd/` - MacBook Pro M3 Pro with internal SSD

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.111...v0.1.0-alpha.0)

## [v0.0.111](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.111) - 2025-10-03

### Breaking Changes
#### `brk_interface`
- Renamed `metric_count()` method to `distinct_metric_count()` and `vec_count()` to `total_metric_count()` for clearer API semantics distinguishing between unique metric names versus total metric-index combinations ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.111/crates/brk_interface/src/lib.rs))
- Consolidated indexes data structure from separate `indexes` vector and `accepted_indexes` map into single `indexes` BTreeMap containing index names as keys and their accepted variants as values
- Removed redundant `index_count()` method in favor of accessing `indexes.len()` directly

#### `brk_mcp`
- Removed `get_index_count()` tool from Model Context Protocol interface as index count can be derived from indexes map length ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.111/crates/brk_mcp/src/lib.rs))
- Removed `get_accepted_indexes()` tool, consolidating functionality into enhanced `get_indexes()` tool that returns complete mapping
- Updated `get_metric_count()` description to clarify it returns count of unique metrics
- Updated `get_vec_count()` description to explain it returns total metrics (distinct metrics multiplied by supported indexes)

### New Features
#### Website (`bitview`)
- Enhanced "Coins Destroyed" chart organization by separating "Sum" and "Cumulative" views into distinct sub-charts when comparing multiple cohorts, improving visual clarity and reducing chart clutter ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.111/websites/bitview/scripts/core/options/partial.js))
- Maintained backward compatibility with single-cohort view showing both sum and cumulative series in one chart

### Internal Changes
#### `brk_fetcher`
- Migrated JSON parsing from `sonic_rs::from_str()` to standard `serde_json` with updated response handling using `.as_str()` instead of `.json()` for improved compatibility and maintainability ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.111/crates/brk_fetcher/src/brk.rs))

#### `brk_interface`
- Switched from `sonic_rs` to `serde_json` for JSON value handling in metrics deserialization for consistent JSON processing across the codebase
- Streamlined internal data structures eliminating duplicate index tracking mechanisms

#### `brk_server`
- Updated metrics API endpoint `/api/metrics/indexes` to use consolidated `get_indexes()` method returning complete index-to-variants mapping ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.111/crates/brk_server/src/api/metrics/mod.rs))

#### Workspace
- Updated all crate versions from 0.0.110 to 0.0.111 across the workspace

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.110...v0.0.111)

## [v0.0.110](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.110) - 2025-10-02

### New Features
#### `brk_binder`
- Created new crate for generating language binding files to facilitate integration with other programming languages ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.110/crates/brk_binder/src/lib.rs))
- Implemented JavaScript binding generator with compressed metric-to-index mappings using base62 encoding for optimized frontend bundle sizes ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.110/crates/brk_binder/src/js.rs))
- Added automatic generation of TypeScript-compatible pool ID mappings with sorted pool names for improved developer experience
- Implemented word frequency analysis to create compressed metric names, reducing JavaScript bundle size and improving load times
- Added version file generation to track binding file compatibility with backend versions

#### `brk_server`
- Implemented comprehensive address lookup API endpoint supporting all Bitcoin address types including P2PK, P2PKH, P2SH, P2WPKH, P2WSH, P2TR, and P2A ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.110/crates/brk_server/src/api/explorer/mod.rs))
- Added transaction lookup endpoint with raw transaction decoding from blk files including position-based seeking and XOR decryption
- Created address balance and statistics API providing UTXO counts, sent/received amounts, realized value, and average cost basis
- Implemented real-time USD balance calculation using latest price data for address endpoints
- Reorganized API structure into dedicated `metrics/` and `explorer/` modules for better code organization and maintainability ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.110/crates/brk_server/src/api/metrics/mod.rs))
- Added metrics count endpoint exposing both distinct and total metric counts for API discovery
- Created bulk metrics query endpoint for efficient batch data retrieval

#### `brk_interface`
- Implemented `MaybeMetrics` type for handling multiple metric queries with automatic sanitization and validation ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.110/crates/brk_interface/src/metrics.rs))
- Added support for both comma-separated string and array formats for metric parameters with configurable size limits (max 32 metrics, 2KB total)
- Implemented automatic metric name normalization converting hyphens to underscores and enforcing lowercase for consistent API usage
- Added metric-to-indexes mapping functionality for discovering available data dimensions per metric

#### `brk_bundler`
- Restructured bundler to use centralized `modules/` directory instead of website-specific packages for better code reuse ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.110/crates/brk_bundler/src/lib.rs))
- Implemented automatic module copying from `modules/` to website source directories before bundling
- Added inline constant optimization configuration for improved runtime performance through compile-time constant evaluation
- Enhanced HTML generation with dynamic script path injection based on bundled entry point hashes

#### Frontend Modules
- Created `brk-client` module providing type-safe BRK API client with metrics catalog, pool mappings, and idle callback utilities
- Implemented `brk-resources` module for managing shared resources and dependencies across frontend applications
- Added `brk-signals` module for reactive state management with SolidJS signals compatibility
- Centralized third-party dependencies including lightweight-charts 5.0.9, lean-qr 2.6.0, ufuzzy 1.0.19, and solidjs-signals 0.6.3

### Internal Changes
#### `brk_cli`
- Removed legacy bridge generation code in favor of new `brk_binder` crate for cleaner separation of concerns ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.110/crates/brk_cli/src/lib.rs))
- Integrated `brk_binder` for automated JavaScript binding file generation during CLI operations

#### `brk_computer`
- Removed unused profit/loss metrics from stateful computations to streamline calculation pipelines
- Cleaned up cohort analysis code removing obsolete breakeven metrics for better performance

#### `brk_interface`
- Removed legacy `MaybeIds` type in favor of `MaybeMetrics` for more accurate API parameter naming
- Enhanced deserialization logic with better error messages for invalid metric formats
- Restructured interface to expose metric catalog and index mappings for API documentation

#### `brk_mcp`
- Updated Model Context Protocol integration to use new metrics infrastructure with improved parameter handling

#### Workspace
- Reorganized project structure moving website packages to centralized `modules/` directory for better maintainability
- Removed historical asset files reducing repository size and focusing on active development
- Updated solidjs-signals from 0.4.1 to 0.6.3 with enhanced TypeScript definitions and reactive primitives

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.109...v0.0.110)

## [v0.0.109](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.109) - 2025-09-20

### New Features
#### `brk_parser`
- Implemented new typed block parsing architecture with `AnyBlock` enum supporting Raw, Decoded, and Skipped states ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.109/crates/brk_parser/src/any_block.rs))
- Added `ParsedBlock` wrapper that combines block data with position metadata and transaction metadata vectors
- Introduced binary search optimization for finding starting block indices when parsing from specific heights
- Added concurrent parsing pipeline with parallel block decoding using rayon for improved performance

#### `brk_structs`
- Added comprehensive `Block` and `ParsedBlock` data structures with proper height, hash, and metadata tracking ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.109/crates/brk_structs/src/structs/block.rs))
- Implemented `BlkPosition` and `BlkMetadata` types for precise block and transaction positioning within blk files
- Added `coinbase_tag()` method to Block for extracting coinbase transaction script signatures
- Migrated `Pool`, `PoolId`, and `Pools` structs from brk_computer for better code organization and reusability

#### `brk_computer`
- Created dedicated `blks.rs` module for tracking block positions and lengths with compressed vector storage ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.109/crates/brk_computer/src/blks.rs))
- Added `height_to_position`, `height_to_len`, `txindex_to_position`, and `txindex_to_len` compressed vectors for efficient block data access
- Implemented forced import functionality with automatic region retention for optimized storage management

#### `brk_server`
- Added scaffolding for new explorer API endpoints in dedicated `explorer.rs` module (implementation commented for future development)
- Renamed `interface.rs` to `vecs.rs` and restructured API module organization for better separation of concerns

### Internal Changes
#### `brk_parser`
- Removed complex `BlkIndexToBlkRecap` state tracking system and associated recap file management to simplify parsing logic
- Eliminated `BlkMetadata`, `BlkRecap`, `BlockState`, and error handling modules that were causing parsing complexity
- Streamlined XOR decryption handling with direct byte manipulation instead of state machine patterns
- Replaced tuple-based return types with structured `ParsedBlock` objects for better type safety

#### `brk_interface`
- Removed table formatting functionality and simplified output handling for cleaner API design
- Updated format and output modules to work with new parsing architecture

#### Workspace
- Updated all crate versions from 0.0.107 to 0.0.109 across the workspace
- Optimized development profile settings: reduced opt-level to 2, increased codegen-units to 16, and added split-debuginfo for faster builds
- Updated dependencies: serde (1.0.219 � 1.0.225), serde_json (1.0.143 � 1.0.145), vecdb (0.2.14 � 0.2.16)
- Added `sonic-rs` dependency for high-performance JSON processing
- Removed `allocative_derive` dependency that was no longer needed

### Documentation
#### All Crates
- Comprehensive rewrite of all crate README files with detailed API documentation, usage examples, and installation instructions
- Standardized README format across workspace with consistent structure: overview, features, installation, usage, API reference
- Added professional crates.io badges and proper technical documentation for each crate's purpose and capabilities
- Enhanced code examples with practical use cases and proper error handling patterns

#### Project Structure
- Reorganized documentation into dedicated `docs/` directory with `CHANGELOG.md`, `README.md`, `TODO.md`, and `LICENSE.md`
- Added comprehensive project-level documentation explaining the Bitcoin Research Kit architecture and component relationships
- Moved and updated scripts to `scripts/` directory for better project organization

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.107...v0.0.109)

## [v0.0.107](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.107) - 2025-09-13

### New Features
#### `brk_computer`
- Added comprehensive hash rate analytics with THS (TeraHash/Second) and PHS (PetaHash/Second) pricing models for mining profitability analysis ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.107/crates/brk_computer/src/chain.rs))
- Implemented hash price and hash value calculations including minimum thresholds and rebound metrics for market analysis
- Added difficulty adjustment tracking with block and day countdown to next adjustment for network monitoring
- Implemented halving countdown functionality with blocks and days remaining until next halving event
- Added 24-hour rolling coinbase sum tracking in both BTC and USD for mining reward analysis
- Created comprehensive SOPR (Spent Output Profit Ratio) analytics with multi-timeframe standard deviation analysis
- Implemented inflation rate calculations and annualized volume metrics in BTC and USD
- Added transaction velocity, per-second transaction metrics, and input/output rate tracking for network activity analysis

#### `brk_structs`
- Enhanced OHLC (Open, High, Low, Close) data structures with StoredF64 conversion capabilities for improved financial data handling ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.107/crates/brk_structs/src/structs/ohlc.rs))
- Added CheckedSub implementation for Bitcoin struct to enable safe arithmetic operations between Bitcoin amounts
- Enhanced StoredF32 and StoredF64 types with additional mathematical utility methods

### Internal Changes
#### `brk_computer`
- Removed complex ComputedVecBuilder system and streamlined computation architecture for better maintainability
- Refactored lazy and eager vector builders to eliminate redundant computed builder patterns
- Reorganized stateful computation modules with improved address and UTXO cohort management
- Simplified chain computation logic by consolidating version handling and removing unused computation paths
- Enhanced market data processing with better price integration and SOPR calculation efficiency

#### Workspace
- Added new clippy development profile with optimized settings for faster linting during development

### Website Enhancements
#### Frontend
- Improved ratio-based chart options with cleaner naming conventions (removed "_in_usd" suffix for better readability)
- Enhanced SOPR visualization options with multi-timeframe standard deviation displays
- Added new data series configurations for hash rate analytics and mining profitability charts
- Updated chart legends and color schemes for better user experience and data clarity

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.106...v0.0.107)

## [v0.0.106](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.106) - 2025-09-09

### New Features
#### `brk_computer`
- Added mathematical constants `constant_38_2` and `constant_61_8` for precise financial ratio calculations ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.106/crates/brk_computer/src/constants.rs))
- Standardized percentile naming from `p10`, `p25`, `p75`, `p90` to `pct10`, `pct25`, `pct75`, `pct90` for improved code clarity ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.106/crates/brk_computer/src/grouped/builder_eager.rs))

#### `brk_structs`
- Enhanced Dollars struct with comprehensive OHLC (Open, High, Low, Close) conversion support for better financial data integration ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.106/crates/brk_structs/src/structs/dollars.rs))
- Added proper type conversions between OHLC price components and dollar amounts

### Internal Changes
#### Workspace
- Added explicit Rust toolchain specification pinned to version 1.89.0 for consistent compilation across development environments
- Improved statistical calculation accuracy with standardized percentile naming conventions

### Website Enhancements
#### Frontend
- Enhanced chart visualization capabilities with improved data presentation
- Updated statistical displays to use standardized percentile naming for better user understanding

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.105...v0.0.106)

## [v0.0.105](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.105) - 2025-09-08

### New Features
#### Distribution System
- Added cargo-dist configuration for automated cross-platform binary distribution with GitHub CI integration
- Enabled pre-built binary releases for aarch64-apple-darwin (macOS ARM64), aarch64-unknown-linux-gnu (Linux ARM64), and x86_64-unknown-linux-gnu (Linux x86_64)
- Configured automated release workflow with Rust toolchain version 1.89 for consistent builds

### Internal Changes
#### Workspace
- Integrated cargo-dist v0.30.0 for streamlined release management and binary distribution
- Added distribution metadata configuration to simplify installation process for end users

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.104...v0.0.105)

## [v0.0.104](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.104) - 2025-09-08

### Internal Changes
#### CI/CD Infrastructure
- Updated GitHub Actions release workflow to use cargo-dist v0.30.0 for improved release automation ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.104/.github/workflows/release.yml))
- Added foundational cargo-dist metadata configuration to prepare for automated binary distribution
- Enhanced release pipeline reliability with updated tooling and workflow improvements

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.103...v0.0.104)

## [v0.0.103](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.103) - 2025-09-08

### New Features
#### `brk_computer`
- Added comprehensive price volatility analytics with 1-week, 1-month, and 1-year standard deviation calculations for returns analysis ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.103/crates/brk_computer/src/market.rs))
- Implemented advanced market risk metrics including rolling volatility indicators for better risk assessment
- Enhanced standard deviation calculations with optional z-score support and configurable statistical analysis ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.103/crates/brk_computer/src/grouped/sd_from_dateindex.rs))
- Refactored statistical computation modules to make calculations optional for improved performance and flexibility

#### `brk_bundler`
- Updated bundler configuration for optimized JavaScript asset compilation and improved frontend performance

### Internal Changes
#### `brk_computer`
- Converted fixed standard deviation bands to optional calculations, reducing computational overhead when specific metrics aren't needed
- Streamlined market analysis architecture with better separation between volatility calculations and price analysis
- Enhanced statistical accuracy in ratio and standard deviation computations

### Website Enhancements
#### Frontend
- Added support for new volatility and risk metrics in chart configurations
- Enhanced data visualization capabilities for displaying standard deviation bands and volatility indicators
- Improved chart options to accommodate advanced market analysis features

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.101...v0.0.103)

## [v0.0.101](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.101) - 2025-09-07

### New Features
#### `brk_structs`
- Added Sum trait implementation for StoredF64 to enable collection aggregation and improved mathematical operations ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.101/crates/brk_structs/src/structs/stored_f64.rs))
- Implemented division by Dollars for StoredF64 to support ratio calculations in financial analysis

#### `brk_computer`
- Upgraded SOPR (Spent Output Profit Ratio) calculations from StoredF32 to StoredF64 for enhanced precision in profit/loss analysis ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.101/crates/brk_computer/src/stateful/common.rs))
- Enhanced SOPR-related metrics including 7-day and 30-day exponential moving averages with double precision
- Improved adjusted SOPR calculations for more accurate short-term holder analysis

### Internal Changes
#### `brk_computer`
- Removed unused imports and streamlined module dependencies for improved compilation efficiency
- Updated SOPR computation version handling to ensure proper recalculation with enhanced precision

#### `brk_interface`
- Simplified interface ID handling and reduced code complexity for better maintainability

### Website Enhancements
#### Frontend
- Improved chart titles and interface labels for better user clarity, particularly for mining dominance displays
- Enhanced user experience with more descriptive chart naming conventions

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.100...v0.0.101)

## [v0.0.100](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.100) - 2025-09-07

### New Features
#### `brk_computer`
- Created comprehensive mining pool analytics system with dedicated pools tracking module ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.100/crates/brk_computer/src/pools/vecs.rs))
- Implemented mining pool dominance analysis with 1-day, 1-week, 1-month, and 1-year timeframes
- Added mining pool subsidy, fee, and coinbase reward tracking for economic analysis
- Created days-since-block mining for pool activity monitoring and mining frequency analysis

#### `brk_structs`
- Enhanced mathematical operations across all stored numeric types with comprehensive arithmetic support ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.100/crates/brk_structs/src/structs/stored_f32.rs))
- Added StoredU32 to StoredF32 conversions and cross-type division operations for better data interoperability
- Implemented utility methods including `is_zero()` checks and mathematical constants for improved API consistency
- Added allocative trait derivations across all data structures for detailed memory usage tracking and performance optimization

#### `brk_cli`
- Expanded bridge system with automated pools data export for website integration ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.100/crates/brk_cli/src/bridge.rs))
- Enhanced website generation workflow with comprehensive data bridge file creation
- Improved CLI configuration and data export capabilities for better development workflow

### Internal Changes
#### `brk_computer`
- Restructured pools module architecture with dedicated vector storage and computation systems
- Enhanced pool identification and tracking systems with improved data organization
- Streamlined computation workflows with better separation of mining pool analytics

#### `brk_indexer`
- Simplified indexer architecture and reduced code complexity for better maintainability
- Enhanced data processing efficiency with streamlined storage operations

#### Multiple Crates
- Added comprehensive allocative memory tracking across all major data structures for performance monitoring
- Standardized arithmetic operations and type conversions across the entire numeric type system
- Enhanced error handling and validation in mathematical operations

### Website Enhancements
#### Frontend
- Major improvements to mining pool visualization with enhanced chart displays and dominance tracking
- Expanded table functionality with better data presentation and user interaction
- Enhanced chart options with comprehensive mining pool analytics integration
- Improved performance and user experience with updated data visualization libraries

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.98...v0.0.100)

## [v0.0.98](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.98) - 2025-09-05

### New Features
#### `brk_computer`
- Created foundational mining pools system with comprehensive database of 166 predefined mining pools including identification by coinbase tags and addresses ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.98/crates/brk_computer/src/pools/pools.rs))
- Implemented target block count analytics for all time intervals including daily, weekly, monthly, quarterly, semester, yearly, and decade targets ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.98/crates/brk_computer/src/chain.rs))
- Added mining pool identification system using coinbase transaction analysis and known pool addresses
- Created pools example demonstrating mining pool analysis capabilities

#### `brk_interface`
- Implemented robust MaybeIds system for handling multiple ID parameter formats with comprehensive validation and sanitization ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.98/crates/brk_interface/src/ids.rs))
- Enhanced API parameter handling with support for both string and array formats
- Added input validation with configurable limits for string size and array length

### Internal Changes
#### `brk_computer`
- Enhanced stateful computation organization with improved efficiency for complex analytics
- Restructured chain computation constants with better mathematical precision for target calculations
- Streamlined pools module architecture for better data organization and access patterns

#### `brk_store`
- Optimized store operations with reduced complexity and improved data access efficiency
- Removed unused functionality and streamlined storage interfaces

#### `brk_fetcher`
- Minor improvements to BRK API integration for better data fetching reliability

### Website Enhancements
#### Frontend
- Added foundational support for mining pool visualization in chart configurations
- Enhanced website structure with mining pool data integration capabilities
- Improved chart options to accommodate future mining pool analytics displays

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.96...v0.0.98)

## [v0.0.96](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.96) - 2025-09-03

### New Features
#### `brk_structs`
- Created comprehensive StoredString data type with ByteView integration for efficient string storage and serialization ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.96/crates/brk_structs/src/structs/stored_string.rs))
- Enhanced FeeRate calculations with improved mathematical operations and precision handling
- Added utility methods to Date and Timestamp structs for better temporal data manipulation
- Expanded StoredF64 with additional mathematical operations and conversion capabilities

#### `brk_computer`
- Major module restructuring: consolidated blocks and mining functionality into unified chain module for better Bitcoin blockchain analysis organization ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.96/crates/brk_computer/src/lib.rs))
- Renamed `transactions.rs` to `chain.rs` to better reflect comprehensive blockchain transaction and block analysis
- Enhanced market analysis with improved price calculations and volatility metrics
- Streamlined stateful computations with better organization of address and UTXO cohort analysis

#### `brk_interface`
- Enhanced API interfaces with improved data access patterns and better error handling
- Added support for new data types and expanded parameter handling capabilities
- Improved index management with more robust validation and processing

### Internal Changes
#### `brk_computer`
- Consolidated blockchain analysis modules for better code organization and reduced complexity
- Enhanced computation efficiency across market, price, and stateful analysis modules
- Improved memory management and data flow in complex analytical operations

#### `brk_indexer`
- Streamlined indexing operations with better data processing efficiency
- Enhanced vector storage and retrieval operations for improved performance
- Improved indexer examples with clearer demonstration of functionality

#### `brk_parser`
- Enhanced block parsing capabilities with better error handling and validation
- Improved parser examples demonstrating advanced blockchain data extraction techniques

#### `brk_server`
- Enhanced API module organization with improved interface handling
- Better integration with updated interface and data access patterns

### Website Enhancements
#### Typography and Design
- Updated to modern GeistMono and Lilex font families for improved readability and professional appearance
- Enhanced asset management with optimized font loading and better file organization
- Improved service worker functionality for better offline capabilities

#### Chart and Visualization
- Major improvements to chart rendering capabilities with enhanced interactivity and data visualization
- Expanded chart options with new data series types and better configuration flexibility
- Enhanced table functionality with improved data presentation and user interaction
- Added support for new data types including hash rate (H/s) and address data visualization

#### Development Environment
- Added Zed editor configuration for improved development workflow
- Enhanced development tooling and editor integration

### Documentation
#### Multiple Crates
- Comprehensive README updates across brk, brk_indexer, brk_mcp, brk_parser, and brk_server crates
- Improved documentation clarity with better examples and usage instructions
- Enhanced project-level documentation with updated architecture descriptions

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.95...v0.0.96)

## [v0.0.95](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.95) - 2025-08-28

### New Features
#### `brk_computer`
- Added comprehensive unrealized profit and loss analytics with advanced relative metrics calculations ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.95/crates/brk_computer/src/stateful/common.rs))
- Implemented unrealized profit plus loss aggregation metrics for comprehensive holder analysis
- Created relative profitability metrics including ratios to own market cap and own unrealized profit plus loss
- Added multi-dimensional profit/loss analysis with separate positive and negative unrealized loss tracking
- Enhanced holder profitability analysis with extensive cross-referencing between different calculation methods

### Website Enhancements
#### Chart and Visualization
- Added new unit types for advanced profit/loss visualization: `%cmcap` (relative to own market cap) and `%cp+l` (relative to own unrealized profit plus loss)
- Enhanced price line functionality with configurable colors and line styles for improved chart customization
- Improved chart options with better visual distinction between different profitability metrics
- Added support for displaying complex relative profitability calculations with proper unit labeling

#### User Interface
- Enhanced chart configuration with more flexible price line customization options
- Improved data visualization clarity for sophisticated profit/loss analytics
- Better integration of advanced metrics into existing chart framework

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.94...v0.0.95)

## [v0.0.94](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.94) - 2025-08-28

### New Features
#### `brk_computer`
- Added comprehensive SOPR (Spent Output Profit Ratio) analytics with 7-day and 30-day exponential moving averages ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.94/crates/brk_computer/src/stateful/common.rs))
- Implemented adjusted SOPR calculations with exponential moving averages for enhanced transaction profitability analysis
- Created sell-side risk ratio metrics with 7-day and 30-day exponential moving averages for advanced market risk assessment
- Enhanced unrealized profit/loss analytics with relative calculations to market cap for comprehensive holder analysis
- Added extended configuration options for stateful computations with improved flexibility and performance

### Website Transformation
#### Major Rebranding
- Complete rebrand from "default" to "bitview" with new domain reference (bitview.space) and professional identity
- Updated README and documentation to reflect new branding and simplified domain structure
- Reorganized website assets and structure for better organization and scalability

#### Progressive Web App (PWA) Implementation
- Added comprehensive PWA support with complete Apple touch icon and splash screen sets for all device sizes
- Implemented web app manifest with proper configuration for native app-like installation experience
- Created device-specific splash screens for optimal mobile user experience across iPhone and iPad variants
- Added proper PWA metadata and configuration for improved mobile usability

#### Asset and Structure Organization
- Moved website from `websites/default` to `websites/bitview` for better project organization
- Added modern font assets (GeistMono and Lilex) for improved typography and readability
- Reorganized packages and dependencies with better structure and maintainability
- Simplified TypeScript configuration and reduced development complexity

### Internal Changes
#### `brk_computer`
- Enhanced UTXO cohort analysis with improved parameter handling and configuration flexibility
- Streamlined stateful computation architecture with better organization of advanced metrics
- Improved computational efficiency for complex profit/loss and risk calculations

#### Development Workflow
- Simplified frontend development approach with reduced TypeScript complexity
- Improved asset management and build processes for better development experience
- Enhanced website configuration and deployment processes

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.93...v0.0.94)

## [v0.0.93](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.93) - 2025-08-26

### New Features
#### Website Screenshot Capabilities
- Added comprehensive screenshot functionality using modern-screenshot package for high-quality chart and data visualization capture ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.93/websites/default/packages/modern-screenshot/wrapper.js))
- Implemented 2x scale rendering for crisp, professional-quality screenshot output
- Added automatic screenshot opening in new tabs with proper URL cleanup for optimal user experience

#### Chart Enhancement and Branding
- Added domain watermarking to charts for proper attribution and source identification ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.93/websites/default/scripts/chart.js))
- Enhanced chart presentation with integrated branding for professional appearance
- Improved chart layout and visual organization for better data presentation

### Website Enhancements
#### User Interface Improvements
- Enhanced website styling with dedicated screenshot mode support for clean capture
- Improved visual presentation with better element spacing and layout optimization
- Added screenshot button integration with conditional display logic for better user experience

#### Package and Dependency Updates
- Updated ufuzzy dependency from v1.0.18 to v1.0.19 for improved search functionality
- Added modern-screenshot v4.6.6 package for advanced screenshot capabilities
- Enhanced package management with better organization and dependency handling

### Internal Changes
#### Development Workflow
- Streamlined TODO list by removing completed tasks and outdated development items
- Simplified project roadmap focus with cleaner task organization
- Improved development priorities and task tracking

#### Website Structure
- Enhanced HTML structure with better CSS organization for screenshot functionality
- Improved element styling and layout for optimal visual presentation
- Better integration of new features with existing website architecture

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.91...v0.0.93)

## [v0.0.91](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.91) - 2025-08-26

### New Features
#### `brk_computer`
- Added comprehensive Exponential Moving Average (EMA) calculations for all major timeframes matching SMA counterparts ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.91/crates/brk_computer/src/market.rs))
- Implemented EMA support for 1w, 8d, 13d, 21d, 1m, 34d, 55d, 89d, 144d, 200d, 1y, 2y, 200w, and 4y periods
- Enhanced technical analysis capabilities with both Simple Moving Averages (SMA) and Exponential Moving Averages (EMA) for sophisticated trend analysis
- Added mathematical constants 144 and 600 for Bitcoin-specific calculations (blocks per day and standard analysis periods) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.91/crates/brk_computer/src/constants.rs))
- Simplified constants computation with loop-based implementation for better maintainability and performance

#### `brk_structs`
- Enhanced OHLC (Open, High, Low, Close) data structures with improved mathematical operations for better financial analysis
- Improved Sats and StoredF32 types with additional utility methods for enhanced precision in calculations

### Website Enhancements
#### Typography and Design
- Added Lilex font family for improved code readability and professional data presentation
- Enhanced typography with dedicated monospace font for better numeric data display and code visibility

#### Chart Configuration and Customization
- Enhanced price line creation with customizable naming capabilities for better chart personalization
- Improved average series configuration with optional title customization for clearer data presentation
- Better chart options organization with more intuitive naming conventions (e.g., "100K+ btc" instead of "100K btc+")
- Enhanced chart configuration flexibility with improved parameter handling

### Internal Changes
#### `brk_computer`
- Streamlined constants computation architecture with more efficient loop-based calculations
- Enhanced market analysis module with comprehensive EMA implementation alongside existing SMA calculations
- Improved ratio computations with better organization and performance optimizations

#### `brk_indexer`
- Enhanced indexer functionality with improved data processing capabilities
- Better integration with new constants and mathematical operations

#### Development Workflow
- Simplified TODO management with better task organization and priority tracking
- Enhanced development workflow with improved mathematical operations and constants handling

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.90...v0.0.91)

## [v0.0.90](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.90) - 2025-08-24

### Documentation
#### Release Management
- Converted "Unreleased" changelog section to properly formatted v0.0.89 release with comprehensive source code links
- Enhanced changelog structure with professional formatting and detailed feature documentation
- Added direct links to source code for all major features and architectural changes
- Improved documentation organization with better categorization and technical details

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.89...v0.0.90)

## [v0.0.89](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.89) - 2025-08-24

### Documentation
#### Comprehensive README Overhaul
- Enhanced comprehensive rewrite of all crate README files for improved clarity and developer experience across all workspace crates ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.89/crates/brk/README.md))
- Updated main project README with better structure and comprehensive architecture documentation ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.89/README.md))
- Standardized README format across all workspace crates with consistent styling and improved developer experience
- Added more detailed descriptions for each crate's purpose and functionality with examples

### New Features
#### `brk_computer` - Major Refactoring
- Refactored ComputedFrom pattern to LazyFrom pattern for improved performance and memory efficiency ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.89/crates/brk_computer/src/grouped/builder_lazy.rs))
- Added new LazyVecBuilder implementation for on-demand computation with support for first, average, sum, max, min, last, and cumulative operations
- Restructured Computer module stateful operations with improved organization and rollback functionality ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.89/crates/brk_computer/src/stateful/mod.rs))
- Enhanced address type organization into dedicated module structure ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.89/crates/brk_computer/src/stateful/addresstype/))
- Improved stateful rollback functionality for better error recovery and blockchain reorganization handling

#### `brk_structs`
- Added new StoredI16 data type for efficient 16-bit signed integer storage with compression support ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.89/crates/brk_structs/src/structs/stored_i16.rs))
- Enhanced StoredF32 with additional utility methods for mathematical operations ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.89/crates/brk_structs/src/structs/stored_f32.rs))

### Website Frontend
#### Package Management Overhaul
- Updated solid-signals from v0.3.2 to solidjs-signals v0.4.1 for improved reactivity and performance ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.89/websites/default/packages/solidjs-signals/))
- Enhanced frontend package management and dependency organization
- Improved chart rendering performance with updated signal library
- Reorganized package structure with better organization and maintainability

### Internal Changes
#### Build System
- Updated all crate versions from 0.0.88 to 0.0.89 across the workspace
- Enhanced Cargo.toml dependency management and version consistency ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.0.89/Cargo.toml))
- Added comprehensive CHANGELOG.md with professional formatting and detailed documentation

#### Development Infrastructure
- Improved development workflow with better package management
- Enhanced project organization with standardized documentation structure
- Better integration between frontend and backend components

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.88...v0.0.89)

## [v0.0.88](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.88) - 2025-08-10

### Build System
#### Rust Environment Standardization
- Added explicit Rust version specification (1.89) to workspace configuration for consistent compilation across development environments
- Enhanced build reliability with standardized toolchain requirements
- Improved development environment consistency and reduced compilation variance

### Website Enhancements
#### SOPR Visualization Improvements
- Enhanced SOPR (Spent Output Profit Ratio) chart configuration with improved key handling and better code organization
- Added conditional display logic for adjusted SOPR (aSOPR) charts when data is available
- Improved chart organization with cleaner key generation and more robust data handling
- Better separation between standard SOPR and adjusted SOPR visualization options

### Internal Changes
#### Version Management
- Updated all crate versions from 0.0.87 to 0.0.88 across the workspace for consistent release management
- Enhanced workspace version coordination and dependency consistency

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.87...v0.0.88)


## [v0.0.87](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.87) - 2025-08-10

### Breaking Changes
- **Vector Storage Architecture Refactor**: Replaced internal `brk_vecs` crate with externalized `vecdb` crate, moving vector storage functionality to a separate project while maintaining the same core functionality ([Cargo.toml](https://github.com/bitcoinresearchkit/brk/blob/v0.0.87/Cargo.toml))

### Architecture Improvements
- **Crate Externalization**: Migrated vector storage implementation from internal `brk_vecs` and `brk_vecs_macros` to external `vecdb` and `vecdb_derive` crates, enabling independent development and versioning of the vector storage system
- **Sequential Database Foundation**: Added `seqdb` as the underlying sequential data storage engine powering the vector database functionality
- **Workspace Simplification**: Removed `brk_vecs` and `brk_vecs_macros` from the workspace, reducing codebase complexity and focusing on Bitcoin-specific functionality ([crates/brk/Cargo.toml](https://github.com/bitcoinresearchkit/brk/blob/v0.0.87/crates/brk/Cargo.toml))

### API Changes
- **Vector Interface Consistency**: Updated all vector references from `brk_vecs` to `vecdb` while maintaining identical API surface for seamless transition ([crates/brk/src/lib.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.87/crates/brk/src/lib.rs))
- **Documentation Updates**: Updated README and project documentation to reflect the new external vector database dependency ([README.md](https://github.com/bitcoinresearchkit/brk/blob/v0.0.87/README.md))

### Development Experience
- **Modular Development**: Enables independent development of vector storage functionality separate from Bitcoin analysis logic
- **Local Development Support**: Added commented local path configuration for easier development workflow when working on both projects simultaneously

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.85...v0.0.87)

## [v0.0.85](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.85) - 2025-08-07

### Bug Fixes
- **Logging Filter Correction**: Fixed typo in logger filter configuration, changing `rmcp=off` to `brk_rmcp=off` to properly suppress unwanted logs from the RMCP protocol module ([crates/brk_logger/src/lib.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.85/crates/brk_logger/src/lib.rs))

### Configuration Changes
- **MCP Server Configuration**: Removed stateful mode setting from MCP server configuration, enabling more flexible protocol handling and improved compatibility with different client implementations ([crates/brk_mcp/src/route.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.85/crates/brk_mcp/src/route.rs))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.84...v0.0.85)

## [v0.0.84](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.84) - 2025-08-07

### Breaking Changes
- **Major Architecture Restructuring**: Complete reorganization of the codebase with extraction of core functionality into dedicated crates (`brk_structs`, `brk_error`) and comprehensive modularization of all components for better maintainability and reusability
- **Struct System Overhaul**: Moved all Bitcoin-related structures from `brk_core` to new `brk_structs` crate with enhanced grouping capabilities, comprehensive address types, and improved serialization support ([crates/brk_structs/src/lib.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.84/crates/brk_structs/src/lib.rs))

### New Features
- **Centralized Error Handling**: Introduced `brk_error` crate providing unified error handling across all BRK components with comprehensive error types for different subsystems ([crates/brk_error/src/lib.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.84/crates/brk_error/src/lib.rs))
- **Advanced Address Analytics**: Enhanced address grouping system with comprehensive filtering capabilities including by address type, amount ranges, age ranges, epochs, terms, and spendable/unspendable classifications ([crates/brk_structs/src/groups/mod.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.84/crates/brk_structs/src/groups/mod.rs))
- **Vector Macro System**: Added `brk_vecs_macros` crate providing procedural macros for automated vector trait implementations and boilerplate reduction ([crates/brk_vecs_macros/src/lib.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.84/crates/brk_vecs_macros/src/lib.rs))
- **Enhanced Data Types**: Comprehensive Bitcoin data type system including transaction IDs, block hashes, raw locktime, version numbers, and specialized index types for all Bitcoin primitives ([crates/brk_structs/src/structs/mod.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.84/crates/brk_structs/src/structs/mod.rs))

### Architecture Improvements
- **Modular Design**: Complete separation of concerns with dedicated crates for different functionality areas, enabling better code organization and independent versioning
- **Build System Enhancement**: Added comprehensive build scripts across all crates with `cargo-dist` integration for automated release management and distribution ([.github/workflows/release.yml](https://github.com/bitcoinresearchkit/brk/blob/v0.0.84/.github/workflows/release.yml))
- **Price Analysis**: New dedicated price analysis module with enhanced market data processing and price-to-amount state tracking ([crates/brk_computer/src/price.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.84/crates/brk_computer/src/price.rs))

### Developer Experience
- **Comprehensive Documentation**: Added README files and examples for all major crates, providing clear usage instructions and API documentation
- **Enhanced Examples**: Expanded example collection demonstrating various BRK components and usage patterns across all crates
- **Development Tools**: Improved development workflow with better build scripts, dependency management, and testing infrastructure

### Performance Improvements
- **Vector System**: Enhanced vector system with improved compression, better memory management, and optimized I/O operations through the redesigned `brk_vecs` architecture
- **State Management**: Improved state tracking with dedicated modules for block states, realized/unrealized values, supply tracking, and transaction analysis

### Infrastructure
- **CI/CD Enhancement**: Updated GitHub Actions workflow with improved Ubuntu runner (22.04) and enhanced release automation
- **Docker Improvements**: Enhanced Docker configuration with better environment handling and deployment options

### Social Media
- **Platform Updates**: Updated social media links removing outdated platforms and focusing on active community channels ([README.md](https://github.com/bitcoinresearchkit/brk/blob/v0.0.84/README.md))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.83...v0.0.84)

## [v0.0.83](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.83) - 2025-07-26

### New Features
- **Cross-Platform Hole Punching**: Added Linux support for file hole punching operations using `fallocate` system call, expanding platform compatibility beyond macOS for efficient sparse file management ([crates/brk_vecs/src/file/mod.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.83/crates/brk_vecs/src/file/mod.rs))

### Performance Improvements
- **Platform-Specific Optimization**: Implemented platform-specific hole punching strategies with optimized system calls for both macOS (`fcntl` with `F_PUNCHHOLE`) and Linux (`fallocate`), improving storage efficiency and I/O performance on different operating systems

### Internal Changes
- **Code Organization**: Refactored hole punching implementation with unified `punch_hole_impl()` method that dispatches to platform-specific implementations, improving code maintainability and reducing duplication
- **Error Handling**: Enhanced error handling for unsupported platforms with clear error messages for hole punching operations

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.82...v0.0.83)

## [v0.0.82](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.82) - 2025-07-26

### Breaking Changes
- **Vector System Refactoring**: Replaced `brk_vec` with new `brk_vecs` crate, introducing a completely redesigned vector storage system with improved file layouts, better compression, and enhanced performance characteristics ([crates/brk_vecs/src/lib.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.82/crates/brk_vecs/src/lib.rs))

### New Features
- **Advanced Vector Architecture**: Introduced comprehensive vector system with multiple storage variants including `RawVec`, `CompressedVec`, `ComputedVec`, `EagerVec`, `LazyVec`, and `StampedVec` for different use cases and performance requirements ([crates/brk_vecs/src/variants/mod.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.82/crates/brk_vecs/src/variants/mod.rs))
- **File-Based Storage**: New file-based storage system with dedicated `File` and `Reader` implementations, featuring page-based architecture and memory mapping for efficient disk I/O ([crates/brk_vecs/src/file/mod.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.82/crates/brk_vecs/src/file/mod.rs))
- **Stamped Vectors**: Added timestamped vector support with `StampedVec` and `Stamp` structures for versioned data management and temporal analysis ([crates/brk_vecs/src/variants/stamped/mod.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.82/crates/brk_vecs/src/variants/stamped/mod.rs))

### Architecture Improvements
- **Lazy Computation**: Enhanced lazy evaluation system with support for 1, 2, and 3-source computed vectors, enabling complex data transformations with minimal memory overhead ([crates/brk_vecs/src/variants/lazy/mod.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.82/crates/brk_vecs/src/variants/lazy/mod.rs))
- **Compression Optimization**: Redesigned compression system with page-based metadata management and improved compression ratios for large datasets ([crates/brk_vecs/src/variants/compressed/mod.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.82/crates/brk_vecs/src/variants/compressed/mod.rs))
- **Type System Enhancement**: Improved trait system with dedicated interfaces for different vector operations, providing better type safety and performance ([crates/brk_vecs/src/traits/mod.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.82/crates/brk_vecs/src/traits/mod.rs))

### Performance Improvements
- **Build Optimization**: Updated build scripts to focus on release builds for better performance in production deployments ([update.sh](https://github.com/bitcoinresearchkit/brk/blob/v0.0.82/update.sh))
- **Memory Management**: Enhanced memory usage patterns with better file mapping strategies and reduced memory footprint for large-scale Bitcoin data processing

### Infrastructure
- **Comprehensive Examples**: Added extensive examples demonstrating various vector types and usage patterns for better developer onboarding ([crates/brk_vecs/examples/](https://github.com/bitcoinresearchkit/brk/blob/v0.0.82/crates/brk_vecs/examples/))
- **Documentation**: Enhanced documentation with detailed explanations of vector architectures and storage strategies

### Internal Changes
- **Address Handling**: Improved address byte hash management and height-based indexing for better address analytics performance
- **Group Processing**: Enhanced address and UTXO grouping capabilities with better filtering and processing mechanisms
- **Error Handling**: Refined error handling throughout the vector system for more robust data operations

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.81...v0.0.82)

## [v0.0.81](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.81) - 2025-07-17

### Breaking Changes
- **Computer Module Restructuring**: Major reorganization of the computer module from nested `vecs` structure to flat module layout, moving vector implementations directly into separate modules (`all`, `blocks`, `cointime`, `constants`, `fetched`, `grouped`, `indexes`, `market`, `mining`, `stateful`, `transactions`) for better maintainability ([crates/brk_computer/src/lib.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.81/crates/brk_computer/src/lib.rs))

### New Features
- **Docker Support**: Added comprehensive Docker setup with Dockerfile, docker-compose configuration, environment templates, and detailed documentation for containerized BRK deployment ([docker/README.md](https://github.com/bitcoinresearchkit/brk/blob/v0.0.81/docker/README.md))
- **Address Index System**: Implemented new address indexing architecture with `AnyAddressIndex`, `EmptyAddressIndex`, and `LoadedAddressIndex` structures for more efficient address data management ([crates/brk_core/src/structs/anyaddressindex.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.81/crates/brk_core/src/structs/anyaddressindex.rs))
- **Enhanced Address Grouping**: Added comprehensive address filtering and grouping capabilities with `by_address_type`, `by_any_address`, and flexible filter systems ([crates/brk_core/src/groups/mod.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.81/crates/brk_core/src/groups/mod.rs))

### Architecture Improvements
- **Stateful Processing**: Enhanced stateful vector processing with dedicated traits and improved address data source handling ([crates/brk_computer/src/stateful/trait.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.81/crates/brk_computer/src/stateful/trait.rs))
- **Address Analytics**: Added sophisticated address counting and analysis capabilities with support for different address types and cohort analysis
- **Module Organization**: Flattened module hierarchy eliminating nested structures for clearer code organization and easier navigation

### Infrastructure
- **Container Deployment**: Full Docker containerization support with multi-stage builds, environment configuration, and production-ready setup
- **Build Optimization**: Enhanced build scripts and profiling tools for better development workflow

### Documentation
- **Website Updates**: Added `brekit.org` as primary domain in README alongside existing mirrors ([README.md](https://github.com/bitcoinresearchkit/brk/blob/v0.0.81/README.md))
- **Docker Guide**: Comprehensive Docker setup and deployment documentation with prerequisites, configuration, and usage instructions

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.80...v0.0.81)

## [v0.0.80](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.80) - 2025-07-13

### Performance Improvements
- **Vector Length Caching**: Added local length caching in raw vectors with `local_stored_len` field, reducing atomic operations and improving read performance by storing frequently accessed length values locally ([crates/brk_vec/src/variants/raw.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.80/crates/brk_vec/src/variants/raw.rs))

### API Enhancements
- **Length Management**: Introduced `set_stored_len()` method for direct length management, providing better control over vector metadata and synchronization between local and shared length values

### Documentation
- **README Cleanup**: Removed detailed AI example links from main README to streamline content and focus on core functionality, improving readability and reducing maintenance overhead ([README.md](https://github.com/bitcoinresearchkit/brk/blob/v0.0.80/README.md))
- **MCP Documentation**: Added dedicated README for Model Context Protocol integration with comprehensive usage examples and setup instructions ([crates/brk_mcp/README.md](https://github.com/bitcoinresearchkit/brk/blob/v0.0.80/crates/brk_mcp/README.md))

### Internal Changes
- **Vector Architecture**: Enhanced raw and compressed vector implementations with improved length tracking mechanisms for better performance and consistency

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.79...v0.0.80)

## [v0.0.79](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.79) - 2025-07-13

### Performance Improvements
- **File Handle Optimization**: Reduced minimum file handle limit from 250,000 to 10,000, significantly lowering system resource requirements while maintaining adequate file access for most Bitcoin datasets ([crates/brk_core/src/utils/rlimit.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.79/crates/brk_core/src/utils/rlimit.rs))

### Breaking Changes
- **Vector Memory Architecture**: Replaced `ArcSwap<Mmap>` with `Arc<AtomicUsize>` for stored length tracking in raw vectors, eliminating memory mapping overhead and improving concurrent access patterns while reducing memory usage ([crates/brk_vec/src/variants/raw.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.79/crates/brk_vec/src/variants/raw.rs))

### Internal Changes
- **Vector Storage Simplification**: Removed arc-swap dependency from vector variants, streamlining memory management and reducing complexity in concurrent scenarios
- **Store Integration**: Enhanced indexer store integration with better error handling and resource management
- **Header Management**: Improved vector header handling for more efficient metadata operations

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.78...v0.0.79)

## [v0.0.78](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.78) - 2025-07-13

### New Features
- **Semester Index Support**: Added `SemesterIndex` struct for 6-month interval datasets, enabling bi-annual analysis of Bitcoin metrics with proper serialization and mathematical operations ([crates/brk_core/src/structs/semesterindex.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.78/crates/brk_core/src/structs/semesterindex.rs))
- **Enhanced Vector Architecture**: Refactored vector computation infrastructure with improved `VecBuilderOptions` and `Source` handling for more flexible dataset generation ([crates/brk_computer/src/vecs/grouped/builder_computed.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.78/crates/brk_computer/src/vecs/grouped/builder_computed.rs))

### Architecture Improvements
- **Vector Builder Refactoring**: Renamed `StorableVecGeneatorOptions` to `VecBuilderOptions` for better naming consistency and enhanced vector generation capabilities
- **Cointime Integration**: Enhanced cointime computation with better indexing support and computation parameter handling
- **Profiling Tools**: Added dedicated flamegraph and samply profiling scripts for the computer module to aid performance analysis

### Development Experience
- **Documentation Updates**: Expanded TODO list with additional feature requests including chopiness datasets, reused address analytics, z-score chart improvements, and HTTPS support
- **Profiling Support**: Added flamegraph.sh and samply.sh scripts to the computer module for better performance debugging capabilities

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.76...v0.0.78)

## [v0.0.76](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.76) - 2025-07-09

### Build System Updates
- **Rolldown Bundler**: Updated `brk_rolldown` from 0.1.0 to 0.1.1 with improvements across all bundler components including enhanced ECMAScript utilities, better plugin architecture, and improved string manipulation capabilities ([crates/brk_bundler/Cargo.toml](https://github.com/bitcoinresearchkit/brk/blob/v0.0.76/crates/brk_bundler/Cargo.toml))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.75...v0.0.76)

## [v0.0.75](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.75) - 2025-07-09

### Performance Improvements
- **Chunk Size Optimization**: Adjusted parallel processing chunk size from length/4 to length/3, increasing parallelization granularity for better performance on high-end storage systems while maintaining external drive protection ([crates/brk_computer/src/vecs/stateful/mod.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.75/crates/brk_computer/src/vecs/stateful/mod.rs))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.74...v0.0.75)

## [v0.0.74](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.74) - 2025-07-09

### Performance Improvements
- **Parallel Processing Optimization**: Refactored stateful vector computation to use chunked parallel processing with controlled chunk sizes (length/4) instead of unbounded parallelization, preventing external drive bottlenecks and improving performance on Thunderbolt 4 SSDs ([crates/brk_computer/src/vecs/stateful/mod.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.74/crates/brk_computer/src/vecs/stateful/mod.rs))
- **Thread Scope Elimination**: Replaced complex thread scope management with streamlined Either-based collection processing, reducing threading overhead and improving memory usage patterns during computation

### Bug Fixes
- **Memory Table Rotation Logging**: Fixed missing log message for memory table rotation operations, improving debugging and monitoring capabilities during store operations ([crates/brk_computer/src/stores.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.74/crates/brk_computer/src/stores.rs))

### Internal Changes
- **Computation Architecture**: Unified UTXO and address vector processing using Either enum for type-safe handling of different vector types while maintaining performance through parallel iteration
- **Chunk-based Processing**: Implemented intelligent chunking strategy to prevent overwhelming external storage devices while maintaining parallelization benefits

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.73...v0.0.74)

## [v0.0.73](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.73) - 2025-07-09

### Breaking Changes
- **Architecture Restructuring**: Removed `brk_state` crate entirely, consolidating its functionality into `brk_computer` with direct store and serialization dependencies, simplifying the overall architecture and reducing module complexity
- **Build System Upgrade**: Updated `brk_rolldown` bundler from 0.0.1 to 0.1.0 with significant API changes including removal of deprecated loader utilities and addition of hot module replacement support

### New Features
- **Hot Module Replacement**: Added HMR plugin support for improved development experience with live code updates and faster iteration cycles during bundling operations
- **Advanced Hashing**: Integrated Blake3 hashing algorithm for improved performance in debug operations and file integrity verification

### Internal Changes
- **Computer Module Enhancement**: Added bincode serialization, zerocopy optimizations, and derive_deref functionality directly to the computer module for better performance
- **Store Integration**: Enhanced store module with logging capabilities for better debugging and monitoring
- **Plugin Architecture**: Expanded bundler plugin system with data URI support and improved ECMAScript utilities

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.71...v0.0.73)

## [v0.0.71](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.71) - 2025-06-25

### New Features
- **Enhanced Schema Documentation**: Added comprehensive descriptions to all Index enum variants and API parameters, providing clear explanations for date/day index, height/block index, transaction indexes, address types, and time periods for better API usability ([crates/brk_interface/src/index.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.71/crates/brk_interface/src/index.rs), [crates/brk_interface/src/params.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.71/crates/brk_interface/src/params.rs))

### API Changes
- **MCP Tool Modernization**: Upgraded Model Context Protocol implementation to use new `tool_router` and `Parameters` wrapper for better type safety and parameter handling, replacing legacy `tool_box` approach ([crates/brk_mcp/src/lib.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.71/crates/brk_mcp/src/lib.rs))
- **Endpoint Renaming**: Renamed `get_variant_count` to `get_vec_count` for better consistency with API terminology

### Internal Changes
- **Development Flexibility**: Added commented local development path for `brk_rmcp` to facilitate easier testing and development workflows

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.70...v0.0.71)

## [v0.0.70](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.70) - 2025-06-24

### New Features
- **Model Context Protocol Default**: Enabled MCP (Model Context Protocol) by default for LLM integration, changing from opt-in to opt-out behavior to make AI-powered Bitcoin data analysis more accessible ([crates/brk_cli/src/config.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.70/crates/brk_cli/src/config.rs))

### API Changes
- **Simplified Endpoints**: Streamlined API endpoints by replacing complex query parameters with dedicated paths (`/height-to-ohlc` and `/dateindex-to-ohlc`) for cleaner and more intuitive data access ([crates/brk_fetcher/src/brk.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.70/crates/brk_fetcher/src/brk.rs))

### Internal Changes
- **Module Restructuring**: Flattened fetcher module structure by moving fetcher implementations directly into the main crate, eliminating nested module hierarchy for better maintainability
- **Documentation**: Updated API badge URL to reflect new vec-count endpoint and improved MCP tool description clarity ([README.md](https://github.com/bitcoinresearchkit/brk/blob/v0.0.70/README.md))
- **Code Cleanup**: Removed commented debug code and unused file handle references from raw vector implementation

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.69...v0.0.70)

## [v0.0.69](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.69) - 2025-06-24

### Performance Improvements
- **Vector Initialization Optimization**: Removed thread-based parallel initialization of indexes and fetched vectors, replacing with sequential initialization to reduce overhead and improve memory usage patterns during startup ([crates/brk_computer/src/vecs/mod.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.69/crates/brk_computer/src/vecs/mod.rs))
- **File Handle Management**: Refactored vector file handling architecture to use on-demand file opening instead of persistent file handles, reducing memory footprint and file descriptor usage ([crates/brk_vec/src/variants/raw.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.69/crates/brk_vec/src/variants/raw.rs))

### Internal Changes
- **Resource Limit Adjustment**: Reverted file handle limit back to 210,000 from 420,000, optimizing for more conservative resource usage
- **Header Write Logic**: Simplified vector header writing by removing conditional logic and always performing write operations when needed, improving code clarity and reducing potential race conditions ([crates/brk_vec/src/structs/header.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.69/crates/brk_vec/src/structs/header.rs))
- **Memory Map Updates**: Refactored memory map update logic to accept file references directly, eliminating need for persistent file handle storage and improving resource management
- **Code Cleanup**: Removed unused imports and simplified vector trait implementations for better maintainability

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.68...v0.0.69)

## [v0.0.68](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.68) - 2025-06-24

### New Features
- **CLI Version Information**: Added version command support to CLI configuration, enabling users to check the current version of BRK directly from the command line ([crates/brk_cli/src/config.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.68/crates/brk_cli/src/config.rs))

### Performance Improvements
- **File Handle Limits**: Doubled the minimum file handle limit from 210,000 to 420,000 to accommodate larger Bitcoin datasets and prevent resource exhaustion during intensive blockchain processing operations ([crates/brk_core/src/utils/rlimit.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.68/crates/brk_core/src/utils/rlimit.rs))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.67...v0.0.68)

## [v0.0.67](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.67) - 2025-06-24

### New Features
- **Data Interface Layer**: Added `brk_interface` crate providing a comprehensive data interface layer with serialization, schema generation, and tabular formatting capabilities for exporting datasets in multiple formats (JSON, CSV, TSV, Markdown)
- **Model Context Protocol Support**: Introduced `brk_mcp` crate implementing Model Context Protocol (MCP) for seamless integration with Large Language Models, enabling AI-powered Bitcoin data analysis and querying
- **External MCP Integration**: Added `brk_rmcp` external dependency for robust MCP client/server communication capabilities

### Breaking Changes
- **Dependency Restructuring**: Removed direct `brk_query` dependency from CLI, replaced with modular `brk_interface` and `brk_mcp` architecture for better separation of concerns
- **Storage Simplification**: Removed `arc-swap` and `fjall` dependencies from `brk_state`, streamlining state management architecture

### Internal Changes
- **Build System**: Added auto-generated `vecid-to-indexes.js` file to gitignore to prevent version control conflicts
- **Documentation Updates**: Updated historical changelog entries to reflect correct repository URLs and asset paths, migrating from kibo-money references to bitcoinresearchkit organization
- **Dependency Updates**: Updated multiple core dependencies including `async-compression`, `autocfg`, `errno`, and `syn` to their latest versions for improved performance and compatibility

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.66...v0.0.67)

## [v0.0.66](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.66) - 2025-06-19

### New Features
- **Cointime Analysis**: Added comprehensive cointime economic metrics including coinblocks creation/storage tracking, liveliness and vaultedness calculations, activity ratios, and specialized price metrics (vaulted price, active price, true market mean, cointime price) with corresponding market cap calculations ([crates/brk_computer/src/vecs/cointime.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.66/crates/brk_computer/src/vecs/cointime.rs))
- **Advanced Supply Analysis**: Implemented vaulted and active supply tracking with dollar value computations, enabling analysis of Bitcoin storage behavior and economic activity patterns

### Documentation
- **CLI Documentation**: Improved CLI README with better formatting, clearer installation instructions, enhanced usage examples, and restructured content with proper markdown syntax and information blocks ([crates/brk_cli/README.md](https://github.com/bitcoinresearchkit/brk/blob/v0.0.66/crates/brk_cli/README.md))
- **Installation Guidance**: Added prominent installation notes for Ubuntu users and improved download section formatting with better link formatting and structure

### Internal Changes
- **Ratio Analysis Integration**: Connected cointime price metrics with ratio analysis system for comprehensive trend analysis across vaulted price, active price, true market mean, and cointime price ratios

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.65...v0.0.66)

## [v0.0.65](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.65) - 2025-06-17

### Bug Fixes
- **Chart Data Update Logic**: Simplified chart data update algorithm by removing complex comparison logic and replacing it with a streamlined approach that updates all data points at or after the last known time, significantly reducing complexity and potential update conflicts ([websites/default/packages/lightweight-charts/wrapper.js](https://github.com/bitcoinresearchkit/brk/blob/v0.0.65/websites/default/packages/lightweight-charts/wrapper.js))

### Internal Changes
- **Cohort Analysis Versioning**: Incremented version numbers for cumulative net realized profit/loss metrics from VERSION::TWO to VERSION::new(3), ensuring proper cache invalidation and data consistency for cohort analysis computations ([crates/brk_computer/src/vecs/stateful/cohort.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.65/crates/brk_computer/src/vecs/stateful/cohort.rs))

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.64...v0.0.65)

## [v0.0.64](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.64) - 2025-06-17

### New Features
- **4-Year Statistical Analysis**: Added comprehensive 4-year moving averages and standard deviation calculations for ratio analysis, enabling long-term trend analysis with `ratio_4y_sma`, `ratio_4y_sd`, and `ratio_4y_zscore` metrics ([crates/brk_computer/src/vecs/grouped/ratio_from_dateindex.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.64/crates/brk_computer/src/vecs/grouped/ratio_from_dateindex.rs))
- **Z-Score Computation Optimization**: Refactored z-score calculations to use a dedicated `compute_zscore()` method, improving code maintainability and performance by centralizing statistical computations

### Internal Changes
- **Vector Naming Convention**: Renamed `ratio_standard_deviation` to `ratio_sd` for consistency with other abbreviated metric names
- **Statistical Method Extraction**: Extracted z-score computation logic into reusable methods, reducing code duplication and improving mathematical accuracy
- **Vector Builder Enhancement**: Added conditional naming logic in grouped vector builder for better handling of sum operations with optional suffixes

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.63...v0.0.64)

## [v0.0.63](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.63) - 2025-06-16

### New Features
- **Static File Caching**: Implemented intelligent HTTP caching strategy for static assets, setting immutable cache headers for long-term assets (images, fonts, JavaScript, map files) and must-revalidate headers for HTML and service worker files to ensure optimal performance and cache invalidation ([crates/brk_server/src/files/file.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.63/crates/brk_server/src/files/file.rs))
- **Progressive Web App Assets**: Added comprehensive PWA assets including Apple Touch icons, splash screens for all iOS device sizes and orientations, and maskable icons for Android, enabling native app-like experience across all mobile platforms

### Internal Changes
- **File Extension Detection**: Refactored file extension checking from string-based `ends_with()` pattern matching to more robust `Path::extension()` method for better accuracy and maintainability
- **Cache Logic Simplification**: Consolidated cache control logic by removing redundant file path checks and grouping related file types for cleaner code organization

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.62...v0.0.63)

## [v0.0.62](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.62) - 2025-06-16

### Bug Fixes
- **TypeScript Bridge Generation**: Fixed JavaScript/TypeScript bridge generation by properly handling optional return values when reading hashed main.js entry files, preventing crashes when entry files don't exist ([crates/brk_bundler/src/lib.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.62/crates/brk_bundler/src/lib.rs))
- **TypeScript Type Generation**: Restructured TypeScript type definitions for VecIdToIndexes, moving typedef comments outside function declaration for proper type recognition ([crates/brk_server/src/api/query/bridge.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.62/crates/brk_server/src/api/query/bridge.rs))

### New Features
- **Chart Time Scale Optimization**: Improved time scale spacing for different chart time periods with more balanced bar spacing (quarters: 3→2, years: 12→6, decades: 120→60) for better visual density ([websites/default/packages/lightweight-charts/wrapper.js](https://github.com/bitcoinresearchkit/brk/blob/v0.0.62/websites/default/packages/lightweight-charts/wrapper.js))
- **Progressive Web App Support**: Added service worker scope configuration and improved PWA manifest handling for better standalone app experience

### Internal Changes
- **Chart Data Processing**: Refactored chart data handling to use object destructuring instead of arrays, improving code clarity and type safety in effect callbacks
- **HTML Standards**: Updated HTML5 DOCTYPE declaration and improved syntax consistency
- **Error Handling**: Added try-catch protection for localStorage operations to prevent crashes in restricted environments

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.61...v0.0.62)

## [v0.0.61](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.0.61) - 2025-06-15

### New Features
- **OHLC Price Continuity**: Added logic to maintain price continuity between days in OHLC data computation by setting today's opening price to the previous day's closing price, ensuring no gaps in price series when computing daily OHLC from fetched data ([crates/brk_computer/src/vecs/fetched.rs](https://github.com/bitcoinresearchkit/brk/blob/v0.0.61/crates/brk_computer/src/vecs/fetched.rs))

### Internal Changes
- **Struct Mutability**: Added `DerefMut` trait to all OHLC struct variants (OhlcF64, OhlcBtc, OhlcSats, OhlcUsd) enabling mutable access to underlying values
- **Error Handling**: Improved file creation error handling in block recap export with more descriptive panic messages

[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.0.59...v0.0.61)
