test: add CHECKSIGVERIFY/CHECKMULTISIGVERIFY failure script test vectors
What changed, and why it matters
This commit only adds two new test cases to a JSON test file used by Bitcoin Core's automated test suite. The tests verify that certain script operations (CHECKSIGVERIFY and CHECKMULTISIGVERIFY) produce the expected error codes when they fail. No production code was changed, so this cannot introduce or fix a security vulnerability on its own.
No action required. This is a benign test-only addition. Reviewers may optionally confirm the test vectors match the documented script semantics.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff appends two negative test vectors to src/test/data/script_tests.json. Each vector exercises a script that should fail with a specific error code (CHECKSIGVERIFY and CHECKMULTISIGVERIFY respectively). This is purely an expansion of regression-test coverage for script validation behavior; it does not modify consensus, policy, P2P, wallet, or any runtime code path.
Changed components
src/test/data/script_tests.jsonInspect captured patch +4 / −0
diff --git a/src/test/data/script_tests.json b/src/test/data/script_tests.json
index 25581c4d..a90ec795 100644
--- a/src/test/data/script_tests.json
+++ b/src/test/data/script_tests.json
@@ -2569,6 +2569,10 @@
"P2SH(P2WSH) CHECKMULTISIG with second key uncompressed and signing with the second key"
],
+["CHECKSIGVERIFY and CHECKMULTISIGVERIFY failure tests"],
+["0", "0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 CHECKSIGVERIFY 1", "P2SH,STRICTENC", "CHECKSIGVERIFY", "CHECKSIGVERIFY fails with its own error code when the signature check fails"],
+["0 0", "1 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 1 CHECKMULTISIGVERIFY 1", "P2SH,STRICTENC", "CHECKMULTISIGVERIFY", "CHECKMULTISIGVERIFY fails with its own error code when the signature check fails"],
+
["CHECKSEQUENCEVERIFY tests"],
["", "CHECKSEQUENCEVERIFY", "CHECKSEQUENCEVERIFY", "INVALID_STACK_OPERATION", "CSV automatically fails on an empty stack"],
["-1", "CHECKSEQUENCEVERIFY", "CHECKSEQUENCEVERIFY", "NEGATIVE_LOCKTIME", "CSV automatically fails if stack top is negative"],
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.