Skip to content

feat(dataset): admit P2SH failures from proof files, starting with 173886, 174772 and 189498 - #14

Merged
deadmanoz merged 1 commit into
mainfrom
p2sh-proofs
Sep 21, 2026
Merged

deadmanoz merged 1 commit into
mainfrom
p2sh-proofs

Conversation

@deadmanoz

Copy link
Copy Markdown
Collaborator

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}.json holds 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, VerifySignature runs it with no flags, VerifyScript runs it with SCRIPT_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 ConnectInputs failing 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 as scrape observations. The remaining 82 follow in a bulk PR once this shape is agreed.

Testing

python ci/sanity-check.py --fetch-prevouts and 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. Each prev_hash was checked against mempool.space's block at height minus one.

…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.
@deadmanoz
deadmanoz merged commit f082745 into main Sep 21, 2026
1 check passed
@deadmanoz
deadmanoz deleted the p2sh-proofs branch September 21, 2026 09:06
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