feat(proofs): authenticate coinbases with AuxPoW merkle branches - #22
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Forty records carry a
coinbase_scriptsig_hexcopied from a child chain's AuxPoW record, and with no body CI could not bind it to the header, so their BIP34 claims andtag/addressattributions rested on an extract. The same AuxPoW records carry the parent coinbase and its merkle branch, soproofs/{height}-{hash}.jsongains 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 requirescoinbase_scriptsig_hexto 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
CheckBlockwithbad-txnmrklroot; the note records that as a second failure and the record keeps its extract.The second commit makes
pool_basisrequire its evidence:tagandaddressneed a body or a coinbase proof, andreportedandaddressneed apool_provenanceURL, 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 (86txids, 38merkle_branch); 46 tests pass. Each AuxPoW record was checked before its proof was written: the parent header it carries hashes to the record'shash, 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'shathor_classify.pyalso uses.