WO-06 — Header, PoW, ASERT

8 October 2026 · Branch wo-06-header from wo-05-addresses at 5e5ac27.

Implemented

Added e46::chain support for the exact 120-byte header format, strict deserialize length checking, canonical compact-target conversion, RL v3 header PoW validation, integer-only ASERT, median-time-past, and the 900-second adjusted-time limit. Header integers serialize little-endian; digest fields remain raw bytes. Compact targets reject negative, zero, noncanonical, overflowing, and above-pow-limit values.

ASERT follows the owner-resolved decision #16: BCH aserti3-2d Q16 cubic approximation and E46 spacing/half-life; genesis anchor at height zero with anchor-parent time genesis.time - 150; truncating signed division and arithmetic shifts; clamp to [1, MAX_TARGET] before fixed-width overflow can wrap. Mainnet and testnet use MAX_TARGET = 0x1d7fffff. Decision #16 is now in the Resolved table. No WO-06 decision remains Open.

The independent reference is e46/golden/header_reference.py; the frozen vectors are e46/golden/wo06-golden.json. They include header round trips, compact-target boundaries and rejects, ASERT fractional/clamp cases, and time validation boundaries. generate_wo06.py --check confirms reproducibility.

Verification

Release build, -Wall -Wextra -Werror       PASS
Release full CTest suite                  PASS, 22/22
Sanitizer full CTest suite (ASan + UBSan)  PASS, 22/22
WO-06 differential                        PASS, 103,214 comparisons, 0 mismatches
  includes 100,000 simulated parent headers across hashrate changes
  fresh differential seed: 620261009
  simulation seed: 620261010
Frozen golden regeneration check          PASS
Header parser libFuzzer                   PASS, 2,948,540 executions / 31 s

The differential covers frozen and fresh headers, strict 0–139/121-byte decode rejects, compact encode/decode, random ASERT histories, MTP/future-time boundaries, and 40 independent Python/C++ PoW checks. The release WO-06 differential completed in about 1.2 seconds on this Mac, including the Python reference and 100,000 ASERT rows. Builds and fuzzing used at most four build workers; the fuzz campaign itself was single-process.

The 40 random PoW cases all rejected at the selected pow limit, as expected for a target with about 25 leading zero bits. The comparison uses the existing RL v3 helper, whose target-boundary tests are already covered by WO-01. This work order did not perform a multi-million-header search for a successful pow-limit fixture; WO-10 owns genesis mining.

The shared worktree still contains prior unstaged owner/Claude changes in .gitignore, CHAIN-DESIGN.md, MAPS/, and untracked GENESIS-AND-TARGETS.md, MAPS/DASHBOARD-BRIEF.md, and docs/. Those were preserved; WO-06 implementation changes are confined to CMakeLists.txt, the new header API/source/CLI/tests, Python reference and generator, golden JSON, and this report. No SHA-2 code, commit, push, merge, or history rewrite was performed.