feat(dataset): admit P2SH failures from proof files, starting with 173886, 174772 and 189498 - #14
Merged
Merged
Conversation
…3886, 174772 and 189498
A record without a body may carry proofs/{height}-{hash}.json: the failing
transaction and the block's complete ordered txids. The list must reproduce
the header's merkle root and contain the transaction, which binds it to the
header; the input is then checked exactly as for a body. The txid-list
authentication is shared with the parent-reuse rule.
This was referenced Sep 21, 2026
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
Eighty-five blocks carry the same invalid P2SH spend as #13's four bodies, but for them only the header, the 123-byte transaction and the block's ordered transaction IDs survive, not the other transaction bytes. This adds a second evidence kind for that one rule:
proofs/{height}-{hash}.jsonholds the failing transaction's hex and the block's complete ordered txids (schema section). The list must reproduce the header's merkle root and contain the transaction's txid, which binds the transaction to the header without the other bodies. From there the input is checked exactly as for a body: the funding transaction is fetched and authenticated,VerifySignatureruns it with no flags,VerifyScriptruns it withSCRIPT_VERIFY_P2SH, and it must pass the first and fail the second. The txid-list authentication is now one shared function that the parent-reuse rule's Esplora path also uses. A record has a body or a proof file, not both; a proof file for any other rule, or one whose name matches no record, is an error.Three records come in this way, chosen for their contemporary witnesses. 173886 is the first rejection: a node log pasted to the 7 April 2012 bitcoin-dev log shows it received at 14:58:54 UTC on 1 April and rejected with
ConnectInputsfailing on the spend; its txids come from the Wayback capture of the blockchain.info block page. 174772 is the block the 28 November 2012 log shows an unpatched node connecting as its best chain. 189498 is the last, reported in the 17 July 2012 log. The latter two's txids come from the Decker and Wattenhofer orphan archive preserved in mergedmonitor. Each record cites its txid source and its log asscrapeobservations. The remaining 82 follow in a bulk PR once this shape is agreed.Testing
python ci/sanity-check.py --fetch-prevoutsand the offline run both pass with 61 blocks, 61 contexts, 213 observations, 16 block files and 3 proof files. All 43 tests pass: the new dataset test admits 173886 from its proof and rejects a proof whose transaction is not in the list, a list that does not reproduce the merkle root, a proof beside a body, and an orphan proof file; the parent-txid tests still pass against the shared authenticator. Eachprev_hashwas checked against mempool.space's block at height minus one.