Return script errors for invalid tapscript signature operations - #22
Open
adrienlacombe wants to merge 2 commits into
Open
adrienlacombe wants to merge 2 commits into
adrienlacombe wants to merge 2 commits into
Conversation
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.
Invalid 32-byte x-only public keys and executed Tapscript
CHECKMULTISIG/CHECKMULTISIGVERIFYcurrently panic. Return the existingSchnorrSigandTapscriptCheckMultiSigerrors instead. Skipped multisig opcodes remain ignored.Keep signature size and hash-type validation ahead of public-key point verification. In particular,
SIGHASH_SINGLEwithout a corresponding output returnsSchnorrSigHashtypefor both ordinary SINGLE and SINGLE|ANYONECANPAY. Match onlyTaprootError::SingleMissingOutput; malformed caller-supplied transaction context remains distinct from script rejection. Legacy/Segwit multisig implementation and the public method's 32-byte key precondition are outside this change.Validation: all 20 tests pass with
cargo test --locked, including eight new groups covering valid-signature controls, all three signature opcodes, invalid key points, signature size/type precedence, missing SINGLE outputs, malformed-prevout distinction, and executed/skipped multisig. Three initial regression groups panic on the unchanged upstream code. The SINGLE error mapping additionally follows Core's pinned signature checker.A separate funded Taproot experiment validates six original panic cases and their controls against Core v30.3 (
49faec4f), checking exact rejection diagnostics. All match after integration. The missing-SINGLE-output case has local regression coverage and Core source inspection; it is not part of that 20-transaction Core corpus.