headers

Bitcoin Headers Distribution — Specification

Status: AGREED v1 — spec first, code second; all review questions resolved below.

This specifies how Bitcoin block headers are distributed across three complementary channels. Headers are self-certifying (proof-of-work plus linkage), so no channel, host, or publisher is ever trusted — consumers verify everything on receipt. Redundancy is therefore purely additive: any party can run any channel, and disagreement is detectable rather than dangerous.

channel medium mutability cadence
1. Live events Nostr replaceable per block
2. Epoch files any static host immutable sealed every 2,016 blocks
3. Current file release asset / static host replaced periodic

Common definitions:


1. Live events (Nostr) — NIP-33333

The live channel is specified by NIP-33333 (Bitcoin Block Headers over Nostr) and this spec defers to it entirely. Summary of the normative points:

The event’s created_at is the liveness heartbeat: the feed is healthy iff the newest event is younger than a few block intervals.

Trust model (normative here and in the NIP’s spirit): publishers are identified but not trusted. Clients MUST verify every header (PoW, linkage, and — where they maintain a chain — the full header rules) and SHOULD follow multiple publisher keys (p tags help discovery), preferring the heaviest verified chain. A publisher key is a brand and a filter, never a security boundary.

Publisher conduct (normative, this spec): a publisher MUST validate headers against its own maintained chain before signing; MUST exit (crash-only) rather than run silently wedged, so supervisors can act; SHOULD publish to ≥3 relays; SHOULD carry u tags referencing channels 2–3.

2. Epoch files (immutable bulk)

{base}/{network}/epoch/{n}.bin      exactly 2016 × 80 = 161,280 bytes
{base}/{network}/manifest.json

manifest.json:

{
  "network": "mainnet",
  "epochLength": 2016,
  "sealed": 459,
  "sha256": { "0": "<hex>", "1": "<hex>", "…": "…" },
  "generator": "<tool name+version>",
  "updated": "<ISO time>"
}

3. Current file (the unsealed remainder)

{network}.current.bin    headers from the last sealed epoch boundary to the tip

Replaced in place (e.g. as a GitHub release asset — proven pattern, no git history growth). Consumers treat it as a convenience snapshot of the hot end; channels 1 and P2P remain the fresher sources. Accompanied by {network}.current.json carrying tip height/hash, sha256, and timestamp.


Resolved in review


Independent community project; not affiliated with Bitcoin Core.