Skip to content

feat(proofs): authenticate coinbases with AuxPoW merkle branches - #22

Merged
deadmanoz merged 2 commits into
mainfrom
coinbase-proofs
Sep 24, 2026
Merged

deadmanoz merged 2 commits into
mainfrom
coinbase-proofs

Conversation

@deadmanoz

Copy link
Copy Markdown
Collaborator

Summary

Forty records carry a coinbase_scriptsig_hex copied from a child chain's AuxPoW record, and with no body CI could not bind it to the header, so their BIP34 claims and tag/address attributions rested on an extract. The same AuxPoW records carry the parent coinbase and its merkle branch, so proofs/{height}-{hash}.json gains a second shape, {transaction, merkle_branch}, beside the {transaction, txids} from #14. CI hashes the coinbase up the branch to the header's merkle root and requires coinbase_scriptsig_hex to equal its scriptSig. A proved coinbase binds context only; body rules still need a body.

38 proofs come from Namecoin blocks and 363731's coinbase is placed by the 99 txids in the dump its observation cites, covering 39 of the 40. 649674's Hathor path reproduces the header's root only from the double-SHA256 of the coinbase's witness serialisation, so its tree was built from the wrong hash and a node would fail CheckBlock with bad-txnmrklroot; the note records that as a second failure and the record keeps its extract.

The second commit makes pool_basis require its evidence: tag and address need a body or a coinbase proof, and reported and address need a pool_provenance URL, added to the seven records attributed that way. The notes record the negative result behind the 86 unattributed P2SH records.

Testing

python ci/sanity-check.py: 143 blocks, 16 block files, 124 proof files (86 txids, 38 merkle_branch); 46 tests pass. Each AuxPoW record was checked before its proof was written: the parent header it carries hashes to the record's hash, the branch reproduces the merkle root from the coinbase's txid, and the scriptSig equals the record's context. The 649674 result holds for only one of the four leaf and sibling-order combinations, the one merge-mining-research's hathor_classify.py also uses.

Add a second proof-file shape, the coinbase transaction with its sibling
hashes to the merkle root, and bind coinbase_scriptsig_hex to the proved
coinbase, which the record must carry. Body rules still require a body.
Add proofs for every bodiless record with a coinbase extract: 38 from
Namecoin AuxPoW records and 363731 placed by the archived dump's txid
list. 649674 has no Bitcoin merkle path: its Hathor tree hashes the
witness serialisation.
tag and address need a body or a coinbase proof; reported and address
need pool_provenance, the report or the pinned mining-pools listing.
Add it to the seven records attributed that way, and record the
negative result of the P2SH pool-attribution search in the notes.
@deadmanoz
deadmanoz merged commit 1a73210 into main Sep 24, 2026
1 check passed
@deadmanoz
deadmanoz deleted the coinbase-proofs branch September 24, 2026 08:25
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