Hazync v0.8.0 — the difficulty retarget and every consensus constant now come from real Core
METHOD_ID: 7a8b29e0d644eecd6c46d125d6646909f017c80a2de679301228d428cdccae3d
(supersedes ffdc6095… / cb114426…)
This release moves the last algorithmic piece of block-connection glue — the difficulty retarget — from
a hand-written transcription to Bitcoin Core's own compiled pow.cpp, and sources every remaining
consensus constant straight from Core's chainparams.cpp. It is a re-baseline: the guest image id
changes, so proofs are re-verified against the new id (the live board is re-proven to match). Valid-block
behaviour is byte-identical — only the id moves.
What changed
- Real
CalculateNextWorkRequiredin the guest. The guest compiles Core's actualpow.cpp+
chain.cpp;calc_next_bitsdrives Core's own retarget through the realCBlockIndex. Proven
byte-identical to the prior (validated) transcription over all 476 mainnet retargets + a fuzz sweep. - Every consensus constant sourced from Core. The guest also compiles
kernel/chainparams.cpp:
calc_next_bitsandblock_subsidyreadpowLimit, the 2-week timespan, the target spacing, and the
halving interval straight from Core's realCChainParams::Main(). Every remaining Rust-side literal
(retarget interval, block weight/sigop limits, the buried soft-fork heights, theSCRIPT_VERIFY_*bit
positions) is runtime-pinned to Core's compiled value on every proving path — a mismatch aborts.
Nothing consensus-relevant is a hand-typed magic number anymore. - Platform shims (
coreshim/): no-op single-threaded locking + logging so Core'schain.h/
chainparams.cppcompile on the freestanding zkVM target. Non-consensus glue only.
New continuously-enforced tests (CI)
- Retarget differential — carved Core reproduces the actual on-chain nBits at all 476 mainnet
retargets; clamp/powLimit/monotonicity invariants hold. - Script-flag differential — the guest's flag schedule is a proven sound superset of Core's
GetBlockScriptFlags; buried forks flip at Core's exact heights; both exception blocks behave. - Chainparams anchor — Core's compiled constants equal the canonical mainnet values.
Compatibility / verification
- Binaries:
hazync-host-x86_64-linux-gnu(CPU) and…-cuda(CUDA, multi-arch sm_80/86/89/90 + PTX 90),
both glibc 2.34+ (ubuntu:22.04), both embedding the new guest id. Verify with./hazync-host-… method-id. - Reproduce the canonical id:
docker build -f reproduce/Dockerfile -t hazync-repro . && docker run --rm hazync-repro. - Proofs under earlier ids don't verify against this id (expected — new guest); the coordinator
re-verifies every submission and the board is re-proven at the new id.