Skip to content

nmc(card237): wire-vector KAT — real mainnet auxpow round-trip - #218

Merged
frstrtr merged 1 commit into
masterfrom
nmc/p1-card237-auxpow-wire-kat
Jun 19, 2026
Merged

nmc(card237): wire-vector KAT — real mainnet auxpow round-trip#218
frstrtr merged 1 commit into
masterfrom
nmc/p1-card237-auxpow-wire-kat

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 19, 2026

Copy link
Copy Markdown
Owner

Pins the canonical Namecoin CAuxPow wire layout against a genuine mainnet blocknamecoin-cli getblock 47589169...b8d4b4 0, block 757000, merge-mined under a BTC/AntPool parent coinbase (pulled from the pruned mainnet node on VM 219/.140, card 237).

What it tests

  • Deserialize the 80-byte NMC header; assert base version 4, auxpow flag 0x100, chain_id 1.
  • Deserialize the AuxPow, re-serialize it, and require byte-for-byte reproduction of the mainnet auxpow region [80, 80+len). External daemon truth, not a self-derived fixture — a field-order / int-width / witness-stripping bug diverges here instead of being mirrored.
  • Confirmed real-world quirk: the embedded CMerkleTx hashBlock is legitimately null in auxpow blobs (parent linkage is the separate parent_header); the round-trip proves we preserve that zero verbatim.

Fence / CI: src/impl/nmc/ only (core + nmc::coin; btc tree untouched). Registered in test/CMakeLists.txt and the build.yml --target allowlist (both Linux jobs) to avoid the #137 NOT_BUILT sentinel.

1 test, green locally (nmc_auxpow_wire_test).

Pin the canonical Namecoin CAuxPow wire layout (AuxPow::Serialize /
Unserialize) against a GENUINE mainnet block: namecoin-cli getblock
47589169f94e3e77bf4da8067e76b4417b021f0eb10760995671856f21b8d4b4 0
(block 757000, merge-mined under a BTC/AntPool parent coinbase).

The KAT deserializes the 80-byte NMC header (asserts base version 4,
auxpow flag, chain_id 1), deserializes the AuxPow, re-serializes it, and
requires byte-for-byte reproduction of the mainnet auxpow region. The
vector is external truth from the daemon, not a self-derived fixture, so
a field-order / int-width / witness-stripping deviation diverges here
rather than being mirrored.

Fenced to src/impl/nmc/ (core + nmc::coin only; btc tree untouched).
Registered in test/CMakeLists.txt AND the build.yml --target allowlist
(both jobs) to avoid the #137 NOT_BUILT sentinel.
@frstrtr
frstrtr merged commit 9b09a68 into master Jun 19, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant