Repository navigation
Conversation
Add two p2pkh inputs whose scriptSig also pushes another valid pubkey. In `<sig> <pubkey> <bogus_sig> OP_OVER OP_CHECKSIG OP_IF <other_pubkey> OP_ENDIF`, evaluating the scriptSig with a checker that accepts any signature leaves <other_pubkey> on top of the stack. This is the scriptSig of the test added in bitcoin/bitcoin#36338. In `<other_pubkey> OP_DROP <sig> <pubkey>`, taking the first 33-byte push without checking its hash finds <other_pubkey>.
Contributor
Author
|
With bitcoin/bitcoin#36338 merged, Core's master (db0bde16) passes all 30 vectors in this file, so Core and reference.py now agree on them. |
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.
This adds two test vectors, each with a p2pkh input whose scriptSig also pushes another valid pubkey.
The first uses the scriptSig from the test in bitcoin/bitcoin#36338 by @theStack:
<sig> <pubkey> <bogus_sig> OP_OVER OP_CHECKSIG OP_IF <other_pubkey> OP_ENDIF. Evaluating this scriptSig with a checker that accepts any signature leaves<other_pubkey>on top of the stack. The existing malleated p2pkh vector does not cover this.The second is the
<dummy> OP_DROP <sig> <pubkey>case @jonatack suggested in that PR, with a valid pubkey as the dummy. It catches an extractor that takes the first 33-byte push without checking its hash.The expected values come from reference.py. btclib-wallet's vector tests also pass on the new file.
I ran Bitcoin Core's
bip352_testswith the new file in place of its vendored copy:Core's test does not compare
input_pub_keys, so each failure shows on the receiving side: the wrong key gives a wrong tweak, and no output is found.Made with my usual tools: a computer, the Internet and an LLM. The mistakes, as usual, are all mine.