diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -1462,7 +1462,7 @@ const CPubKey &pubkey, const uint256 &sighash, uint32_t flags) const { - if ((flags & SCRIPT_ENABLE_SCHNORR) && (vchSig.size() == 64)) { + if (vchSig.size() == 64) { return pubkey.VerifySchnorr(sighash, vchSig); } else { return pubkey.VerifyECDSA(sighash, vchSig); diff --git a/src/script/script_flags.h b/src/script/script_flags.h --- a/src/script/script_flags.h +++ b/src/script/script_flags.h @@ -103,11 +103,6 @@ // SCRIPT_VERIFY_CHECKDATASIG_SIGOPS = (1U << 18), - // Are Schnorr signatures enabled for OP_CHECK(DATA)SIG(VERIFY) and - // 65-byte signatures banned for OP_CHECKMULTISIG(VERIFY)? - // - SCRIPT_ENABLE_SCHNORR = (1U << 19), - // The exception to CLEANSTACK and P2SH for the recovery of coins sent // to p2sh segwit addresses is not allowed. SCRIPT_DISALLOW_SEGWIT_RECOVERY = (1U << 20), diff --git a/src/script/sigencoding.cpp b/src/script/sigencoding.cpp --- a/src/script/sigencoding.cpp +++ b/src/script/sigencoding.cpp @@ -156,9 +156,8 @@ static bool CheckRawECDSASignatureEncoding(const slicedvaltype &sig, uint32_t flags, ScriptError *serror) { - if ((flags & SCRIPT_ENABLE_SCHNORR) && (sig.size() == 64)) { - // In an ECDSA-only context, 64-byte signatures are banned when - // Schnorr flag set. + if (sig.size() == 64) { + // In an ECDSA-only context, 64-byte signatures are forbidden. return set_error(serror, SCRIPT_ERR_SIG_BADLENGTH); } if ((flags & (SCRIPT_VERIFY_DERSIG | SCRIPT_VERIFY_LOW_S | @@ -176,9 +175,9 @@ static bool CheckRawSignatureEncoding(const slicedvaltype &sig, uint32_t flags, ScriptError *serror) { - if ((flags & SCRIPT_ENABLE_SCHNORR) && (sig.size() == 64)) { + if (sig.size() == 64) { // In a generic-signature context, 64-byte signatures are interpreted - // as Schnorr signatures (always correctly encoded) when flag set. + // as Schnorr signatures (which are never incorrectly encoded). return true; } return CheckRawECDSASignatureEncoding(sig, flags, serror); diff --git a/src/test/data/script_tests.json b/src/test/data/script_tests.json --- a/src/test/data/script_tests.json +++ b/src/test/data/script_tests.json @@ -1123,88 +1123,6 @@ "SIG_DER", "Non canonical DER encoding" ], -["Schnorr flag on: CHECKDATASIG unchanged"], -["", "CHECKDATASIG", "P2SH,STRICTENC,NULLFAIL,SCHNORR", "INVALID_STACK_OPERATION"], -["0", "CHECKDATASIG", "P2SH,STRICTENC,NULLFAIL,SCHNORR", "INVALID_STACK_OPERATION"], -["0 0", "CHECKDATASIG", "P2SH,STRICTENC,NULLFAIL,SCHNORR", "INVALID_STACK_OPERATION"], -[ - "0 0", - "0 CHECKDATASIG", - "P2SH,STRICTENC,NULLFAIL,SCHNORR", - "PUBKEYTYPE" -], -[ - "0 0", - "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKDATASIG", - "P2SH,STRICTENC,NULLFAIL,SCHNORR", - "EVAL_FALSE" -], -[ - "0x08 0x3006020101020101 0", - "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKDATASIG", - "P2SH,STRICTENC,SCHNORR", - "EVAL_FALSE", "Check that NULLFAIL trigger only when specified" -], -[ - "0x08 0x3006020101020101 0", - "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKDATASIG", - "P2SH,STRICTENC,NULLFAIL,SCHNORR", - "NULLFAIL" -], -[ - "0x09 0x300602010102010101 0", - "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKDATASIG", - "P2SH,STRICTENC,NULLFAIL,SCHNORR", - "SIG_DER", "Ensure that sighashtype is ignored" -], -[ - "0x09 0x300702010102020001 0", - "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKDATASIG", - "P2SH,STRICTENC,NULLFAIL,CHECKDATASIG,SCHNORR", - "SIG_DER", "Non canonical DER encoding" -], - -["Schnorr flag on: CHECKDATASIGVERIFY unchanged"], -["", "CHECKDATASIGVERIFY 1", "P2SH,STRICTENC,SCHNORR", "INVALID_STACK_OPERATION"], -["0", "CHECKDATASIGVERIFY 1", "P2SH,STRICTENC,NULLFAIL,SCHNORR", "INVALID_STACK_OPERATION"], -["0 0", "CHECKDATASIGVERIFY 1", "P2SH,STRICTENC,NULLFAIL,SCHNORR", "INVALID_STACK_OPERATION"], -[ - "0 0", - "0 CHECKDATASIGVERIFY 1", - "P2SH,STRICTENC,NULLFAIL,SCHNORR", - "PUBKEYTYPE" -], -[ - "0 0", - "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKDATASIGVERIFY 1", - "P2SH,STRICTENC,NULLFAIL,SCHNORR", - "CHECKDATASIGVERIFY" -], -[ - "0x08 0x3006020101020101 0", - "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKDATASIGVERIFY 1", - "P2SH,STRICTENC,SCHNORR", - "CHECKDATASIGVERIFY", "Check that NULLFAIL trigger only when specified" -], -[ - "0x08 0x3006020101020101 0", - "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKDATASIGVERIFY 1", - "P2SH,STRICTENC,NULLFAIL,SCHNORR", - "NULLFAIL" -], -[ - "0x09 0x300602010102010101 0", - "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKDATASIGVERIFY 1", - "P2SH,STRICTENC,NULLFAIL,SCHNORR", - "SIG_DER", "Ensure that sighashtype is ignored" -], -[ - "0x09 0x300702010102020001 0", - "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKDATASIGVERIFY 1", - "P2SH,STRICTENC,NULLFAIL,CHECKDATASIG,SCHNORR", - "SIG_DER", "Non canonical DER encoding" -], - ["ADD"], ["2147483648 0 ADD", "NOP", "P2SH,STRICTENC", "UNKNOWN_ERROR", "arithmetic operands must be in range [-2^31...2^31] "], ["-2147483648 0 ADD", "NOP", "P2SH,STRICTENC", "UNKNOWN_ERROR", "arithmetic operands must be in range [-2^31...2^31] "], @@ -1578,25 +1496,17 @@ ["64/65-byte sig length tests"], ["0x41 0x303e021d4444444444444444444444444444444444444444444444444444444444021d444444444444444444444444444444444444444444444444444444444401", "0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 CHECKSIG NOT", "", "OK"], ["0x40 0x303e021d4444444444444444444444444444444444444444444444444444444444021d4444444444444444444444444444444444444444444444444444444444", "0 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 CHECKDATASIG NOT", "", "OK"], -["0x41 0x303e021d4444444444444444444444444444444444444444444444444444444444021d444444444444444444444444444444444444444444444444444444444401", " 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 CHECKSIG NOT", "SCHNORR", "OK"], -["0x40 0x303e021d4444444444444444444444444444444444444444444444444444444444021d4444444444444444444444444444444444444444444444444444444444", "0 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 CHECKDATASIG NOT", "SCHNORR", "OK"], -["0 0x41 0x303e021d4444444444444444444444444444444444444444444444444444444444021d444444444444444444444444444444444444444444444444444444444401", "1 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 1 CHECKMULTISIG NOT", "", "OK"], -["0 0x41 0x303e021d4444444444444444444444444444444444444444444444444444444444021d444444444444444444444444444444444444444444444444444444444401", "1 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 1 CHECKMULTISIG NOT", "STRICTENC", "OK"], -["0 0x41 0x303e021d4444444444444444444444444444444444444444444444444444444444021d444444444444444444444444444444444444444444444444444444444401", "1 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 1 CHECKMULTISIG NOT", "SCHNORR", "SIG_BADLENGTH"], -["0 0x41 0x303e021d4444444444444444444444444444444444444444444444444444444444021d444444444444444444444444444444444444444444444444444444444401", "1 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 1 CHECKMULTISIG NOT", "SCHNORR,STRICTENC,NULLFAIL", "SIG_BADLENGTH"], -["0 0x40 0x303d021d4444444444444444444444444444444444444444444444444444444444021c4444444444444444444444444444444444444444444444444444444401", "1 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 1 CHECKMULTISIG NOT", "SCHNORR", "OK"], -["0 0x42 0x303f021d4444444444444444444444444444444444444444444444444444444444021e44444444444444444444444444444444444444444444444444444444444401", "1 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 1 CHECKMULTISIG NOT", "SCHNORR", "OK"], +["0 0x41 0x303e021d4444444444444444444444444444444444444444444444444444444444021d444444444444444444444444444444444444444444444444444444444401", "1 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 1 CHECKMULTISIG NOT", "", "SIG_BADLENGTH"], +["0 0x41 0x303e021d4444444444444444444444444444444444444444444444444444444444021d444444444444444444444444444444444444444444444444444444444401", "1 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 1 CHECKMULTISIG NOT", "STRICTENC,NULLFAIL", "SIG_BADLENGTH"], +["0 0x40 0x303d021d4444444444444444444444444444444444444444444444444444444444021c4444444444444444444444444444444444444444444444444444444401", "1 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 1 CHECKMULTISIG NOT", "", "OK"], +["0 0x42 0x303f021d4444444444444444444444444444444444444444444444444444444444021e44444444444444444444444444444444444444444444444444444444444401", "1 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 1 CHECKMULTISIG NOT", "", "OK"], ["0x41 0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", "0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 CHECKSIG NOT", "", "OK"], -["0x41 0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", "0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 CHECKSIG NOT", "STRICTENC", "SIG_DER"], -["0x41 0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", "0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 CHECKSIG NOT", "STRICTENC,SCHNORR", "OK"], +["0x41 0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", "0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 CHECKSIG NOT", "STRICTENC", "OK"], ["0x40 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "0 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 CHECKDATASIG NOT", "", "OK"], -["0x40 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "0 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 CHECKDATASIG NOT", "STRICTENC", "SIG_DER"], -["0x40 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "0 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 CHECKDATASIG NOT", "STRICTENC,SCHNORR", "OK"], -["0 0x41 0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", "1 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 1 CHECKMULTISIG NOT", "", "OK"], -["0 0x41 0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", "1 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 1 CHECKMULTISIG NOT", "STRICTENC", "SIG_DER"], -["0 0x41 0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", "1 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 1 CHECKMULTISIG NOT", "STRICTENC,SCHNORR", "SIG_BADLENGTH"], -["0 0x41 0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", "1 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 1 CHECKMULTISIG NOT", "STRICTENC,NULLFAIL,SCHNORR", "SIG_BADLENGTH"], +["0x40 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "0 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 CHECKDATASIG NOT", "STRICTENC", "OK"], +["0 0x41 0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", "1 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 1 CHECKMULTISIG NOT", "STRICTENC", "SIG_BADLENGTH"], +["0 0x41 0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", "1 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 1 CHECKMULTISIG NOT", "STRICTENC,NULLFAIL", "SIG_BADLENGTH"], @@ -2477,283 +2387,31 @@ "PUBKEYTYPE", "CHECKDATASIGVERIFY with invalid hybrid pubkey" ], -[ - "0x47 0x3044022022127048516d473153d1f74e46e828496776752e3255f672f760a41e83f54e6f0220502956b739ed82aad916dc4a73e1fd55d02aad514b5211f1ba7d0dadf53c637901", - "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", - "SCHNORR", - "OK", - "P2PK ECDSA with Schnorr flag on" -], -[ - "0x47 0x3044022022127048516d463153d1f74e46e828496776752e3255f672f760a41e83f54e6f0220502956b739ed82aad916dc4a73e1fd55d02aad514b5211f1ba7d0dadf53c637901", - "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", - "SCHNORR", - "EVAL_FALSE", - "P2PK, bad sig ECDSA with Schnorr flag on" -], -[ - "0x47 0x304402201e0ec3c6c263f34049c93e0bc646d7287ca2cc6571d658e4e7269daebc96ef35022009841f101e6dcaba8993d0259e5732a871e253be807556bf5618bf0bc3e84af001 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508", - "DUP HASH160 0x14 0x1018853670f9f3b0582c5b9ee8ce93764ac32b93 EQUALVERIFY CHECKSIG", - "SCHNORR", - "OK", - "P2PKH ECDSA with Schnorr flag on" -], -[ - "0 0x47 0x304402205b6256a4755890fe278ea083eddf5c0519d0d7fad14fe265e077c5627171b27e02200d841cb15cdc9a9c8f3ec20c5e4bb1b0e5715d26353f500378f4215195e3558c01 0x47 0x304402200b0620f910e92621934e88ae0177b0bb381ba812d4c23c77afbf1a3ab637a0bb0220275387c859089939e22d803dfae77a4ecd122d951d0feb9e6a65a6918c2b1e0201 0x4c69 0x52210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179821038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f515082103363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff464053ae", - "HASH160 0x14 0xc9e4a896d149702d0d1695434feddd52e24ad78d EQUAL", - "P2SH,SCHNORR", - "OK", - "P2SH(2-of-3) ECDSA with Schnorr flag on" -], -[ - "0x48 0x3045022032d4a3dec9cad54c94b5585fb058f7e41ac5173843b0c2e7197a40421ee4ab54022100be2b2bd69273d7de44c609cb60febf428e18eb821869006e368b06259318896901", - "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG", - "LOW_S,SCHNORR", - "SIG_HIGH_S", - "LOW_S violating ECDSA with Schnorr flag on" -], -[ - "0x47 0x304402201162483d0440fc508d79d314a91cfc4df4ea31b302f02c16893fa15d9c9f7f06022032afebdd5b2964c40c887b967f9599e0e5b5ff5b2f899ab62ada12a5af2a481701", - "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", - "SCHNORR,STRICTENC", - "PUBKEYTYPE", - "STRICTENC-violating hybrid pubkey with Schnorr flag on" -], -[ - "0x46 0x3044022021309a532a60d471cc4ef025a96572c7bf26c4640b53c7d45e411a5aa99980f6022037964f01a61db1b24ea44137b3d67d7095ec25f68bd7b508e01441e5539d96a9 0", - "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKDATASIG", - "NULLFAIL,SCHNORR,STRICTENC", - "OK", - "Standard CHECKDATASIG" -], -[ - "0x46 0x3044022021309a532a60d471cc4ef025a96572c7bf26c4640b53c7d45e411a5aa99980f6022037964f01a61db1b24ea44137b3d67d7095ec25f68bd7b508e01441e5539d96a9 1", - "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKDATASIG NOT", - "NULLFAIL,SCHNORR,STRICTENC", - "NULLFAIL", - "CHECKDATASIG with NULLFAIL flags" -], -[ - "0x46 0x3044022021309a532a60d471cc4ef025a96572c7bf26c4640b53c7d45e411a5aa99980f6022037964f01a61db1b24ea44137b3d67d7095ec25f68bd7b508e01441e5539d96a9 1", - "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKDATASIG NOT", - "SCHNORR,STRICTENC", - "OK", - "CHECKDATASIG without NULLFAIL flags" -], -[ - "0 0", - "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKDATASIG NOT", - "NULLFAIL,SCHNORR,STRICTENC", - "OK", - "CHECKDATASIG empty signature" -], -[ - "0x47 0x3045022021309a532a60d471cc4ef025a96572c7bf26c4640b53c7d45e411a5aa99980f6022100c869b0fe59e24e4db15bbec84c29828e24c2b6f02370eb32dfbe1ca77c98aa98 0", - "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKDATASIG", - "NULLFAIL,SCHNORR,STRICTENC", - "OK", - "CHECKDATASIG with High S but no Low S" -], -[ - "0x47 0x3045022021309a532a60d471cc4ef025a96572c7bf26c4640b53c7d45e411a5aa99980f6022100c869b0fe59e24e4db15bbec84c29828e24c2b6f02370eb32dfbe1ca77c98aa98 0", - "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKDATASIG", - "LOW_S,NULLFAIL,SCHNORR,STRICTENC", - "SIG_HIGH_S", - "CHECKDATASIG with High S" -], -[ - "0x46 0x3044022093cbfaab2bbef6fc019d1286018fd11e2612d817756d40913b3f82a428f1e90a022045d010bd0f3c31aa470d096bb3f693275214f48d4e727f45a9e0adb2645d7489 0", - "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKDATASIG", - "NULLFAIL,SCHNORR", - "OK", - "CHECKDATASIG with too little R padding but no DERSIG" -], -[ - "0x46 0x3044022093cbfaab2bbef6fc019d1286018fd11e2612d817756d40913b3f82a428f1e90a022045d010bd0f3c31aa470d096bb3f693275214f48d4e727f45a9e0adb2645d7489 0", - "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKDATASIG", - "NULLFAIL,SCHNORR,STRICTENC", - "SIG_DER", - "CHECKDATASIG with too little R padding" -], -[ - "0x46 0x304402205ffea7d9fa4e0ce8058c96edfb721aaf2840912080ac4ae86a92d9462e69fde302203567149cb9c8c343523a87d7a64be304983899d2e2c6f267a7136c48ff21908d 0", - "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKDATASIG", - "NULLFAIL,SCHNORR", - "OK", - "CHECKDATASIG with hybrid pubkey but no STRICTENC" -], -[ - "0x46 0x304402205ffea7d9fa4e0ce8058c96edfb721aaf2840912080ac4ae86a92d9462e69fde302203567149cb9c8c343523a87d7a64be304983899d2e2c6f267a7136c48ff21908d 0", - "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKDATASIG", - "NULLFAIL,SCHNORR,STRICTENC", - "PUBKEYTYPE", - "CHECKDATASIG with hybrid pubkey" -], -[ - "0x46 0x304402205ffea7d9fa4e0de8058c96edfb721aaf2840912080ac4ae86a92d9462e69fde302203567149cb9c8c343523a87d7a64be304983899d2e2c6f267a7136c48ff21908d 0", - "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKDATASIG NOT", - "", - "OK", - "CHECKDATASIG with invalid hybrid pubkey but no STRICTENC" -], -[ - "0x46 0x304402205ffea7d9fa4e0de8058c96edfb721aaf2840912080ac4ae86a92d9462e69fde302203567149cb9c8c343523a87d7a64be304983899d2e2c6f267a7136c48ff21908d 0", - "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKDATASIG", - "NULLFAIL,SCHNORR,STRICTENC", - "PUBKEYTYPE", - "CHECKDATASIG with invalid hybrid pubkey" -], -[ - "0x46 0x3044022021309a532a60d471cc4ef025a96572c7bf26c4640b53c7d45e411a5aa99980f6022037964f01a61db1b24ea44137b3d67d7095ec25f68bd7b508e01441e5539d96a9 0", - "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKDATASIGVERIFY 1", - "NULLFAIL,SCHNORR,STRICTENC", - "OK", - "Standard CHECKDATASIGVERIFY" -], -[ - "0x46 0x3044022021309a532a60d471cc4ef025a96572c7bf26c4640b53c7d45e411a5aa99980f6022037964f01a61db1b24ea44137b3d67d7095ec25f68bd7b508e01441e5539d96a9 1", - "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKDATASIGVERIFY 1", - "NULLFAIL,SCHNORR,STRICTENC", - "NULLFAIL", - "CHECKDATASIGVERIFY with NULLFAIL flags" -], -[ - "0x46 0x3044022021309a532a60d471cc4ef025a96572c7bf26c4640b53c7d45e411a5aa99980f6022037964f01a61db1b24ea44137b3d67d7095ec25f68bd7b508e01441e5539d96a9 1", - "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKDATASIGVERIFY 1", - "SCHNORR,STRICTENC", - "CHECKDATASIGVERIFY", - "CHECKDATASIGVERIFY without NULLFAIL flags" -], -[ - "0 0", - "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKDATASIGVERIFY 1", - "NULLFAIL,SCHNORR,STRICTENC", - "CHECKDATASIGVERIFY", - "CHECKDATASIGVERIFY empty signature" -], -[ - "0x47 0x3045022021309a532a60d471cc4ef025a96572c7bf26c4640b53c7d45e411a5aa99980f6022100c869b0fe59e24e4db15bbec84c29828e24c2b6f02370eb32dfbe1ca77c98aa98 0", - "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKDATASIGVERIFY 1", - "NULLFAIL,SCHNORR,STRICTENC", - "OK", - "CHECKDATASIG with High S but no Low S" -], -[ - "0x47 0x3045022021309a532a60d471cc4ef025a96572c7bf26c4640b53c7d45e411a5aa99980f6022100c869b0fe59e24e4db15bbec84c29828e24c2b6f02370eb32dfbe1ca77c98aa98 0", - "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKDATASIGVERIFY 1", - "LOW_S,NULLFAIL,SCHNORR,STRICTENC", - "SIG_HIGH_S", - "CHECKDATASIG with High S" -], -[ - "0x46 0x3044022093cbfaab2bbef6fc019d1286018fd11e2612d817756d40913b3f82a428f1e90a022045d010bd0f3c31aa470d096bb3f693275214f48d4e727f45a9e0adb2645d7489 0", - "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKDATASIGVERIFY 1", - "NULLFAIL,SCHNORR", - "OK", - "CHECKDATASIGVERIFY with too little R padding but no DERSIG" -], -[ - "0x46 0x3044022093cbfaab2bbef6fc019d1286018fd11e2612d817756d40913b3f82a428f1e90a022045d010bd0f3c31aa470d096bb3f693275214f48d4e727f45a9e0adb2645d7489 0", - "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKDATASIGVERIFY 1", - "NULLFAIL,SCHNORR,STRICTENC", - "SIG_DER", - "CHECKDATASIGVERIFY with too little R padding" -], -[ - "0x46 0x304402205ffea7d9fa4e0ce8058c96edfb721aaf2840912080ac4ae86a92d9462e69fde302203567149cb9c8c343523a87d7a64be304983899d2e2c6f267a7136c48ff21908d 0", - "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKDATASIGVERIFY 1", - "NULLFAIL,SCHNORR", - "OK", - "CHECKDATASIGVERIFY with hybrid pubkey but no STRICTENC" -], -[ - "0x46 0x304402205ffea7d9fa4e0ce8058c96edfb721aaf2840912080ac4ae86a92d9462e69fde302203567149cb9c8c343523a87d7a64be304983899d2e2c6f267a7136c48ff21908d 0", - "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKDATASIGVERIFY 1", - "NULLFAIL,SCHNORR,STRICTENC", - "PUBKEYTYPE", - "CHECKDATASIGVERIFY with hybrid pubkey" -], -[ - "0x46 0x304402205ffea7d9fa4e0de8058c96edfb721aaf2840912080ac4ae86a92d9462e69fde302203567149cb9c8c343523a87d7a64be304983899d2e2c6f267a7136c48ff21908d 0", - "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKDATASIGVERIFY 1", - "", - "CHECKDATASIGVERIFY", - "CHECKDATASIGVERIFY with invalid hybrid pubkey but no STRICTENC" -], -[ - "0x46 0x304402205ffea7d9fa4e0de8058c96edfb721aaf2840912080ac4ae86a92d9462e69fde302203567149cb9c8c343523a87d7a64be304983899d2e2c6f267a7136c48ff21908d 0", - "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKDATASIGVERIFY 1", - "NULLFAIL,SCHNORR,STRICTENC", - "PUBKEYTYPE", - "CHECKDATASIGVERIFY with invalid hybrid pubkey" -], [ "0x41 0x0df4be7f5fe74b2855b92082720e889038e15d8d747334fa3f300ef4ab1db1eea56aa83d1d60809ff6703791736be87cfb6cbc5c4036aeed3b4ea4e6dab3509001", "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", "", - "EVAL_FALSE", - "CHECKSIG Schnorr w/ neither STRICTENC,SCHNORR" -], -[ - "0x47 0x3044022022127048516d473153d1f74e46e828496776752e3255f672f760a41e83f54e6f0220502956b739ed82aad916dc4a73e1fd55d02aad514b5211f1ba7d0dadf53c637901", - "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", - "", - "OK", - "CHECKSIG ECDSA w/ neither STRICTENC,SCHNORR" -], -[ - "0x41 0x0df4be7f5fe74b2855b92082720e889038e15d8d747334fa3f300ef4ab1db1eea56aa83d1d60809ff6703791736be87cfb6cbc5c4036aeed3b4ea4e6dab3509001", - "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", - "SCHNORR", "OK", - "CHECKSIG Schnorr w/ SCHNORR" -], -[ - "0x47 0x3044022022127048516d473153d1f74e46e828496776752e3255f672f760a41e83f54e6f0220502956b739ed82aad916dc4a73e1fd55d02aad514b5211f1ba7d0dadf53c637901", - "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", - "SCHNORR", - "OK", - "CHECKSIG ECDSA w/ SCHNORR" + "CHECKSIG Schnorr" ], [ "0x41 0x0df4be7f5fe74b2855b92082720e889038e15d8d747334fa3f300ef4ab1db1eea56aa83d1d60809ff6703791736be87cfb6cbc5c4036aeed3b4ea4e6dab3509001", "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", "STRICTENC", - "SIG_DER", - "CHECKSIG Schnorr w/ STRICTENC" -], -[ - "0x47 0x3044022022127048516d473153d1f74e46e828496776752e3255f672f760a41e83f54e6f0220502956b739ed82aad916dc4a73e1fd55d02aad514b5211f1ba7d0dadf53c637901", - "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", - "STRICTENC", - "OK", - "CHECKSIG ECDSA w/ STRICTENC" -], -[ - "0x41 0x0df4be7f5fe74b2855b92082720e889038e15d8d747334fa3f300ef4ab1db1eea56aa83d1d60809ff6703791736be87cfb6cbc5c4036aeed3b4ea4e6dab3509001", - "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", - "SCHNORR,STRICTENC", - "OK", - "CHECKSIG Schnorr w/ STRICTENC,SCHNORR" -], -[ - "0x47 0x3044022022127048516d473153d1f74e46e828496776752e3255f672f760a41e83f54e6f0220502956b739ed82aad916dc4a73e1fd55d02aad514b5211f1ba7d0dadf53c637901", - "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", - "SCHNORR,STRICTENC", "OK", - "CHECKSIG ECDSA w/ STRICTENC,SCHNORR" + "CHECKSIG Schnorr w/ STRICTENC" ], [ "0x41 0x3cf1b3f60b74d0821039f7dc7c21abe3119b9d94ae13f5e5258a8269bee9dfc51c84dbb3ba3eff82de61046f6cfef22ea5cf4a46e3776a5fb35d743aea310f6701", "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG", - "SCHNORR,STRICTENC", + "STRICTENC", "OK", "CHECKSIG Schnorr other key" ], [ "0x41 0x35b32856cbd89eb40130a50c6931ce002e3e9db033179ab6265a276a04795ec8f87e9b4d8343f399915371d7f4a7d4d0c97753f2473b253197695a58eede92de01", "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG NOT", - "SCHNORR,STRICTENC", + "STRICTENC", "OK", "CHECKSIG Schnorr mismatched key" ], @@ -2761,69 +2419,27 @@ "0x41 0x8d37e95e36718d7fbc8ffd63b0b4ebb89dd5fb683510a95345869399f810a8724a00e5cbbb2190205ffabac601d80bf110a67013521b7a7c02b2a51e07d723eb01", "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIGVERIFY 1", "", - "CHECKSIGVERIFY", - "CHECKSIGVERIFY Schnorr w/ neither STRICTENC,SCHNORR" -], -[ - "0x47 0x304402205d5a925acf881167da7850d838cd4f73d077d08aacf9d2885d10b7850c5a828602201f42383e317ec427dbd71f3a6031a0ff27e431b7089fbc80ebea31b5f8949be601", - "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIGVERIFY 1", - "", "OK", - "CHECKSIGVERIFY ECDSA w/ neither STRICTENC,SCHNORR" + "CHECKSIGVERIFY Schnorr" ], [ "0x41 0x8d37e95e36718d7fbc8ffd63b0b4ebb89dd5fb683510a95345869399f810a8724a00e5cbbb2190205ffabac601d80bf110a67013521b7a7c02b2a51e07d723eb01", "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIGVERIFY 1", - "SCHNORR", - "OK", - "CHECKSIGVERIFY Schnorr w/ SCHNORR" -], -[ - "0x47 0x304402205d5a925acf881167da7850d838cd4f73d077d08aacf9d2885d10b7850c5a828602201f42383e317ec427dbd71f3a6031a0ff27e431b7089fbc80ebea31b5f8949be601", - "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIGVERIFY 1", - "SCHNORR", - "OK", - "CHECKSIGVERIFY ECDSA w/ SCHNORR" -], -[ - "0x41 0x8d37e95e36718d7fbc8ffd63b0b4ebb89dd5fb683510a95345869399f810a8724a00e5cbbb2190205ffabac601d80bf110a67013521b7a7c02b2a51e07d723eb01", - "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIGVERIFY 1", - "STRICTENC", - "SIG_DER", - "CHECKSIGVERIFY Schnorr w/ STRICTENC" -], -[ - "0x47 0x304402205d5a925acf881167da7850d838cd4f73d077d08aacf9d2885d10b7850c5a828602201f42383e317ec427dbd71f3a6031a0ff27e431b7089fbc80ebea31b5f8949be601", - "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIGVERIFY 1", "STRICTENC", "OK", - "CHECKSIGVERIFY ECDSA w/ STRICTENC" -], -[ - "0x41 0x8d37e95e36718d7fbc8ffd63b0b4ebb89dd5fb683510a95345869399f810a8724a00e5cbbb2190205ffabac601d80bf110a67013521b7a7c02b2a51e07d723eb01", - "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIGVERIFY 1", - "SCHNORR,STRICTENC", - "OK", - "CHECKSIGVERIFY Schnorr w/ STRICTENC,SCHNORR" -], -[ - "0x47 0x304402205d5a925acf881167da7850d838cd4f73d077d08aacf9d2885d10b7850c5a828602201f42383e317ec427dbd71f3a6031a0ff27e431b7089fbc80ebea31b5f8949be601", - "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIGVERIFY 1", - "SCHNORR,STRICTENC", - "OK", - "CHECKSIGVERIFY ECDSA w/ STRICTENC,SCHNORR" + "CHECKSIGVERIFY Schnorr w/ STRICTENC" ], [ "0x41 0x53c4de3cb6a0190073c98fa415f63b720ea491748c9a760d5d249bb05f13990aa464be04b625cc36cd9e302dc276ad232d5d65d6327bdb18b7c529300d67013f01", "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIGVERIFY 1", - "SCHNORR,STRICTENC", + "STRICTENC", "OK", "CHECKSIGVERIFY Schnorr other key" ], [ "0x41 0x74c51dae216d8ebee5418204cf90839ea9a288b93eccb1de54b5b5d06bcd69c7028e1b3c6643c001403e7862bee6be39c107e5c8d0a9a8e9143862e5d73c555a01", "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIGVERIFY 1", - "SCHNORR,STRICTENC", + "STRICTENC", "CHECKSIGVERIFY", "CHECKSIGVERIFY Schnorr mismatched key" ], @@ -2831,83 +2447,41 @@ "0x40 0x9db0671f61f1fafa84aaab76ad2e070b27cf9ae85338bafc0b947ac9ad8c56ff7b24aa76c95ad86bb13cbff314742dbe1f545869d1a28efa54b411ccd37717e5", "0 0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKDATASIG", "", - "EVAL_FALSE", - "CHECKDATASIG Schnorr w/ neither STRICTENC,SCHNORR" -], -[ - "0x46 0x304402205ffea7d9fa4e0ce8058c96edfb721aaf2840912080ac4ae86a92d9462e69fde302203567149cb9c8c343523a87d7a64be304983899d2e2c6f267a7136c48ff21908d", - "0 0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKDATASIG", - "", - "OK", - "CHECKDATASIG ECDSA w/ neither STRICTENC,SCHNORR" -], -[ - "0x40 0x9db0671f61f1fafa84aaab76ad2e070b27cf9ae85338bafc0b947ac9ad8c56ff7b24aa76c95ad86bb13cbff314742dbe1f545869d1a28efa54b411ccd37717e5", - "0 0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKDATASIG", - "SCHNORR", - "OK", - "CHECKDATASIG Schnorr w/ SCHNORR" -], -[ - "0x46 0x304402205ffea7d9fa4e0ce8058c96edfb721aaf2840912080ac4ae86a92d9462e69fde302203567149cb9c8c343523a87d7a64be304983899d2e2c6f267a7136c48ff21908d", - "0 0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKDATASIG", - "SCHNORR", "OK", - "CHECKDATASIG ECDSA w/ SCHNORR" + "CHECKDATASIG Schnorr" ], [ "0x40 0x9db0671f61f1fafa84aaab76ad2e070b27cf9ae85338bafc0b947ac9ad8c56ff7b24aa76c95ad86bb13cbff314742dbe1f545869d1a28efa54b411ccd37717e5", "0 0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKDATASIG", "STRICTENC", - "SIG_DER", - "CHECKDATASIG Schnorr w/ STRICTENC" -], -[ - "0x46 0x304402205ffea7d9fa4e0ce8058c96edfb721aaf2840912080ac4ae86a92d9462e69fde302203567149cb9c8c343523a87d7a64be304983899d2e2c6f267a7136c48ff21908d", - "0 0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKDATASIG", - "STRICTENC", "OK", - "CHECKDATASIG ECDSA w/ STRICTENC" -], -[ - "0x40 0x9db0671f61f1fafa84aaab76ad2e070b27cf9ae85338bafc0b947ac9ad8c56ff7b24aa76c95ad86bb13cbff314742dbe1f545869d1a28efa54b411ccd37717e5", - "0 0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKDATASIG", - "SCHNORR,STRICTENC", - "OK", - "CHECKDATASIG Schnorr w/ STRICTENC,SCHNORR" -], -[ - "0x46 0x304402205ffea7d9fa4e0ce8058c96edfb721aaf2840912080ac4ae86a92d9462e69fde302203567149cb9c8c343523a87d7a64be304983899d2e2c6f267a7136c48ff21908d", - "0 0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKDATASIG", - "SCHNORR,STRICTENC", - "OK", - "CHECKDATASIG ECDSA w/ STRICTENC,SCHNORR" + "CHECKDATASIG Schnorr w/ STRICTENC" ], [ "0x40 0x65c4bceda6ebb49e692180387e72c84be500f3431daac85d08d5d6c527e296f5b8a5b868a681f76aee309ad05e152b4f190732b3e7c46ef788b68c6035f6eab0", "0 0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKDATASIG", - "SCHNORR,STRICTENC", + "STRICTENC", "OK", "CHECKDATASIG Schnorr other key" ], [ "0x40 0x65c4bceda6ebb49e692180387e72c84be500f3431daac85d08d5d6c527e296f5b8a5b868a681f76aee309ad05e152b4f190732b3e7c46ef788b68c6035f6eab0", "0 0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKDATASIG NOT", - "SCHNORR,STRICTENC", + "STRICTENC", "OK", "CHECKDATASIG Schnorr mismatched key" ], [ "0x40 0xe20d68eea1c55d8c23310ef33b4c68e3d876b1c5a36595f4dcc9d728894c957879e53bb4aebf8b3aa36861d89266ff864d2c3f513ab6f79c9d226ad45fbf5407", "1 0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKDATASIG", - "SCHNORR,STRICTENC", + "STRICTENC", "OK", "CHECKDATASIG Schnorr other message" ], [ "0x40 0xe20d68eea1c55d8c23310ef33b4c68e3d876b1c5a36595f4dcc9d728894c957879e53bb4aebf8b3aa36861d89266ff864d2c3f513ab6f79c9d226ad45fbf5407", "0 0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKDATASIG NOT", - "SCHNORR,STRICTENC", + "STRICTENC", "OK", "CHECKDATASIG Schnorr wrong message" ], @@ -2915,83 +2489,41 @@ "0x40 0x9db0671f61f1fafa84aaab76ad2e070b27cf9ae85338bafc0b947ac9ad8c56ff7b24aa76c95ad86bb13cbff314742dbe1f545869d1a28efa54b411ccd37717e5", "0 0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKDATASIGVERIFY 1", "", - "CHECKDATASIGVERIFY", - "CHECKDATASIGVERIFY Schnorr w/ neither STRICTENC,SCHNORR" -], -[ - "0x46 0x304402205ffea7d9fa4e0ce8058c96edfb721aaf2840912080ac4ae86a92d9462e69fde302203567149cb9c8c343523a87d7a64be304983899d2e2c6f267a7136c48ff21908d", - "0 0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKDATASIGVERIFY 1", - "", "OK", - "CHECKDATASIGVERIFY ECDSA w/ neither STRICTENC,SCHNORR" -], -[ - "0x40 0x9db0671f61f1fafa84aaab76ad2e070b27cf9ae85338bafc0b947ac9ad8c56ff7b24aa76c95ad86bb13cbff314742dbe1f545869d1a28efa54b411ccd37717e5", - "0 0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKDATASIGVERIFY 1", - "SCHNORR", - "OK", - "CHECKDATASIGVERIFY Schnorr w/ SCHNORR" -], -[ - "0x46 0x304402205ffea7d9fa4e0ce8058c96edfb721aaf2840912080ac4ae86a92d9462e69fde302203567149cb9c8c343523a87d7a64be304983899d2e2c6f267a7136c48ff21908d", - "0 0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKDATASIGVERIFY 1", - "SCHNORR", - "OK", - "CHECKDATASIGVERIFY ECDSA w/ SCHNORR" + "CHECKDATASIGVERIFY Schnorr" ], [ "0x40 0x9db0671f61f1fafa84aaab76ad2e070b27cf9ae85338bafc0b947ac9ad8c56ff7b24aa76c95ad86bb13cbff314742dbe1f545869d1a28efa54b411ccd37717e5", "0 0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKDATASIGVERIFY 1", "STRICTENC", - "SIG_DER", - "CHECKDATASIGVERIFY Schnorr w/ STRICTENC" -], -[ - "0x46 0x304402205ffea7d9fa4e0ce8058c96edfb721aaf2840912080ac4ae86a92d9462e69fde302203567149cb9c8c343523a87d7a64be304983899d2e2c6f267a7136c48ff21908d", - "0 0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKDATASIGVERIFY 1", - "STRICTENC", - "OK", - "CHECKDATASIGVERIFY ECDSA w/ STRICTENC" -], -[ - "0x40 0x9db0671f61f1fafa84aaab76ad2e070b27cf9ae85338bafc0b947ac9ad8c56ff7b24aa76c95ad86bb13cbff314742dbe1f545869d1a28efa54b411ccd37717e5", - "0 0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKDATASIGVERIFY 1", - "SCHNORR,STRICTENC", - "OK", - "CHECKDATASIGVERIFY Schnorr w/ STRICTENC,SCHNORR" -], -[ - "0x46 0x304402205ffea7d9fa4e0ce8058c96edfb721aaf2840912080ac4ae86a92d9462e69fde302203567149cb9c8c343523a87d7a64be304983899d2e2c6f267a7136c48ff21908d", - "0 0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKDATASIGVERIFY 1", - "SCHNORR,STRICTENC", "OK", - "CHECKDATASIGVERIFY ECDSA w/ STRICTENC,SCHNORR" + "CHECKDATASIGVERIFY Schnorr w/ STRICTENC" ], [ "0x40 0x65c4bceda6ebb49e692180387e72c84be500f3431daac85d08d5d6c527e296f5b8a5b868a681f76aee309ad05e152b4f190732b3e7c46ef788b68c6035f6eab0", "0 0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKDATASIGVERIFY 1", - "SCHNORR,STRICTENC", + "STRICTENC", "OK", "CHECKDATASIGVERIFY Schnorr other key" ], [ "0x40 0x65c4bceda6ebb49e692180387e72c84be500f3431daac85d08d5d6c527e296f5b8a5b868a681f76aee309ad05e152b4f190732b3e7c46ef788b68c6035f6eab0", "0 0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKDATASIGVERIFY 1", - "SCHNORR,STRICTENC", + "STRICTENC", "CHECKDATASIGVERIFY", "CHECKDATASIGVERIFY Schnorr mismatched key" ], [ "0x40 0xe20d68eea1c55d8c23310ef33b4c68e3d876b1c5a36595f4dcc9d728894c957879e53bb4aebf8b3aa36861d89266ff864d2c3f513ab6f79c9d226ad45fbf5407", "1 0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKDATASIGVERIFY 1", - "SCHNORR,STRICTENC", + "STRICTENC", "OK", "CHECKDATASIGVERIFY Schnorr other message" ], [ "0x40 0xe20d68eea1c55d8c23310ef33b4c68e3d876b1c5a36595f4dcc9d728894c957879e53bb4aebf8b3aa36861d89266ff864d2c3f513ab6f79c9d226ad45fbf5407", "0 0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKDATASIGVERIFY 1", - "SCHNORR,STRICTENC", + "STRICTENC", "CHECKDATASIGVERIFY", "CHECKDATASIGVERIFY Schnorr wrong message" ], @@ -2999,258 +2531,167 @@ "0 0x41 0x105e4fed395e64ca013ac1ce020ef69b9990a577fe4b74648faafb69e499f76dd53d5c64aa866924361dd3aadde9b7184bbcb4f79520396c9ed17c4d8489a59701", "1 0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 1 CHECKMULTISIG", "", - "EVAL_FALSE", - "CHECKMULTISIG Schnorr w/ neither STRICTENC,SCHNORR" -], -[ - "0 0x47 0x304402204d0106d6babcaca95277692eaa566bdc89d9f44b1106c18423345c7e9ac40d79022033a3750421038d15f15101ffdca1147a0eb980bb1b809280cb5368c50c10c42c01", - "1 0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 1 CHECKMULTISIG", - "", - "OK", - "CHECKMULTISIG ECDSA w/ neither STRICTENC,SCHNORR" -], -[ - "0 0x41 0x105e4fed395e64ca013ac1ce020ef69b9990a577fe4b74648faafb69e499f76dd53d5c64aa866924361dd3aadde9b7184bbcb4f79520396c9ed17c4d8489a59701", - "1 0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 1 CHECKMULTISIG", - "SCHNORR", "SIG_BADLENGTH", - "CHECKMULTISIG Schnorr w/ SCHNORR" -], -[ - "0 0x47 0x304402204d0106d6babcaca95277692eaa566bdc89d9f44b1106c18423345c7e9ac40d79022033a3750421038d15f15101ffdca1147a0eb980bb1b809280cb5368c50c10c42c01", - "1 0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 1 CHECKMULTISIG", - "SCHNORR", - "OK", - "CHECKMULTISIG ECDSA w/ SCHNORR" + "CHECKMULTISIG Schnorr w/ no STRICTENC" ], [ "0 0x41 0x105e4fed395e64ca013ac1ce020ef69b9990a577fe4b74648faafb69e499f76dd53d5c64aa866924361dd3aadde9b7184bbcb4f79520396c9ed17c4d8489a59701", "1 0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 1 CHECKMULTISIG", "STRICTENC", - "SIG_DER", - "CHECKMULTISIG Schnorr w/ STRICTENC" -], -[ - "0 0x47 0x304402204d0106d6babcaca95277692eaa566bdc89d9f44b1106c18423345c7e9ac40d79022033a3750421038d15f15101ffdca1147a0eb980bb1b809280cb5368c50c10c42c01", - "1 0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 1 CHECKMULTISIG", - "STRICTENC", - "OK", - "CHECKMULTISIG ECDSA w/ STRICTENC" -], -[ - "0 0x41 0x105e4fed395e64ca013ac1ce020ef69b9990a577fe4b74648faafb69e499f76dd53d5c64aa866924361dd3aadde9b7184bbcb4f79520396c9ed17c4d8489a59701", - "1 0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 1 CHECKMULTISIG", - "SCHNORR,STRICTENC", "SIG_BADLENGTH", - "CHECKMULTISIG Schnorr w/ STRICTENC,SCHNORR" -], -[ - "0 0x47 0x304402204d0106d6babcaca95277692eaa566bdc89d9f44b1106c18423345c7e9ac40d79022033a3750421038d15f15101ffdca1147a0eb980bb1b809280cb5368c50c10c42c01", - "1 0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 1 CHECKMULTISIG", - "SCHNORR,STRICTENC", - "OK", - "CHECKMULTISIG ECDSA w/ STRICTENC,SCHNORR" + "CHECKMULTISIG Schnorr w/ STRICTENC" ], [ "0 0x41 0x833682d4f60cc916a22a2c263e658fa662c49badb1e2a8c6208987bf99b1abd740498371480069e7a7a6e7471bf78c27bd9a1fd04fb212a92017346250ac187b01 0x41 0xea4a8d20562a950f4695dc24804565482e9fa111704886179d0c348f2b8a15fe691a305cd599c59c131677146661d5b98cb935330989a85f33afc70d0a21add101 0x41 0xce9011d76a4df05d6280b2382b4d91490dbec7c3e72dc826be1fc9b4718f627955190745cac96521ea46d6d324c7376461e225310e6cd605b9f266d170769b7901", "3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG", "", - "EVAL_FALSE", - "Schnorr 3-of-3 without SCHNORR flag" -], -[ - "0 0x41 0x833682d4f60cc916a22a2c263e658fa662c49badb1e2a8c6208987bf99b1abd740498371480069e7a7a6e7471bf78c27bd9a1fd04fb212a92017346250ac187b01 0x41 0xea4a8d20562a950f4695dc24804565482e9fa111704886179d0c348f2b8a15fe691a305cd599c59c131677146661d5b98cb935330989a85f33afc70d0a21add101 0x41 0xce9011d76a4df05d6280b2382b4d91490dbec7c3e72dc826be1fc9b4718f627955190745cac96521ea46d6d324c7376461e225310e6cd605b9f266d170769b7901", - "3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG", - "SCHNORR", "SIG_BADLENGTH", - "Schnorr 3-of-3 with SCHNORR flag" + "Schnorr 3-of-3" ], [ "0 0x47 0x304402204d69d5caa4dbab259f79fce89d3b459bbd91697c1c052a1554ff3b08b2241cbd0220330a8e17a90d51996e363cb8902fce6278c6350fa59ae12832db2f6a44d64dce01 0x47 0x3044022031a1e5289b0d9c33ec182a7f67210b9997187c710f7d3f0f28bdfb618c4e025c02205d95fe63ee83a20ec44159a06f7c0b43b61d5f0c346ca4a2cc7b91878ad1a85001 0x41 0xce9011d76a4df05d6280b2382b4d91490dbec7c3e72dc826be1fc9b4718f627955190745cac96521ea46d6d324c7376461e225310e6cd605b9f266d170769b7901", "3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG", - "SCHNORR", + "", "SIG_BADLENGTH", - "Schnorr-ECDSA-mixed 3-of-3 with SCHNORR flag" + "Schnorr-ECDSA-mixed 3-of-3" ], [ "0 0x41 0x17fa4dd3e62694cc7816d32b73d5646ea768072aea4926a09e159e5f57be8fd6523800b259fe2a12e27aa29a3719f19e9e4b99d7f8e465a6f19454f914ccb3ec01", "1 0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 1 CHECKMULTISIGVERIFY 1", "", - "CHECKMULTISIGVERIFY", - "CHECKMULTISIGVERIFY Schnorr w/ neither STRICTENC,SCHNORR" -], -[ - "0 0x47 0x3044022050635b0b57b07eec8ebba4f5cad9ede25ada7ca1645367dcce8d4412290f00e4022037cf466f1498830d5476cd52e84ce4fd6dc4c7d70f985a6e9ff68a034faa5ea101", - "1 0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 1 CHECKMULTISIGVERIFY 1", - "", - "OK", - "CHECKMULTISIGVERIFY ECDSA w/ neither STRICTENC,SCHNORR" -], -[ - "0 0x41 0x17fa4dd3e62694cc7816d32b73d5646ea768072aea4926a09e159e5f57be8fd6523800b259fe2a12e27aa29a3719f19e9e4b99d7f8e465a6f19454f914ccb3ec01", - "1 0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 1 CHECKMULTISIGVERIFY 1", - "SCHNORR", "SIG_BADLENGTH", - "CHECKMULTISIGVERIFY Schnorr w/ SCHNORR" -], -[ - "0 0x47 0x3044022050635b0b57b07eec8ebba4f5cad9ede25ada7ca1645367dcce8d4412290f00e4022037cf466f1498830d5476cd52e84ce4fd6dc4c7d70f985a6e9ff68a034faa5ea101", - "1 0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 1 CHECKMULTISIGVERIFY 1", - "SCHNORR", - "OK", - "CHECKMULTISIGVERIFY ECDSA w/ SCHNORR" + "CHECKMULTISIGVERIFY Schnorr w/ no STRICTENC" ], [ "0 0x41 0x17fa4dd3e62694cc7816d32b73d5646ea768072aea4926a09e159e5f57be8fd6523800b259fe2a12e27aa29a3719f19e9e4b99d7f8e465a6f19454f914ccb3ec01", "1 0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 1 CHECKMULTISIGVERIFY 1", "STRICTENC", - "SIG_DER", - "CHECKMULTISIGVERIFY Schnorr w/ STRICTENC" -], -[ - "0 0x47 0x3044022050635b0b57b07eec8ebba4f5cad9ede25ada7ca1645367dcce8d4412290f00e4022037cf466f1498830d5476cd52e84ce4fd6dc4c7d70f985a6e9ff68a034faa5ea101", - "1 0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 1 CHECKMULTISIGVERIFY 1", - "STRICTENC", - "OK", - "CHECKMULTISIGVERIFY ECDSA w/ STRICTENC" -], -[ - "0 0x41 0x17fa4dd3e62694cc7816d32b73d5646ea768072aea4926a09e159e5f57be8fd6523800b259fe2a12e27aa29a3719f19e9e4b99d7f8e465a6f19454f914ccb3ec01", - "1 0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 1 CHECKMULTISIGVERIFY 1", - "SCHNORR,STRICTENC", "SIG_BADLENGTH", - "CHECKMULTISIGVERIFY Schnorr w/ STRICTENC,SCHNORR" -], -[ - "0 0x47 0x3044022050635b0b57b07eec8ebba4f5cad9ede25ada7ca1645367dcce8d4412290f00e4022037cf466f1498830d5476cd52e84ce4fd6dc4c7d70f985a6e9ff68a034faa5ea101", - "1 0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 1 CHECKMULTISIGVERIFY 1", - "SCHNORR,STRICTENC", - "OK", - "CHECKMULTISIGVERIFY ECDSA w/ STRICTENC,SCHNORR" + "CHECKMULTISIGVERIFY Schnorr w/ STRICTENC" ], [ "0x41 0x6f1b69791cd7284b5510daef44cd5acd5c1f3d61f6a79705e18f106b46122f1ed8c5965f3c92c90943f9b51f57207e9e5b7fc462571281e2c92377e4ef20ab2b01", "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG NOT", - "SCHNORR", + "", "OK", "Schnorr P2PK, bad sig" ], [ "0x41 0x6f1b69791cd7284b5510daef44cd5acd5c1f3d61f6a79705e18f106b46122f1ed8c5965f3c92c90943f9b51f57207e9e5b7fc462571281e2c92377e4ef20ab2b01", "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG NOT", - "SCHNORR,STRICTENC", + "STRICTENC", "OK", "Schnorr P2PK, bad sig STRICTENC" ], [ "0x41 0x6f1b69791cd7284b5510daef44cd5acd5c1f3d61f6a79705e18f106b46122f1ed8c5965f3c92c90943f9b51f57207e9e5b7fc462571281e2c92377e4ef20ab2b01", "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG NOT", - "NULLFAIL,SCHNORR", + "NULLFAIL", "NULLFAIL", "Schnorr P2PK, bad sig NULLFAIL" ], [ "0x41 0x4463c103b21e76713571365c4c09224c2a1b343b3cf02e3b56f4f0890a6e7ff96d0bfa2ffa22f8067db3414cc1789abfc48638cb4bc7463907042975f4c84ece01 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508", "DUP HASH160 0x14 0x1018853670f9f3b0582c5b9ee8ce93764ac32b93 EQUALVERIFY CHECKSIG", - "SCHNORR", + "", "OK", "Schnorr P2PKH" ], [ "0x41 0xd78d543b601bc93b394b5c669933d16d860dc7480383efcaae9521d6ceb4065ba17c02a6d9289efef762fa7a0482eff9c5bce4dd95f8bea421ee70bdd8d5488d01", "0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 CHECKSIG", - "SCHNORR,STRICTENC", + "STRICTENC", "OK", "Schnorr P2PK with compressed pubkey" ], [ "0x41 0x0df4be7f5fe74b2855b92082720e889038e15d8d747334fa3f300ef4ab1db1eea56aa83d1d60809ff6703791736be87cfb6cbc5c4036aeed3b4ea4e6dab3509001", "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", - "SCHNORR,STRICTENC", + "STRICTENC", "OK", "Schnorr P2PK with uncompressed pubkey" ], [ "0x41 0x0df4be7f5fe74b2855b92082720e889038e15d8d747334fa3f300ef4ab1db1eea56aa83d1d60809ff6703791736be87cfb6cbc5c4036aeed3b4ea4e6dab3509001", "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", - "COMPRESSED_PUBKEYTYPE,SCHNORR,STRICTENC", + "COMPRESSED_PUBKEYTYPE,STRICTENC", "NONCOMPRESSED_PUBKEY", "Schnorr P2PK with uncompressed pubkey but COMPRESSED_PUBKEYTYPE set" ], [ "0x41 0xd211631fdebf4c8376b3d169ef65a1987460eda43c3312e561b0226fa3069f68a68bac0dbf780f77dd60ff602c66186f1da2bb0a31f10187796242f48295ddbe01", "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", - "SCHNORR,STRICTENC", + "STRICTENC", "PUBKEYTYPE", "Schnorr P2PK with hybrid pubkey" ], [ "0x41 0xd211631fdebf4c8376b3d169ef65a1987460eda43c3312e561b0226fa3069f68a68bac0dbf780f77dd60ff602c66186f1da2bb0a31f10187796242f48295ddbe01", "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", - "SCHNORR", + "", "OK", "Schnorr P2PK with hybrid pubkey but no STRICTENC" ], [ "0x41 0x078b6b4e7d0689f3a1ef9b5283039c39b7ab3a26c04143017ee7136edbc1ccbcf47173c92c5823b778e4aaba3bf9ef2e988eb54c4cb709dbfa8e62110843c19901", "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG NOT", - "SCHNORR", + "", "OK", "Schnorr P2PK NOT with damaged hybrid pubkey but no STRICTENC" ], [ "0x41 0xa522c6aab80595e0fdaf473c89a32e97978858809949fafd6f851254daae231f45338fe53187f79d8507f08c08f8bd2ee795e6ccaca0a04c4e40c613395a685b05", "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG", - "SCHNORR,STRICTENC", + "STRICTENC", "SIG_HASHTYPE", "Schnorr P2PK with undefined basehashtype and STRICTENC" ], [ "0x41 0x128f02ec5b36057a7f3793c5ffdef9e6cca0ea3200a2f07e5c7189a267daafc4feb2b65a8c7f22b203557fef4c078e98382dc99939666b7c6dbcc62bd25b0bf821 0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8", "DUP HASH160 0x14 0x91b24bf9f5288532960ac687abb035127b1d28a5 EQUALVERIFY CHECKSIG", - "SCHNORR", + "", "OK", "Schnorr P2PKH with invalid sighashtype but no STRICTENC" ], [ "0x41 0x128f02ec5b36057a7f3793c5ffdef9e6cca0ea3200a2f07e5c7189a267daafc4feb2b65a8c7f22b203557fef4c078e98382dc99939666b7c6dbcc62bd25b0bf821 0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8", "DUP HASH160 0x14 0x91b24bf9f5288532960ac687abb035127b1d28a5 EQUALVERIFY CHECKSIG", - "SCHNORR,STRICTENC", + "STRICTENC", "SIG_HASHTYPE", "Schnorr P2PKH with invalid sighashtype and STRICTENC" ], [ "0x41 0x3dae009b3fc84066b644b0508d1cc68fbbdefbb91b049aaa46e8de5c3b4598707d93df80a275022354f8e3e65ca6561c55d2f626c8395d237fb1f2b6b93e83f081", "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG", - "SCHNORR", + "", "OK", "Schnorr P2PK anyonecanpay" ], [ "0x41 0x3dae009b3fc84066b644b0508d1cc68fbbdefbb91b049aaa46e8de5c3b4598707d93df80a275022354f8e3e65ca6561c55d2f626c8395d237fb1f2b6b93e83f001", "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG", - "SCHNORR", + "", "EVAL_FALSE", "Schnorr P2PK anyonecanpay marked with normal hashtype" ], [ "0x41 0xd06f2e8e262a974d330c185acdd2eed99622f2c9cc0980eacf976f37965186dba2564a564e8c6697127d9729e6cedd44060ab7ece5c2f0ded2ad3f9a7308c7ce41", "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG", - "SCHNORR,SIGHASH_FORKID,STRICTENC", + "SIGHASH_FORKID,STRICTENC", "OK", "Schnorr P2PK with forkID" ], [ "0x41 0x3cf1b3f60b74d0821039f7dc7c21abe3119b9d94ae13f5e5258a8269bee9dfc51c84dbb3ba3eff82de61046f6cfef22ea5cf4a46e3776a5fb35d743aea310f6701", "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG", - "SCHNORR,SIGHASH_FORKID,STRICTENC", + "SIGHASH_FORKID,STRICTENC", "MISSING_FORKID", "Schnorr P2PK with non-forkID sig" ], [ "0x41 0x3cf1b3f60b74d0821039f7dc7c21abe3119b9d94ae13f5e5258a8269bee9dfc51c84dbb3ba3eff82de61046f6cfef22ea5cf4a46e3776a5fb35d743aea310f6741", "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG", - "SCHNORR,SIGHASH_FORKID,STRICTENC", + "SIGHASH_FORKID,STRICTENC", "EVAL_FALSE", "Schnorr P2PK with cheater forkID bit" ], diff --git a/src/test/schnorr_tests.cpp b/src/test/schnorr_tests.cpp --- a/src/test/schnorr_tests.cpp +++ b/src/test/schnorr_tests.cpp @@ -105,7 +105,6 @@ uint32_t flags = lcg.next(); const bool hasForkId = (flags & SCRIPT_ENABLE_SIGHASH_FORKID) != 0; - const bool hasSchnorr = (flags & SCRIPT_ENABLE_SCHNORR) != 0; const bool hasStricts = (flags & (SCRIPT_VERIFY_DERSIG | SCRIPT_VERIFY_LOW_S | SCRIPT_VERIFY_STRICTENC)) != 0; @@ -119,16 +118,7 @@ // Test CHECKSIG & CHECKDATASIG with he non-DER sig, which can fail from // encoding, otherwise upon verification. - if (hasStricts && !hasSchnorr) { - CheckError(flags, {Zero64_with_hashtype, pubkeyC}, scriptCHECKSIG, - SCRIPT_ERR_SIG_DER); - CheckError(flags, {Zero64_with_hashtype, pubkeyC}, - scriptCHECKSIGVERIFY, SCRIPT_ERR_SIG_DER); - CheckError(flags, {Zero64, {}, pubkeyC}, scriptCHECKDATASIG, - SCRIPT_ERR_SIG_DER); - CheckError(flags, {Zero64, {}, pubkeyC}, scriptCHECKDATASIGVERIFY, - SCRIPT_ERR_SIG_DER); - } else if (hasNullFail) { + if (hasNullFail) { CheckError(flags, {Zero64_with_hashtype, pubkeyC}, scriptCHECKSIG, SCRIPT_ERR_SIG_NULLFAIL); CheckError(flags, {Zero64_with_hashtype, pubkeyC}, @@ -169,52 +159,15 @@ } // test OP_CHECKMULTISIG/VERIFY - if (hasSchnorr) { - // When Schnorr flag is on, we always fail with BADLENGTH no matter - // what. - CheckError(flags, {{}, Zero64_with_hashtype, {1}, pubkeyC, {1}}, - scriptCHECKMULTISIG, SCRIPT_ERR_SIG_BADLENGTH); - CheckError(flags, {{}, Zero64_with_hashtype, {1}, pubkeyC, {1}}, - scriptCHECKMULTISIGVERIFY, SCRIPT_ERR_SIG_BADLENGTH); - CheckError(flags, {{}, DER64_with_hashtype, {1}, pubkeyC, {1}}, - scriptCHECKMULTISIG, SCRIPT_ERR_SIG_BADLENGTH); - CheckError(flags, {{}, DER64_with_hashtype, {1}, pubkeyC, {1}}, - scriptCHECKMULTISIGVERIFY, SCRIPT_ERR_SIG_BADLENGTH); - } else { - // Otherwise, the failure depends on signature content. - // The non-DER sig can fail from encoding, otherwise upon - // verification. - if (hasStricts) { - CheckError(flags, {{}, Zero64_with_hashtype, {1}, pubkeyC, {1}}, - scriptCHECKMULTISIG, SCRIPT_ERR_SIG_DER); - CheckError(flags, {{}, Zero64_with_hashtype, {1}, pubkeyC, {1}}, - scriptCHECKMULTISIGVERIFY, SCRIPT_ERR_SIG_DER); - } else if (hasNullFail) { - CheckError(flags, {{}, Zero64_with_hashtype, {1}, pubkeyC, {1}}, - scriptCHECKMULTISIG, SCRIPT_ERR_SIG_NULLFAIL); - CheckError(flags, {{}, Zero64_with_hashtype, {1}, pubkeyC, {1}}, - scriptCHECKMULTISIGVERIFY, SCRIPT_ERR_SIG_NULLFAIL); - } else { - CheckPass(flags, {{}, Zero64_with_hashtype, {1}, pubkeyC, {1}}, - scriptCHECKMULTISIG, {}); - CheckError(flags, {{}, Zero64_with_hashtype, {1}, pubkeyC, {1}}, - scriptCHECKMULTISIGVERIFY, - SCRIPT_ERR_CHECKMULTISIGVERIFY); - } - // The DER sig fails upon verification. - if (hasNullFail) { - CheckError(flags, {{}, DER64_with_hashtype, {1}, pubkeyC, {1}}, - scriptCHECKMULTISIG, SCRIPT_ERR_SIG_NULLFAIL); - CheckError(flags, {{}, DER64_with_hashtype, {1}, pubkeyC, {1}}, - scriptCHECKMULTISIGVERIFY, SCRIPT_ERR_SIG_NULLFAIL); - } else { - CheckPass(flags, {{}, DER64_with_hashtype, {1}, pubkeyC, {1}}, - scriptCHECKMULTISIG, {}); - CheckError(flags, {{}, DER64_with_hashtype, {1}, pubkeyC, {1}}, - scriptCHECKMULTISIGVERIFY, - SCRIPT_ERR_CHECKMULTISIGVERIFY); - } - } + // We fail with BADLENGTH no matter what. + CheckError(flags, {{}, Zero64_with_hashtype, {1}, pubkeyC, {1}}, + scriptCHECKMULTISIG, SCRIPT_ERR_SIG_BADLENGTH); + CheckError(flags, {{}, Zero64_with_hashtype, {1}, pubkeyC, {1}}, + scriptCHECKMULTISIGVERIFY, SCRIPT_ERR_SIG_BADLENGTH); + CheckError(flags, {{}, DER64_with_hashtype, {1}, pubkeyC, {1}}, + scriptCHECKMULTISIG, SCRIPT_ERR_SIG_BADLENGTH); + CheckError(flags, {{}, DER64_with_hashtype, {1}, pubkeyC, {1}}, + scriptCHECKMULTISIGVERIFY, SCRIPT_ERR_SIG_BADLENGTH); } } diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -1341,554 +1341,146 @@ .Num(0) .ScriptError(SCRIPT_ERR_PUBKEYTYPE)); - // Misc ECDSA tests duplicated with Schnorr flag on - tests.push_back( - TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIG, - "P2PK ECDSA with Schnorr flag on", SCRIPT_ENABLE_SCHNORR) - .PushSigECDSA(keys.key0)); - tests.push_back( - TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIG, - "P2PK, bad sig ECDSA with Schnorr flag on", - SCRIPT_ENABLE_SCHNORR) - .PushSigECDSA(keys.key0) - .DamagePush(10) - .ScriptError(SCRIPT_ERR_EVAL_FALSE)); - - tests.push_back(TestBuilder(CScript() << OP_DUP << OP_HASH160 - << ToByteVector(keys.pubkey1C.GetID()) - << OP_EQUALVERIFY << OP_CHECKSIG, - "P2PKH ECDSA with Schnorr flag on", - SCRIPT_ENABLE_SCHNORR) - .PushSigECDSA(keys.key1) - .Push(keys.pubkey1C)); - - tests.push_back(TestBuilder(CScript() << OP_2 << ToByteVector(keys.pubkey0C) - << ToByteVector(keys.pubkey1C) - << ToByteVector(keys.pubkey2C) << OP_3 - << OP_CHECKMULTISIG, - "P2SH(2-of-3) ECDSA with Schnorr flag on", - SCRIPT_VERIFY_P2SH | SCRIPT_ENABLE_SCHNORR, - true) - .Num(0) - .PushSigECDSA(keys.key1) - .PushSigECDSA(keys.key2) - .PushRedeem()); - - tests.push_back( - TestBuilder(CScript() << ToByteVector(keys.pubkey2C) << OP_CHECKSIG, - "LOW_S violating ECDSA with Schnorr flag on", - SCRIPT_VERIFY_LOW_S | SCRIPT_ENABLE_SCHNORR) - .PushSigECDSA(keys.key2, SigHashType(), 32, 33) - .ScriptError(SCRIPT_ERR_SIG_HIGH_S)); - - tests.push_back( - TestBuilder(CScript() << ToByteVector(keys.pubkey0H) << OP_CHECKSIG, - "STRICTENC-violating hybrid pubkey with Schnorr flag on", - SCRIPT_VERIFY_STRICTENC | SCRIPT_ENABLE_SCHNORR) - .PushSigECDSA(keys.key0, SigHashType()) - .ScriptError(SCRIPT_ERR_PUBKEYTYPE)); - - // Duplicated test OP_CHECKDATASIG with Schnorr flag on - const uint32_t checkdatasigschnorrflags = SCRIPT_VERIFY_STRICTENC | - SCRIPT_VERIFY_NULLFAIL | - SCRIPT_ENABLE_SCHNORR; - - tests.push_back( - TestBuilder(CScript() << ToByteVector(keys.pubkey1C) << OP_CHECKDATASIG, - "Standard CHECKDATASIG", checkdatasigschnorrflags) - .PushDataSigECDSA(keys.key1, {}) - .Num(0)); - tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1C) - << OP_CHECKDATASIG << OP_NOT, - "CHECKDATASIG with NULLFAIL flags", - checkdatasigschnorrflags) - .PushDataSigECDSA(keys.key1, {}) - .Num(1) - .ScriptError(SCRIPT_ERR_SIG_NULLFAIL)); - tests.push_back( - TestBuilder(CScript() << ToByteVector(keys.pubkey1C) << OP_CHECKDATASIG - << OP_NOT, - "CHECKDATASIG without NULLFAIL flags", - checkdatasigschnorrflags & ~SCRIPT_VERIFY_NULLFAIL) - .PushDataSigECDSA(keys.key1, {}) - .Num(1)); - tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1C) - << OP_CHECKDATASIG << OP_NOT, - "CHECKDATASIG empty signature", - checkdatasigschnorrflags) - .Num(0) - .Num(0)); - tests.push_back( - TestBuilder(CScript() << ToByteVector(keys.pubkey1C) << OP_CHECKDATASIG, - "CHECKDATASIG with High S but no Low S", - checkdatasigschnorrflags) - .PushDataSigECDSA(keys.key1, {}, 32, 33) - .Num(0)); - tests.push_back( - TestBuilder(CScript() << ToByteVector(keys.pubkey1C) << OP_CHECKDATASIG, - "CHECKDATASIG with High S", - checkdatasigschnorrflags | SCRIPT_VERIFY_LOW_S) - .PushDataSigECDSA(keys.key1, {}, 32, 33) - .Num(0) - .ScriptError(SCRIPT_ERR_SIG_HIGH_S)); - tests.push_back( - TestBuilder(CScript() << ToByteVector(keys.pubkey1C) << OP_CHECKDATASIG, - "CHECKDATASIG with too little R padding but no DERSIG", - checkdatasigschnorrflags & ~SCRIPT_VERIFY_STRICTENC) - .PushDataSigECDSA(keys.key1, {}, 33, 32) - .EditPush(1, "45022100", "440220") - .Num(0)); - tests.push_back( - TestBuilder(CScript() << ToByteVector(keys.pubkey1C) << OP_CHECKDATASIG, - "CHECKDATASIG with too little R padding", - checkdatasigschnorrflags) - .PushDataSigECDSA(keys.key1, {}, 33, 32) - .EditPush(1, "45022100", "440220") - .Num(0) - .ScriptError(SCRIPT_ERR_SIG_DER)); - tests.push_back( - TestBuilder(CScript() << ToByteVector(keys.pubkey0H) << OP_CHECKDATASIG, - "CHECKDATASIG with hybrid pubkey but no STRICTENC", - checkdatasigschnorrflags & ~SCRIPT_VERIFY_STRICTENC) - .PushDataSigECDSA(keys.key0, {}) - .Num(0)); - tests.push_back( - TestBuilder(CScript() << ToByteVector(keys.pubkey0H) << OP_CHECKDATASIG, - "CHECKDATASIG with hybrid pubkey", checkdatasigschnorrflags) - .PushDataSigECDSA(keys.key0, {}) - .Num(0) - .ScriptError(SCRIPT_ERR_PUBKEYTYPE)); - tests.push_back( - TestBuilder(CScript() << ToByteVector(keys.pubkey0H) << OP_CHECKDATASIG - << OP_NOT, - "CHECKDATASIG with invalid hybrid pubkey but no STRICTENC", - 0) - .PushDataSigECDSA(keys.key0, {}) - .DamagePush(10) - .Num(0)); - tests.push_back( - TestBuilder(CScript() << ToByteVector(keys.pubkey0H) << OP_CHECKDATASIG, - "CHECKDATASIG with invalid hybrid pubkey", - checkdatasigschnorrflags) - .PushDataSigECDSA(keys.key0, {}) - .DamagePush(10) - .Num(0) - .ScriptError(SCRIPT_ERR_PUBKEYTYPE)); - - // Duplicated test OP_CHECKDATASIGVERIFY with Schnorr flag on - tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1C) - << OP_CHECKDATASIGVERIFY << OP_TRUE, - "Standard CHECKDATASIGVERIFY", - checkdatasigschnorrflags) - .PushDataSigECDSA(keys.key1, {}) - .Num(0)); - tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1C) - << OP_CHECKDATASIGVERIFY << OP_TRUE, - "CHECKDATASIGVERIFY with NULLFAIL flags", - checkdatasigschnorrflags) - .PushDataSigECDSA(keys.key1, {}) - .Num(1) - .ScriptError(SCRIPT_ERR_SIG_NULLFAIL)); - tests.push_back( - TestBuilder(CScript() << ToByteVector(keys.pubkey1C) - << OP_CHECKDATASIGVERIFY << OP_TRUE, - "CHECKDATASIGVERIFY without NULLFAIL flags", - checkdatasigschnorrflags & ~SCRIPT_VERIFY_NULLFAIL) - .PushDataSigECDSA(keys.key1, {}) - .Num(1) - .ScriptError(SCRIPT_ERR_CHECKDATASIGVERIFY)); - tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1C) - << OP_CHECKDATASIGVERIFY << OP_TRUE, - "CHECKDATASIGVERIFY empty signature", - checkdatasigschnorrflags) - .Num(0) - .Num(0) - .ScriptError(SCRIPT_ERR_CHECKDATASIGVERIFY)); - tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1C) - << OP_CHECKDATASIGVERIFY << OP_TRUE, - "CHECKDATASIG with High S but no Low S", - checkdatasigschnorrflags) - .PushDataSigECDSA(keys.key1, {}, 32, 33) - .Num(0)); - tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1C) - << OP_CHECKDATASIGVERIFY << OP_TRUE, - "CHECKDATASIG with High S", - checkdatasigschnorrflags | SCRIPT_VERIFY_LOW_S) - .PushDataSigECDSA(keys.key1, {}, 32, 33) - .Num(0) - .ScriptError(SCRIPT_ERR_SIG_HIGH_S)); - tests.push_back( - TestBuilder( - CScript() << ToByteVector(keys.pubkey1C) << OP_CHECKDATASIGVERIFY - << OP_TRUE, - "CHECKDATASIGVERIFY with too little R padding but no DERSIG", - checkdatasigschnorrflags & ~SCRIPT_VERIFY_STRICTENC) - .PushDataSigECDSA(keys.key1, {}, 33, 32) - .EditPush(1, "45022100", "440220") - .Num(0)); - tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1C) - << OP_CHECKDATASIGVERIFY << OP_TRUE, - "CHECKDATASIGVERIFY with too little R padding", - checkdatasigschnorrflags) - .PushDataSigECDSA(keys.key1, {}, 33, 32) - .EditPush(1, "45022100", "440220") - .Num(0) - .ScriptError(SCRIPT_ERR_SIG_DER)); - tests.push_back( - TestBuilder(CScript() << ToByteVector(keys.pubkey0H) - << OP_CHECKDATASIGVERIFY << OP_TRUE, - "CHECKDATASIGVERIFY with hybrid pubkey but no STRICTENC", - checkdatasigschnorrflags & ~SCRIPT_VERIFY_STRICTENC) - .PushDataSigECDSA(keys.key0, {}) - .Num(0)); - tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0H) - << OP_CHECKDATASIGVERIFY << OP_TRUE, - "CHECKDATASIGVERIFY with hybrid pubkey", - checkdatasigschnorrflags) - .PushDataSigECDSA(keys.key0, {}) - .Num(0) - .ScriptError(SCRIPT_ERR_PUBKEYTYPE)); - tests.push_back( - TestBuilder( - CScript() << ToByteVector(keys.pubkey0H) << OP_CHECKDATASIGVERIFY - << OP_TRUE, - "CHECKDATASIGVERIFY with invalid hybrid pubkey but no STRICTENC", 0) - .PushDataSigECDSA(keys.key0, {}) - .DamagePush(10) - .Num(0) - .ScriptError(SCRIPT_ERR_CHECKDATASIGVERIFY)); - tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0H) - << OP_CHECKDATASIGVERIFY << OP_TRUE, - "CHECKDATASIGVERIFY with invalid hybrid pubkey", - checkdatasigschnorrflags) - .PushDataSigECDSA(keys.key0, {}) - .DamagePush(10) - .Num(0) - .ScriptError(SCRIPT_ERR_PUBKEYTYPE)); - // Test all six CHECK*SIG* opcodes with Schnorr signatures. - // - Schnorr/ECDSA signatures with varying flags SCHNORR / STRICTENC. + // - Schnorr varying flags STRICTENC. // - test with different key / mismatching key // CHECKSIG and Schnorr tests.push_back( TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIG, - "CHECKSIG Schnorr w/ neither STRICTENC,SCHNORR", 0) - .PushSigSchnorr(keys.key0) - .ScriptError(SCRIPT_ERR_EVAL_FALSE)); - tests.push_back( - TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIG, - "CHECKSIG ECDSA w/ neither STRICTENC,SCHNORR", 0) - .PushSigECDSA(keys.key0)); - tests.push_back( - TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIG, - "CHECKSIG Schnorr w/ SCHNORR", SCRIPT_ENABLE_SCHNORR) + "CHECKSIG Schnorr", 0) .PushSigSchnorr(keys.key0)); - tests.push_back( - TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIG, - "CHECKSIG ECDSA w/ SCHNORR", SCRIPT_ENABLE_SCHNORR) - .PushSigECDSA(keys.key0)); tests.push_back( TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIG, "CHECKSIG Schnorr w/ STRICTENC", SCRIPT_VERIFY_STRICTENC) - .PushSigSchnorr(keys.key0) - .ScriptError(SCRIPT_ERR_SIG_DER)); - tests.push_back( - TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIG, - "CHECKSIG ECDSA w/ STRICTENC", SCRIPT_VERIFY_STRICTENC) - .PushSigECDSA(keys.key0)); - tests.push_back( - TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIG, - "CHECKSIG Schnorr w/ STRICTENC,SCHNORR", - SCRIPT_ENABLE_SCHNORR | SCRIPT_VERIFY_STRICTENC) .PushSigSchnorr(keys.key0)); - tests.push_back( - TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIG, - "CHECKSIG ECDSA w/ STRICTENC,SCHNORR", - SCRIPT_ENABLE_SCHNORR | SCRIPT_VERIFY_STRICTENC) - .PushSigECDSA(keys.key0)); tests.push_back( TestBuilder(CScript() << ToByteVector(keys.pubkey1) << OP_CHECKSIG, - "CHECKSIG Schnorr other key", - SCRIPT_ENABLE_SCHNORR | SCRIPT_VERIFY_STRICTENC) + "CHECKSIG Schnorr other key", SCRIPT_VERIFY_STRICTENC) .PushSigSchnorr(keys.key1)); tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIG << OP_NOT, "CHECKSIG Schnorr mismatched key", - SCRIPT_ENABLE_SCHNORR | SCRIPT_VERIFY_STRICTENC) + SCRIPT_VERIFY_STRICTENC) .PushSigSchnorr(keys.key1)); // CHECKSIGVERIFY and Schnorr - tests.push_back( - TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIGVERIFY - << OP_1, - "CHECKSIGVERIFY Schnorr w/ neither STRICTENC,SCHNORR", 0) - .PushSigSchnorr(keys.key0) - .ScriptError(SCRIPT_ERR_CHECKSIGVERIFY)); - tests.push_back( - TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIGVERIFY - << OP_1, - "CHECKSIGVERIFY ECDSA w/ neither STRICTENC,SCHNORR", 0) - .PushSigECDSA(keys.key0)); tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIGVERIFY << OP_1, - "CHECKSIGVERIFY Schnorr w/ SCHNORR", - SCRIPT_ENABLE_SCHNORR) + "CHECKSIGVERIFY Schnorr", 0) .PushSigSchnorr(keys.key0)); - tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0) - << OP_CHECKSIGVERIFY << OP_1, - "CHECKSIGVERIFY ECDSA w/ SCHNORR", - SCRIPT_ENABLE_SCHNORR) - .PushSigECDSA(keys.key0)); tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIGVERIFY << OP_1, "CHECKSIGVERIFY Schnorr w/ STRICTENC", SCRIPT_VERIFY_STRICTENC) - .PushSigSchnorr(keys.key0) - .ScriptError(SCRIPT_ERR_SIG_DER)); - tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0) - << OP_CHECKSIGVERIFY << OP_1, - "CHECKSIGVERIFY ECDSA w/ STRICTENC", - SCRIPT_VERIFY_STRICTENC) - .PushSigECDSA(keys.key0)); - tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0) - << OP_CHECKSIGVERIFY << OP_1, - "CHECKSIGVERIFY Schnorr w/ STRICTENC,SCHNORR", - SCRIPT_ENABLE_SCHNORR | SCRIPT_VERIFY_STRICTENC) .PushSigSchnorr(keys.key0)); - tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0) - << OP_CHECKSIGVERIFY << OP_1, - "CHECKSIGVERIFY ECDSA w/ STRICTENC,SCHNORR", - SCRIPT_ENABLE_SCHNORR | SCRIPT_VERIFY_STRICTENC) - .PushSigECDSA(keys.key0)); tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1) << OP_CHECKSIGVERIFY << OP_1, "CHECKSIGVERIFY Schnorr other key", - SCRIPT_ENABLE_SCHNORR | SCRIPT_VERIFY_STRICTENC) + SCRIPT_VERIFY_STRICTENC) .PushSigSchnorr(keys.key1)); tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIGVERIFY << OP_1, "CHECKSIGVERIFY Schnorr mismatched key", - SCRIPT_ENABLE_SCHNORR | SCRIPT_VERIFY_STRICTENC) + SCRIPT_VERIFY_STRICTENC) .PushSigSchnorr(keys.key1) .ScriptError(SCRIPT_ERR_CHECKSIGVERIFY)); // CHECKDATASIG and Schnorr - tests.push_back( - TestBuilder(CScript() << OP_0 << ToByteVector(keys.pubkey0) - << OP_CHECKDATASIG, - "CHECKDATASIG Schnorr w/ neither STRICTENC,SCHNORR", 0) - .PushDataSigSchnorr(keys.key0, {}) - .ScriptError(SCRIPT_ERR_EVAL_FALSE)); - tests.push_back( - TestBuilder(CScript() << OP_0 << ToByteVector(keys.pubkey0) - << OP_CHECKDATASIG, - "CHECKDATASIG ECDSA w/ neither STRICTENC,SCHNORR", 0) - .PushDataSigECDSA(keys.key0, {})); tests.push_back(TestBuilder(CScript() << OP_0 << ToByteVector(keys.pubkey0) << OP_CHECKDATASIG, - "CHECKDATASIG Schnorr w/ SCHNORR", - SCRIPT_ENABLE_SCHNORR) + "CHECKDATASIG Schnorr", 0) .PushDataSigSchnorr(keys.key0, {})); - tests.push_back(TestBuilder(CScript() << OP_0 << ToByteVector(keys.pubkey0) - << OP_CHECKDATASIG, - "CHECKDATASIG ECDSA w/ SCHNORR", - SCRIPT_ENABLE_SCHNORR) - .PushDataSigECDSA(keys.key0, {})); tests.push_back(TestBuilder(CScript() << OP_0 << ToByteVector(keys.pubkey0) << OP_CHECKDATASIG, "CHECKDATASIG Schnorr w/ STRICTENC", SCRIPT_VERIFY_STRICTENC) - .PushDataSigSchnorr(keys.key0, {}) - .ScriptError(SCRIPT_ERR_SIG_DER)); - tests.push_back(TestBuilder(CScript() << OP_0 << ToByteVector(keys.pubkey0) - << OP_CHECKDATASIG, - "CHECKDATASIG ECDSA w/ STRICTENC", - SCRIPT_VERIFY_STRICTENC) - .PushDataSigECDSA(keys.key0, {})); - tests.push_back(TestBuilder(CScript() << OP_0 << ToByteVector(keys.pubkey0) - << OP_CHECKDATASIG, - "CHECKDATASIG Schnorr w/ STRICTENC,SCHNORR", - SCRIPT_ENABLE_SCHNORR | SCRIPT_VERIFY_STRICTENC) .PushDataSigSchnorr(keys.key0, {})); - tests.push_back(TestBuilder(CScript() << OP_0 << ToByteVector(keys.pubkey0) - << OP_CHECKDATASIG, - "CHECKDATASIG ECDSA w/ STRICTENC,SCHNORR", - SCRIPT_ENABLE_SCHNORR | SCRIPT_VERIFY_STRICTENC) - .PushDataSigECDSA(keys.key0, {})); tests.push_back(TestBuilder(CScript() << OP_0 << ToByteVector(keys.pubkey1) << OP_CHECKDATASIG, "CHECKDATASIG Schnorr other key", - SCRIPT_ENABLE_SCHNORR | SCRIPT_VERIFY_STRICTENC) + SCRIPT_VERIFY_STRICTENC) .PushDataSigSchnorr(keys.key1, {})); tests.push_back(TestBuilder(CScript() << OP_0 << ToByteVector(keys.pubkey0) << OP_CHECKDATASIG << OP_NOT, "CHECKDATASIG Schnorr mismatched key", - SCRIPT_ENABLE_SCHNORR | SCRIPT_VERIFY_STRICTENC) + SCRIPT_VERIFY_STRICTENC) .PushDataSigSchnorr(keys.key1, {})); tests.push_back(TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey1) << OP_CHECKDATASIG, "CHECKDATASIG Schnorr other message", - SCRIPT_ENABLE_SCHNORR | SCRIPT_VERIFY_STRICTENC) + SCRIPT_VERIFY_STRICTENC) .PushDataSigSchnorr(keys.key1, {1})); tests.push_back(TestBuilder(CScript() << OP_0 << ToByteVector(keys.pubkey1) << OP_CHECKDATASIG << OP_NOT, "CHECKDATASIG Schnorr wrong message", - SCRIPT_ENABLE_SCHNORR | SCRIPT_VERIFY_STRICTENC) + SCRIPT_VERIFY_STRICTENC) .PushDataSigSchnorr(keys.key1, {1})); // CHECKDATASIGVERIFY and Schnorr - tests.push_back( - TestBuilder(CScript() << OP_0 << ToByteVector(keys.pubkey0) - << OP_CHECKDATASIGVERIFY << OP_1, - "CHECKDATASIGVERIFY Schnorr w/ neither STRICTENC,SCHNORR", - 0) - .PushDataSigSchnorr(keys.key0, {}) - .ScriptError(SCRIPT_ERR_CHECKDATASIGVERIFY)); - tests.push_back( - TestBuilder(CScript() << OP_0 << ToByteVector(keys.pubkey0) - << OP_CHECKDATASIGVERIFY << OP_1, - "CHECKDATASIGVERIFY ECDSA w/ neither STRICTENC,SCHNORR", 0) - .PushDataSigECDSA(keys.key0, {})); tests.push_back(TestBuilder(CScript() << OP_0 << ToByteVector(keys.pubkey0) << OP_CHECKDATASIGVERIFY << OP_1, - "CHECKDATASIGVERIFY Schnorr w/ SCHNORR", - SCRIPT_ENABLE_SCHNORR) + "CHECKDATASIGVERIFY Schnorr", 0) .PushDataSigSchnorr(keys.key0, {})); - tests.push_back(TestBuilder(CScript() << OP_0 << ToByteVector(keys.pubkey0) - << OP_CHECKDATASIGVERIFY << OP_1, - "CHECKDATASIGVERIFY ECDSA w/ SCHNORR", - SCRIPT_ENABLE_SCHNORR) - .PushDataSigECDSA(keys.key0, {})); tests.push_back(TestBuilder(CScript() << OP_0 << ToByteVector(keys.pubkey0) << OP_CHECKDATASIGVERIFY << OP_1, "CHECKDATASIGVERIFY Schnorr w/ STRICTENC", SCRIPT_VERIFY_STRICTENC) - .PushDataSigSchnorr(keys.key0, {}) - .ScriptError(SCRIPT_ERR_SIG_DER)); - tests.push_back(TestBuilder(CScript() << OP_0 << ToByteVector(keys.pubkey0) - << OP_CHECKDATASIGVERIFY << OP_1, - "CHECKDATASIGVERIFY ECDSA w/ STRICTENC", - SCRIPT_VERIFY_STRICTENC) - .PushDataSigECDSA(keys.key0, {})); - tests.push_back( - TestBuilder(CScript() << OP_0 << ToByteVector(keys.pubkey0) - << OP_CHECKDATASIGVERIFY << OP_1, - "CHECKDATASIGVERIFY Schnorr w/ STRICTENC,SCHNORR", - SCRIPT_ENABLE_SCHNORR | SCRIPT_VERIFY_STRICTENC) - .PushDataSigSchnorr(keys.key0, {})); - tests.push_back(TestBuilder(CScript() << OP_0 << ToByteVector(keys.pubkey0) - << OP_CHECKDATASIGVERIFY << OP_1, - "CHECKDATASIGVERIFY ECDSA w/ STRICTENC,SCHNORR", - SCRIPT_ENABLE_SCHNORR | SCRIPT_VERIFY_STRICTENC) - .PushDataSigECDSA(keys.key0, {})); + .PushDataSigSchnorr(keys.key0, {})); tests.push_back(TestBuilder(CScript() << OP_0 << ToByteVector(keys.pubkey1) << OP_CHECKDATASIGVERIFY << OP_1, "CHECKDATASIGVERIFY Schnorr other key", - SCRIPT_ENABLE_SCHNORR | SCRIPT_VERIFY_STRICTENC) + SCRIPT_VERIFY_STRICTENC) .PushDataSigSchnorr(keys.key1, {})); tests.push_back(TestBuilder(CScript() << OP_0 << ToByteVector(keys.pubkey0) << OP_CHECKDATASIGVERIFY << OP_1, "CHECKDATASIGVERIFY Schnorr mismatched key", - SCRIPT_ENABLE_SCHNORR | SCRIPT_VERIFY_STRICTENC) + SCRIPT_VERIFY_STRICTENC) .PushDataSigSchnorr(keys.key1, {}) .ScriptError(SCRIPT_ERR_CHECKDATASIGVERIFY)); tests.push_back(TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey1) << OP_CHECKDATASIGVERIFY << OP_1, "CHECKDATASIGVERIFY Schnorr other message", - SCRIPT_ENABLE_SCHNORR | SCRIPT_VERIFY_STRICTENC) + SCRIPT_VERIFY_STRICTENC) .PushDataSigSchnorr(keys.key1, {1})); tests.push_back(TestBuilder(CScript() << OP_0 << ToByteVector(keys.pubkey1) << OP_CHECKDATASIGVERIFY << OP_1, "CHECKDATASIGVERIFY Schnorr wrong message", - SCRIPT_ENABLE_SCHNORR | SCRIPT_VERIFY_STRICTENC) + SCRIPT_VERIFY_STRICTENC) .PushDataSigSchnorr(keys.key1, {1}) .ScriptError(SCRIPT_ERR_CHECKDATASIGVERIFY)); // CHECKMULTISIG 1-of-1 and Schnorr - tests.push_back( - TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey0) << OP_1 - << OP_CHECKMULTISIG, - "CHECKMULTISIG Schnorr w/ neither STRICTENC,SCHNORR", 0) - .Num(0) - .PushSigSchnorr(keys.key0) - .ScriptError(SCRIPT_ERR_EVAL_FALSE)); - tests.push_back( - TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey0) << OP_1 - << OP_CHECKMULTISIG, - "CHECKMULTISIG ECDSA w/ neither STRICTENC,SCHNORR", 0) - .Num(0) - .PushSigECDSA(keys.key0)); tests.push_back(TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey0) << OP_1 << OP_CHECKMULTISIG, - "CHECKMULTISIG Schnorr w/ SCHNORR", - SCRIPT_ENABLE_SCHNORR) + "CHECKMULTISIG Schnorr w/ no STRICTENC", 0) .Num(0) .PushSigSchnorr(keys.key0) .ScriptError(SCRIPT_ERR_SIG_BADLENGTH)); - tests.push_back(TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey0) - << OP_1 << OP_CHECKMULTISIG, - "CHECKMULTISIG ECDSA w/ SCHNORR", - SCRIPT_ENABLE_SCHNORR) - .Num(0) - .PushSigECDSA(keys.key0)); tests.push_back(TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey0) << OP_1 << OP_CHECKMULTISIG, "CHECKMULTISIG Schnorr w/ STRICTENC", SCRIPT_VERIFY_STRICTENC) .Num(0) .PushSigSchnorr(keys.key0) - .ScriptError(SCRIPT_ERR_SIG_DER)); - tests.push_back(TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey0) - << OP_1 << OP_CHECKMULTISIG, - "CHECKMULTISIG ECDSA w/ STRICTENC", - SCRIPT_VERIFY_STRICTENC) - .Num(0) - .PushSigECDSA(keys.key0)); - tests.push_back(TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey0) - << OP_1 << OP_CHECKMULTISIG, - "CHECKMULTISIG Schnorr w/ STRICTENC,SCHNORR", - SCRIPT_ENABLE_SCHNORR | SCRIPT_VERIFY_STRICTENC) - .Num(0) - .PushSigSchnorr(keys.key0) .ScriptError(SCRIPT_ERR_SIG_BADLENGTH)); - tests.push_back(TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey0) - << OP_1 << OP_CHECKMULTISIG, - "CHECKMULTISIG ECDSA w/ STRICTENC,SCHNORR", - SCRIPT_ENABLE_SCHNORR | SCRIPT_VERIFY_STRICTENC) - .Num(0) - .PushSigECDSA(keys.key0)); // Test multisig with multiple Schnorr signatures tests.push_back(TestBuilder(CScript() << OP_3 << ToByteVector(keys.pubkey0C) << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey2C) << OP_3 << OP_CHECKMULTISIG, - "Schnorr 3-of-3 without SCHNORR flag", 0) - .Num(0) - .PushSigSchnorr(keys.key0) - .PushSigSchnorr(keys.key1) - .PushSigSchnorr(keys.key2) - .ScriptError(SCRIPT_ERR_EVAL_FALSE)); - - tests.push_back(TestBuilder(CScript() << OP_3 << ToByteVector(keys.pubkey0C) - << ToByteVector(keys.pubkey1C) - << ToByteVector(keys.pubkey2C) << OP_3 - << OP_CHECKMULTISIG, - "Schnorr 3-of-3 with SCHNORR flag", - SCRIPT_ENABLE_SCHNORR) + "Schnorr 3-of-3", 0) .Num(0) .PushSigSchnorr(keys.key0) .PushSigSchnorr(keys.key1) .PushSigSchnorr(keys.key2) .ScriptError(SCRIPT_ERR_SIG_BADLENGTH)); - tests.push_back(TestBuilder(CScript() << OP_3 << ToByteVector(keys.pubkey0C) << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey2C) << OP_3 << OP_CHECKMULTISIG, - "Schnorr-ECDSA-mixed 3-of-3 with SCHNORR flag", - SCRIPT_ENABLE_SCHNORR) + "Schnorr-ECDSA-mixed 3-of-3", 0) .Num(0) .PushSigECDSA(keys.key0) .PushSigECDSA(keys.key1) @@ -1899,32 +1491,10 @@ tests.push_back( TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey0) << OP_1 << OP_CHECKMULTISIGVERIFY << OP_1, - "CHECKMULTISIGVERIFY Schnorr w/ neither STRICTENC,SCHNORR", - 0) + "CHECKMULTISIGVERIFY Schnorr w/ no STRICTENC", 0) .Num(0) .PushSigSchnorr(keys.key0) - .ScriptError(SCRIPT_ERR_CHECKMULTISIGVERIFY)); - tests.push_back( - TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey0) << OP_1 - << OP_CHECKMULTISIGVERIFY << OP_1, - "CHECKMULTISIGVERIFY ECDSA w/ neither STRICTENC,SCHNORR", 0) - .Num(0) - .PushSigECDSA(keys.key0)); - tests.push_back(TestBuilder(CScript() - << OP_1 << ToByteVector(keys.pubkey0) - << OP_1 << OP_CHECKMULTISIGVERIFY << OP_1, - "CHECKMULTISIGVERIFY Schnorr w/ SCHNORR", - SCRIPT_ENABLE_SCHNORR) - .Num(0) - .PushSigSchnorr(keys.key0) - .ScriptError(SCRIPT_ERR_SIG_BADLENGTH)); - tests.push_back(TestBuilder(CScript() - << OP_1 << ToByteVector(keys.pubkey0) - << OP_1 << OP_CHECKMULTISIGVERIFY << OP_1, - "CHECKMULTISIGVERIFY ECDSA w/ SCHNORR", - SCRIPT_ENABLE_SCHNORR) - .Num(0) - .PushSigECDSA(keys.key0)); + .ScriptError(SCRIPT_ERR_SIG_BADLENGTH)); tests.push_back(TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey0) << OP_1 << OP_CHECKMULTISIGVERIFY << OP_1, @@ -1932,46 +1502,24 @@ SCRIPT_VERIFY_STRICTENC) .Num(0) .PushSigSchnorr(keys.key0) - .ScriptError(SCRIPT_ERR_SIG_DER)); - tests.push_back(TestBuilder(CScript() - << OP_1 << ToByteVector(keys.pubkey0) - << OP_1 << OP_CHECKMULTISIGVERIFY << OP_1, - "CHECKMULTISIGVERIFY ECDSA w/ STRICTENC", - SCRIPT_VERIFY_STRICTENC) - .Num(0) - .PushSigECDSA(keys.key0)); - tests.push_back( - TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey0) << OP_1 - << OP_CHECKMULTISIGVERIFY << OP_1, - "CHECKMULTISIGVERIFY Schnorr w/ STRICTENC,SCHNORR", - SCRIPT_ENABLE_SCHNORR | SCRIPT_VERIFY_STRICTENC) - .Num(0) - .PushSigSchnorr(keys.key0) - .ScriptError(SCRIPT_ERR_SIG_BADLENGTH)); - tests.push_back( - TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey0) << OP_1 - << OP_CHECKMULTISIGVERIFY << OP_1, - "CHECKMULTISIGVERIFY ECDSA w/ STRICTENC,SCHNORR", - SCRIPT_ENABLE_SCHNORR | SCRIPT_VERIFY_STRICTENC) - .Num(0) - .PushSigECDSA(keys.key0)); + .ScriptError(SCRIPT_ERR_SIG_BADLENGTH)); // Test damaged Schnorr signatures tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIG << OP_NOT, - "Schnorr P2PK, bad sig", SCRIPT_ENABLE_SCHNORR) + "Schnorr P2PK, bad sig", 0) .PushSigSchnorr(keys.key0) .DamagePush(10)); tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIG << OP_NOT, "Schnorr P2PK, bad sig STRICTENC", - SCRIPT_ENABLE_SCHNORR | SCRIPT_VERIFY_STRICTENC) + SCRIPT_VERIFY_STRICTENC) .PushSigSchnorr(keys.key0) .DamagePush(10)); tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIG << OP_NOT, "Schnorr P2PK, bad sig NULLFAIL", - SCRIPT_ENABLE_SCHNORR | SCRIPT_VERIFY_NULLFAIL) + SCRIPT_VERIFY_NULLFAIL) .PushSigSchnorr(keys.key0) .DamagePush(10) .ScriptError(SCRIPT_ERR_SIG_NULLFAIL)); @@ -1980,7 +1528,7 @@ tests.push_back(TestBuilder(CScript() << OP_DUP << OP_HASH160 << ToByteVector(keys.pubkey1C.GetID()) << OP_EQUALVERIFY << OP_CHECKSIG, - "Schnorr P2PKH", SCRIPT_ENABLE_SCHNORR) + "Schnorr P2PKH", 0) .PushSigSchnorr(keys.key1) .Push(keys.pubkey1C)); @@ -1988,45 +1536,42 @@ tests.push_back( TestBuilder(CScript() << ToByteVector(keys.pubkey0C) << OP_CHECKSIG, "Schnorr P2PK with compressed pubkey", - SCRIPT_VERIFY_STRICTENC | SCRIPT_ENABLE_SCHNORR) + SCRIPT_VERIFY_STRICTENC) .PushSigSchnorr(keys.key0, SigHashType())); tests.push_back( TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIG, "Schnorr P2PK with uncompressed pubkey", - SCRIPT_VERIFY_STRICTENC | SCRIPT_ENABLE_SCHNORR) + SCRIPT_VERIFY_STRICTENC) .PushSigSchnorr(keys.key0, SigHashType())); tests.push_back( TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIG, "Schnorr P2PK with uncompressed pubkey but " "COMPRESSED_PUBKEYTYPE set", - SCRIPT_VERIFY_STRICTENC | SCRIPT_ENABLE_SCHNORR | + SCRIPT_VERIFY_STRICTENC | SCRIPT_VERIFY_COMPRESSED_PUBKEYTYPE) .PushSigSchnorr(keys.key0, SigHashType()) .ScriptError(SCRIPT_ERR_NONCOMPRESSED_PUBKEY)); tests.push_back( TestBuilder(CScript() << ToByteVector(keys.pubkey0H) << OP_CHECKSIG, - "Schnorr P2PK with hybrid pubkey", - SCRIPT_VERIFY_STRICTENC | SCRIPT_ENABLE_SCHNORR) + "Schnorr P2PK with hybrid pubkey", SCRIPT_VERIFY_STRICTENC) .PushSigSchnorr(keys.key0, SigHashType()) .ScriptError(SCRIPT_ERR_PUBKEYTYPE)); tests.push_back( TestBuilder(CScript() << ToByteVector(keys.pubkey0H) << OP_CHECKSIG, - "Schnorr P2PK with hybrid pubkey but no STRICTENC", - SCRIPT_ENABLE_SCHNORR) + "Schnorr P2PK with hybrid pubkey but no STRICTENC", 0) .PushSigSchnorr(keys.key0)); tests.push_back( TestBuilder( CScript() << ToByteVector(keys.pubkey0H) << OP_CHECKSIG << OP_NOT, - "Schnorr P2PK NOT with damaged hybrid pubkey but no STRICTENC", - SCRIPT_ENABLE_SCHNORR) + "Schnorr P2PK NOT with damaged hybrid pubkey but no STRICTENC", 0) .PushSigSchnorr(keys.key0) .DamagePush(10)); - // Ensure sighash types still get checked with schnorr + // Ensure sighash types get checked with schnorr tests.push_back( TestBuilder(CScript() << ToByteVector(keys.pubkey1) << OP_CHECKSIG, "Schnorr P2PK with undefined basehashtype and STRICTENC", - SCRIPT_VERIFY_STRICTENC | SCRIPT_ENABLE_SCHNORR) + SCRIPT_VERIFY_STRICTENC) .PushSigSchnorr(keys.key1, SigHashType(5)) .ScriptError(SCRIPT_ERR_SIG_HASHTYPE)); tests.push_back( @@ -2034,7 +1579,7 @@ << ToByteVector(keys.pubkey0.GetID()) << OP_EQUALVERIFY << OP_CHECKSIG, "Schnorr P2PKH with invalid sighashtype but no STRICTENC", - SCRIPT_ENABLE_SCHNORR) + 0) .PushSigSchnorr(keys.key0, SigHashType(0x21), Amount::zero(), 0) .Push(keys.pubkey0)); tests.push_back( @@ -2042,40 +1587,36 @@ << ToByteVector(keys.pubkey0.GetID()) << OP_EQUALVERIFY << OP_CHECKSIG, "Schnorr P2PKH with invalid sighashtype and STRICTENC", - SCRIPT_VERIFY_STRICTENC | SCRIPT_ENABLE_SCHNORR) + SCRIPT_VERIFY_STRICTENC) .PushSigSchnorr(keys.key0, SigHashType(0x21), Amount::zero(), - SCRIPT_VERIFY_STRICTENC | SCRIPT_ENABLE_SCHNORR) + SCRIPT_VERIFY_STRICTENC) .Push(keys.pubkey0) .ScriptError(SCRIPT_ERR_SIG_HASHTYPE)); tests.push_back( TestBuilder(CScript() << ToByteVector(keys.pubkey1) << OP_CHECKSIG, - "Schnorr P2PK anyonecanpay", SCRIPT_ENABLE_SCHNORR) + "Schnorr P2PK anyonecanpay", 0) .PushSigSchnorr(keys.key1, SigHashType().withAnyoneCanPay())); tests.push_back( TestBuilder(CScript() << ToByteVector(keys.pubkey1) << OP_CHECKSIG, - "Schnorr P2PK anyonecanpay marked with normal hashtype", - SCRIPT_ENABLE_SCHNORR) + "Schnorr P2PK anyonecanpay marked with normal hashtype", 0) .PushSigSchnorr(keys.key1, SigHashType().withAnyoneCanPay()) .EditPush(64, "81", "01") .ScriptError(SCRIPT_ERR_EVAL_FALSE)); tests.push_back( TestBuilder(CScript() << ToByteVector(keys.pubkey1) << OP_CHECKSIG, "Schnorr P2PK with forkID", - SCRIPT_ENABLE_SCHNORR | SCRIPT_VERIFY_STRICTENC | - SCRIPT_ENABLE_SIGHASH_FORKID) + SCRIPT_VERIFY_STRICTENC | SCRIPT_ENABLE_SIGHASH_FORKID) .PushSigSchnorr(keys.key1, SigHashType().withForkId())); tests.push_back( TestBuilder(CScript() << ToByteVector(keys.pubkey1) << OP_CHECKSIG, "Schnorr P2PK with non-forkID sig", - SCRIPT_ENABLE_SCHNORR | SCRIPT_VERIFY_STRICTENC | - SCRIPT_ENABLE_SIGHASH_FORKID) + SCRIPT_VERIFY_STRICTENC | SCRIPT_ENABLE_SIGHASH_FORKID) .PushSigSchnorr(keys.key1) .ScriptError(SCRIPT_ERR_MUST_USE_FORKID)); tests.push_back( TestBuilder(CScript() << ToByteVector(keys.pubkey1) << OP_CHECKSIG, "Schnorr P2PK with cheater forkID bit", - SCRIPT_ENABLE_SCHNORR | SCRIPT_VERIFY_STRICTENC | - SCRIPT_ENABLE_SIGHASH_FORKID) + SCRIPT_VERIFY_STRICTENC | SCRIPT_ENABLE_SIGHASH_FORKID) .PushSigSchnorr(keys.key1) .EditPush(64, "01", "41") .ScriptError(SCRIPT_ERR_EVAL_FALSE)); diff --git a/src/test/scriptflags.cpp b/src/test/scriptflags.cpp --- a/src/test/scriptflags.cpp +++ b/src/test/scriptflags.cpp @@ -32,7 +32,6 @@ {"SIGHASH_FORKID", SCRIPT_ENABLE_SIGHASH_FORKID}, {"REPLAY_PROTECTION", SCRIPT_ENABLE_REPLAY_PROTECTION}, {"CHECKDATASIG", SCRIPT_VERIFY_CHECKDATASIG_SIGOPS}, - {"SCHNORR", SCRIPT_ENABLE_SCHNORR}, {"DISALLOW_SEGWIT_RECOVERY", SCRIPT_DISALLOW_SEGWIT_RECOVERY}, }; diff --git a/src/test/sigcache_tests.cpp b/src/test/sigcache_tests.cpp --- a/src/test/sigcache_tests.cpp +++ b/src/test/sigcache_tests.cpp @@ -44,7 +44,7 @@ * script/sigcache.cpp will affect the cache entry. Here we will thus enforce * that certain flags are omitted from that sigcache.cpp list. */ -static const uint32_t TEST_VARIANT_FLAGS = SCRIPT_ENABLE_SCHNORR; +static const uint32_t TEST_VARIANT_FLAGS = 0; /** * Sigcache is only accessible via CachingTransactionSignatureChecker diff --git a/src/test/sigencoding_tests.cpp b/src/test/sigencoding_tests.cpp --- a/src/test/sigencoding_tests.cpp +++ b/src/test/sigencoding_tests.cpp @@ -395,7 +395,6 @@ uint32_t flags = lcg.next(); const bool hasForkId = (flags & SCRIPT_ENABLE_SIGHASH_FORKID) != 0; - const bool hasSchnorr = (flags & SCRIPT_ENABLE_SCHNORR) != 0; const bool hasStricts = (flags & (SCRIPT_VERIFY_DERSIG | SCRIPT_VERIFY_LOW_S | SCRIPT_VERIFY_STRICTENC)) != 0; @@ -408,39 +407,15 @@ BOOST_CHECK(CheckDataSignatureEncoding(DER64, flags, &err)); BOOST_CHECK(CheckTransactionSignatureEncoding(DER65_hb, flags, &err)); - BOOST_CHECK_EQUAL( - !CheckTransactionECDSASignatureEncoding(DER65_hb, flags, &err), - hasSchnorr); - if (hasSchnorr) { - BOOST_CHECK_EQUAL(err, SCRIPT_ERR_SIG_BADLENGTH); - } + BOOST_CHECK( + !CheckTransactionECDSASignatureEncoding(DER65_hb, flags, &err)); + BOOST_CHECK_EQUAL(err, SCRIPT_ERR_SIG_BADLENGTH); - if (hasSchnorr) { - BOOST_CHECK(CheckDataSignatureEncoding(Zero64, flags, &err)); - BOOST_CHECK( - CheckTransactionSignatureEncoding(Zero65_hb, flags, &err)); - BOOST_CHECK(!CheckTransactionECDSASignatureEncoding(Zero65_hb, - flags, &err)); - BOOST_CHECK_EQUAL(err, SCRIPT_ERR_SIG_BADLENGTH); - } else { - BOOST_CHECK_EQUAL(!CheckDataSignatureEncoding(Zero64, flags, &err), - hasStricts); - if (hasStricts) { - BOOST_CHECK_EQUAL(err, SCRIPT_ERR_SIG_DER); - } - BOOST_CHECK_EQUAL( - !CheckTransactionSignatureEncoding(Zero65_hb, flags, &err), - hasStricts); - if (hasStricts) { - BOOST_CHECK_EQUAL(err, SCRIPT_ERR_SIG_DER); - } - BOOST_CHECK_EQUAL( - !CheckTransactionECDSASignatureEncoding(Zero65_hb, flags, &err), - hasStricts); - if (hasStricts) { - BOOST_CHECK_EQUAL(err, SCRIPT_ERR_SIG_DER); - } - } + BOOST_CHECK(CheckDataSignatureEncoding(Zero64, flags, &err)); + BOOST_CHECK(CheckTransactionSignatureEncoding(Zero65_hb, flags, &err)); + BOOST_CHECK( + !CheckTransactionECDSASignatureEncoding(Zero65_hb, flags, &err)); + BOOST_CHECK_EQUAL(err, SCRIPT_ERR_SIG_BADLENGTH); } } diff --git a/src/validation.cpp b/src/validation.cpp --- a/src/validation.cpp +++ b/src/validation.cpp @@ -718,10 +718,6 @@ extraFlags |= SCRIPT_VERIFY_CHECKDATASIG_SIGOPS; } - if (IsGreatWallEnabledForCurrentBlock(config)) { - extraFlags |= SCRIPT_ENABLE_SCHNORR; - } - // Make sure whatever we need to activate is actually activated. const uint32_t scriptVerifyFlags = STANDARD_SCRIPT_VERIFY_FLAGS | extraFlags; @@ -1252,24 +1248,6 @@ } } - // We also, regardless, need to check whether the transaction would - // be valid on the other side of the upgrade, so as to avoid - // splitting the network between upgraded and non-upgraded nodes. - // Note that this will create strange error messages like - // "upgrade-conditional-script-failure (Non-canonical DER ...)" - // -- the tx was refused entry due to STRICTENC, a mandatory flag, - // but after the upgrade the signature would have been interpreted - // as valid Schnorr and thus STRICTENC would not happen. - CScriptCheck check3(scriptPubKey, amount, tx, i, - mandatoryFlags ^ SCRIPT_ENABLE_SCHNORR, - sigCacheStore, txdata); - if (check3()) { - return state.Invalid( - false, REJECT_INVALID, - strprintf("upgrade-conditional-script-failure (%s)", - ScriptErrorString(check.GetScriptError()))); - } - // Failures of other flags indicate a transaction that is invalid in // new blocks, e.g. a invalid P2SH. We DoS ban such nodes as they // are not following the protocol. That said during an upgrade @@ -1611,14 +1589,6 @@ flags |= SCRIPT_VERIFY_CLEANSTACK; } - // If the Great Wall fork is enabled, we start accepting - // 65/64-byte Schnorr signatures in CHECKSIG and CHECKDATASIG respectively, - // and their verify variants. We also stop accepting 65 byte signatures in - // CHECKMULTISIG and its verify variant. - if (IsGreatWallEnabled(config, pChainTip)) { - flags |= SCRIPT_ENABLE_SCHNORR; - } - // We make sure this node will have replay protection during the next hard // fork. if (IsReplayProtectionEnabled(config, pChainTip)) { diff --git a/test/functional/abc-schnorr-activation.py b/test/functional/abc-schnorr-activation.py deleted file mode 100755 --- a/test/functional/abc-schnorr-activation.py +++ /dev/null @@ -1,515 +0,0 @@ -#!/usr/bin/env python3 -# Copyright (c) 2015-2016 The Bitcoin Core developers -# Copyright (c) 2017-2019 The Bitcoin developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. -""" -This tests the activation of Schnorr transaction signatures: -- rejection prior to upgrade both in mempool and blocks. -- acceptance after upgrade both in mempool and blocks. -- check non-banning for peers who send txns that would be valid on the - other side of the upgrade. (e.g., if we are still before upgrade and - peer is post-upgrade) -- optional: tests of valid 64-byte DER signatures (same length as Schnorr). - This requires a temporary patch to bitcoind; see fakeDER64 comment below. -- advance and rewind mempool drop tests. - -Derived from abc-replay-protection.py with improvements borrowed from -abc-segwit-recovery-activation.py. -""" - -from test_framework.blocktools import ( - create_block, - create_coinbase, - create_transaction, - make_conform_to_ctor, -) -from test_framework.comptool import RejectResult, TestInstance, TestManager -from test_framework.key import CECKey -from test_framework.messages import ( - COIN, - COutPoint, - CTransaction, - CTxIn, - CTxOut, - msg_tx, - ToHex, -) -from test_framework.mininode import ( - mininode_lock, - network_thread_start, - P2PInterface, -) -from test_framework import schnorr -from test_framework.script import ( - CScript, - OP_1, - OP_CHECKMULTISIG, - OP_CHECKSIG, - OP_TRUE, - SIGHASH_ALL, - SIGHASH_FORKID, - SignatureHashForkId, -) -from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import assert_equal, assert_raises_rpc_error, sync_blocks - -# far into the future -GREAT_WALL_START_TIME = 2000000000 - -# First blocks (initial coinbases, pre-fork test blocks) happen 1 day before. -FIRST_BLOCK_TIME = GREAT_WALL_START_TIME - 86400 - -# If we don't do this, autoreplay protection will activate simultaneous with -# great_wall and all our sigs will mysteriously fail. -REPLAY_PROTECTION_START_TIME = GREAT_WALL_START_TIME * 2 - - -# A mandatory (bannable) error occurs when people pass Schnorr signatures -# into OP_CHECKMULTISIG. The precise error cause changes before/after upgrade -# (DER / BADLENGTH) so we just match the start of the error. -RPC_SCHNORR_MULTISIG_ERROR = '16: mandatory-script-verify-flag-failed' - -# These non-mandatory (forgiven) errors occur when your signature isn't valid -# now, but would be valid on the other side of the upgrade. -# Error due to passing a Schnorr signature to CHECKSIG before upgrade, but it -# would have been valid after. -EARLY_SCHNORR_ERROR = b'upgrade-conditional-script-failure (Non-canonical DER signature)' -RPC_EARLY_SCHNORR_ERROR = '16: ' + \ - EARLY_SCHNORR_ERROR.decode('utf8') -# Error due to passing a 65-byte ECDSA CHECKSIG to mempool after upgrade, but -# it would have been valid before. -LATE_DER64_CHECKSIG_ERROR = b'upgrade-conditional-script-failure (Signature must be zero for failed CHECK(MULTI)SIG operation)' -RPC_LATE_DER64_CHECKSIG_ERROR = '16: ' + \ - LATE_DER64_CHECKSIG_ERROR.decode('utf8') -# Error due to passing a 65-byte ECDSA CHECKMULTISIG to mempool after upgrade, -# but it would have been valid before. -LATE_DER64_CHECKMULTISIG_ERROR = b'upgrade-conditional-script-failure (Signature cannot be 65 bytes in CHECKMULTISIG)' -RPC_LATE_DER64_CHECKMULTISIG_ERROR = '16: ' + \ - LATE_DER64_CHECKMULTISIG_ERROR.decode('utf8') - - -# For normal test running: -fakeDER64 = b'' - -# To properly test activation, we need to make txes with 64 byte DER sigs. -# (total 65 bytes with the appended hashtype byte, as in CHECKSIG/MULTISIG) -# The easiest way to do this is to fake them, and then temporarily modify -# VerifySignature in src/script/interpreter.cpp to always `return true;` -# for ECDSA sigs, instead of `return pubkey.VerifyECDSA(sighash, vchSig);` -# Once that patch is done, you can uncomment the following and tests should -# pass. -# fakeDER64 = bytes.fromhex('303e021d44444444444444444444444444444444444444444' -# '44444444444444444021d4444444444444444444444444444' -# '444444444444444444444444444444') - -assert len(fakeDER64) in [0, 64] - - -class PreviousSpendableOutput(object): - - def __init__(self, tx=CTransaction(), n=-1): - self.tx = tx - self.n = n - - -class SchnorrActivationTest(BitcoinTestFramework): - - def set_test_params(self): - self.num_nodes = 2 - self.setup_clean_chain = True - self.block_heights = {} - self.tip = None - self.blocks = {} - self.extra_args = [['-whitelist=127.0.0.1', - "-greatwallactivationtime={}".format( - GREAT_WALL_START_TIME), - "-replayprotectionactivationtime={}".format( - REPLAY_PROTECTION_START_TIME)], - ["-greatwallactivationtime={}".format( - GREAT_WALL_START_TIME), - "-replayprotectionactivationtime={}".format( - REPLAY_PROTECTION_START_TIME)]] - - def run_test(self): - for node in self.nodes: - node.setmocktime(GREAT_WALL_START_TIME) - test = TestManager(self, self.options.tmpdir) - test.add_all_connections([self.nodes[0]]) - # We have made a second node for ban-testing, to which we connect - # the mininode (but not test framework). We make multiple connections - # since each disconnect event consumes a connection (and, after we - # run network_thread_start() we can't make any more connections). - for _ in range(3): - self.nodes[1].add_p2p_connection(P2PInterface()) - network_thread_start() - test.run() - - def next_block(self, number, transactions=None, nTime=None): - if self.tip == None: - base_block_hash = self.genesis_hash - block_time = FIRST_BLOCK_TIME - else: - base_block_hash = self.tip.sha256 - block_time = self.tip.nTime + 1 - if nTime: - block_time = nTime - # First create the coinbase - height = self.block_heights[base_block_hash] + 1 - coinbase = create_coinbase(height) - coinbase.rehash() - block = create_block(base_block_hash, coinbase, block_time) - - # add in transactions - if transactions: - block.vtx.extend(transactions) - make_conform_to_ctor(block) - block.hashMerkleRoot = block.calc_merkle_root() - - # Do PoW, which is cheap on regnet - block.solve() - self.tip = block - self.block_heights[block.sha256] = height - assert number not in self.blocks - self.blocks[number] = block - return block - - def get_tests(self): - self.genesis_hash = int(self.nodes[0].getbestblockhash(), 16) - self.block_heights[self.genesis_hash] = 0 - spendable_outputs = [] - - # shorthand - block = self.next_block - node = self.nodes[0] - node_ban = self.nodes[1] - - # save the current tip so its coinbase can be spent by a later block - def save_spendable_output(): - spendable_outputs.append(self.tip) - - # get a coinbase that we previously marked as spendable - def get_spendable_output(): - return PreviousSpendableOutput(spendable_outputs.pop(0).vtx[0], 0) - - # returns a test case that asserts that the current tip was accepted - def accepted(): - return TestInstance([[self.tip, True]]) - - # returns a test case that asserts that the current tip was rejected - def rejected(reject=None): - if reject is None: - return TestInstance([[self.tip, False]]) - else: - return TestInstance([[self.tip, reject]]) - - # move the tip back to a previous block - def tip(number): - self.tip = self.blocks[number] - - # Create a new block - block(0) - save_spendable_output() - yield accepted() - - # Now we need that block to mature so we can spend the coinbase. - test = TestInstance(sync_every_block=False) - for i in range(199): - block(5000 + i) - test.blocks_and_transactions.append([self.tip, True]) - save_spendable_output() - yield test - - # collect spendable outputs now to avoid cluttering the code later on - out = [] - for i in range(100): - out.append(get_spendable_output()) - - # Generate a key pair to test P2SH sigops count - privkeybytes = b"Schnorr!" * 4 - private_key = CECKey() - private_key.set_secretbytes(privkeybytes) - # get uncompressed public key serialization - public_key = private_key.get_pubkey() - - def create_fund_and_spend_tx(spend, multi=False, sig='schnorr'): - if multi: - script = CScript([OP_1, public_key, OP_1, OP_CHECKMULTISIG]) - else: - script = CScript([public_key, OP_CHECKSIG]) - - # Fund transaction - txfund = create_transaction( - spend.tx, spend.n, b'', 50 * COIN, script) - txfund.rehash() - - # Spend transaction - txspend = CTransaction() - txspend.vout.append( - CTxOut(50 * COIN - 1000, CScript([OP_TRUE]))) - txspend.vin.append( - CTxIn(COutPoint(txfund.sha256, 0), b'')) - - # Sign the transaction - sighashtype = SIGHASH_ALL | SIGHASH_FORKID - hashbyte = bytes([sighashtype & 0xff]) - sighash = SignatureHashForkId( - script, txspend, 0, sighashtype, 50 * COIN) - if sig == 'schnorr': - txsig = schnorr.sign(privkeybytes, sighash) + hashbyte - elif sig == 'ecdsa': - txsig = private_key.sign(sighash) + hashbyte - elif isinstance(sig, bytes): - txsig = sig + hashbyte - if multi: - txspend.vin[0].scriptSig = CScript([b'', txsig]) - else: - txspend.vin[0].scriptSig = CScript([txsig]) - txspend.rehash() - - return txfund, txspend - - def send_transaction_to_mempool(tx): - tx_id = node.sendrawtransaction(ToHex(tx)) - assert(tx_id in set(node.getrawmempool())) - return tx_id - - # Check we are not banned when sending a txn that node_ban rejects. - def check_for_no_ban_on_rejected_tx(tx, reject_code, reject_reason): - # Grab the first connection - p2p = node_ban.p2p - assert(p2p.state == 'connected') - - # The P2PConnection stores a public counter for each message type - # and the last receive message of each type. We use this counter to - # identify that we received a new reject message. - with mininode_lock: - rejects_count = p2p.message_count['reject'] - - # Send the transaction directly. We use a ping for synchronization: - # if we have been banned, the pong message won't be received, a - # timeout occurs and the test fails. - p2p.send_message(msg_tx(tx)) - p2p.sync_with_ping() - - # Check we haven't been disconnected - assert(p2p.state == 'connected') - - # Check the reject message matches what we expected - with mininode_lock: - assert(p2p.message_count['reject'] == - rejects_count + 1) - reject_msg = p2p.last_message['reject'] - assert(reject_msg.code == reject_code and - reject_msg.reason == reject_reason and - reject_msg.data == tx.sha256) - - # Check we are disconnected when sending a txn that node_ban rejects. - # (Can't actually get banned, since bitcoind won't ban local peers.) - def check_for_ban_on_rejected_tx(tx): - # Take a connection - p2p = node_ban.p2ps.pop() - assert(p2p.state == 'connected') - - # make sure we can ping - p2p.sync_with_ping() - - # send the naughty transaction - p2p.send_message(msg_tx(tx)) - - # if not "banned", this will timeout and raise exception. - p2p.wait_for_disconnect() - - # Setup fundings - fundings = [] - fund, schnorrchecksigtx = create_fund_and_spend_tx(out[0]) - fundings.append(fund) - fund, schnorrmultisigtx = create_fund_and_spend_tx(out[1], multi=True) - fundings.append(fund) - fund, ecdsachecksigtx = create_fund_and_spend_tx(out[2], sig='ecdsa') - fundings.append(fund) - if fakeDER64: - fund, DER64checksigtx = create_fund_and_spend_tx( - out[5], sig=fakeDER64) - fundings.append(fund) - fund, DER64multisigtx = create_fund_and_spend_tx( - out[6], multi=True, sig=fakeDER64) - fundings.append(fund) - - for fund in fundings: - send_transaction_to_mempool(fund) - block(1, transactions=fundings) - yield accepted() - - # we're now set up for the various spends; make sure the other node - # is set up, too. - sync_blocks(self.nodes) - - # We are before the upgrade, no Schnorrs get in the mempool. - assert_raises_rpc_error(-26, RPC_EARLY_SCHNORR_ERROR, - node.sendrawtransaction, ToHex(schnorrchecksigtx)) - assert_raises_rpc_error(-26, RPC_SCHNORR_MULTISIG_ERROR, - node.sendrawtransaction, ToHex(schnorrmultisigtx)) - - # And blocks containing them are rejected as well. - block(2, transactions=[schnorrchecksigtx]) - yield rejected(RejectResult(16, b'blk-bad-inputs')) - # Rewind bad block - tip(1) - - block(3, transactions=[schnorrmultisigtx]) - yield rejected(RejectResult(16, b'blk-bad-inputs')) - # Rewind bad block - tip(1) - - # So far we were creating blocks well in advance of activation. - # Now, start creating blocks that will move mediantime up to near - # activation. - bfork = block(5555, nTime=GREAT_WALL_START_TIME - 1) - yield accepted() - - sync_blocks(self.nodes) - - # Create 5 more blocks with timestamps from GREAT_WALL_START_TIME+0 to +4 - for i in range(5): - block(5200 + i) - test.blocks_and_transactions.append([self.tip, True]) - yield test - - # Check we are just before the activation time. - assert_equal(node.getblockheader(node.getbestblockhash())['mediantime'], - GREAT_WALL_START_TIME - 1) - - # We are just before the upgrade, still no Schnorrs get in the mempool, - assert_raises_rpc_error(-26, RPC_EARLY_SCHNORR_ERROR, - node.sendrawtransaction, ToHex(schnorrchecksigtx)) - assert_raises_rpc_error(-26, RPC_SCHNORR_MULTISIG_ERROR, - node.sendrawtransaction, ToHex(schnorrmultisigtx)) - # ... nor in blocks. - block(10, transactions=[schnorrchecksigtx]) - yield rejected(RejectResult(16, b'blk-bad-inputs')) - # Rewind bad block - tip(5204) - block(11, transactions=[schnorrmultisigtx]) - yield rejected(RejectResult(16, b'blk-bad-inputs')) - # Rewind bad block - tip(5204) - - # Ensure that sending future-valid schnorr txns is *non-bannable*. - check_for_no_ban_on_rejected_tx( - schnorrchecksigtx, 16, EARLY_SCHNORR_ERROR) - # Ensure that sending schnorrs in multisig *is* bannable. - check_for_ban_on_rejected_tx(schnorrmultisigtx) - - if fakeDER64: - # Throw a couple of "valid" 65-byte ECDSA signatures into the - # mempool just prior to the activation. - faked_checksig_tx_id = send_transaction_to_mempool(DER64checksigtx) - faked_multisig_tx_id = send_transaction_to_mempool(DER64multisigtx) - - # Put a proper ECDSA transaction into the mempool but it won't - # be mined... - ecdsa_tx_id = send_transaction_to_mempool(ecdsachecksigtx) - - # Activate the Schnorr! - forkblock = block(5556) - yield accepted() - - # We have exactly hit the activation time. - assert_equal(node.getblockheader(node.getbestblockhash())['mediantime'], - GREAT_WALL_START_TIME) - - # Make sure ECDSA is still in -- we don't want to lose uninvolved txns - # when the upgrade happens. - assert ecdsa_tx_id in set(node.getrawmempool()) - - if fakeDER64: - # The 64-byte DER sigs must be ejected. - assert faked_checksig_tx_id not in set(node.getrawmempool()) - assert faked_multisig_tx_id not in set(node.getrawmempool()) - - # If we try to re-add them, they fail with non-banning errors. - # In CHECKSIG it's invalid Schnorr and hence NULLFAIL. - assert_raises_rpc_error(-26, RPC_LATE_DER64_CHECKSIG_ERROR, - node.sendrawtransaction, ToHex(DER64checksigtx)) - # In CHECKMULTISIG it's invalid length and hence BAD_LENGTH. - assert_raises_rpc_error(-26, RPC_LATE_DER64_CHECKMULTISIG_ERROR, - node.sendrawtransaction, ToHex(DER64multisigtx)) - # And they can't be mined either... - block(14, transactions=[DER64checksigtx]) - yield rejected(RejectResult(16, b'blk-bad-inputs')) - # Rewind bad block - tip(5556) - block(15, transactions=[DER64multisigtx]) - yield rejected(RejectResult(16, b'blk-bad-inputs')) - # Rewind bad block - tip(5556) - - # Ensure that sending past-valid DER64 txns is *non-bannable*. - check_for_no_ban_on_rejected_tx( - DER64checksigtx, 16, LATE_DER64_CHECKSIG_ERROR) - check_for_no_ban_on_rejected_tx( - DER64multisigtx, 16, LATE_DER64_CHECKMULTISIG_ERROR) - - # The multisig throws a different error now - assert_raises_rpc_error(-26, RPC_SCHNORR_MULTISIG_ERROR, - node.sendrawtransaction, ToHex(schnorrmultisigtx)) - # And it still can't be mined - block(16, transactions=[schnorrmultisigtx]) - yield rejected(RejectResult(16, b'blk-bad-inputs')) - # Rewind bad block - tip(5556) - - # Sending schnorrs in multisig is STILL bannable. - check_for_ban_on_rejected_tx(schnorrmultisigtx) - - # The Schnorr CHECKSIG is now valid - schnorr_tx_id = send_transaction_to_mempool(schnorrchecksigtx) - # It can also be mined - postforkblock = block( - 21, transactions=[schnorrchecksigtx, ecdsachecksigtx]) - yield accepted() - # (we mined the ecdsa tx too) - assert schnorr_tx_id not in set(node.getrawmempool()) - assert ecdsa_tx_id not in set(node.getrawmempool()) - - # Ok, now we check if a rewind works properly across the activation. - # First, rewind the normal post-fork block. - node.invalidateblock(postforkblock.hash) - # txes popped back into mempool - assert schnorr_tx_id in set(node.getrawmempool()) - assert ecdsa_tx_id in set(node.getrawmempool()) - - # Deactivating upgrade. - node.invalidateblock(forkblock.hash) - # This should kick out the Schnorr sig, but not the valid ECDSA sig. - assert schnorr_tx_id not in set(node.getrawmempool()) - assert ecdsa_tx_id in set(node.getrawmempool()) - - # Check that we also do it properly on deeper rewind. - node.reconsiderblock(forkblock.hash) - node.reconsiderblock(postforkblock.hash) - node.invalidateblock(forkblock.hash) - assert schnorr_tx_id not in set(node.getrawmempool()) - assert ecdsa_tx_id in set(node.getrawmempool()) - - # Try an actual reorg (deactivates then activates upgrade in one step) - node.reconsiderblock(forkblock.hash) - node.reconsiderblock(postforkblock.hash) - tip(5204) - test = TestInstance(sync_every_block=False) - for i in range(3): - block(5900 + i) - test.blocks_and_transactions.append([self.tip, True]) - # Perform the reorg - yield test - # reorg finishes after the fork - assert_equal(node.getblockheader(node.getbestblockhash())['mediantime'], - GREAT_WALL_START_TIME+2) - # Schnorr didn't get lost! - assert schnorr_tx_id in set(node.getrawmempool()) - assert ecdsa_tx_id in set(node.getrawmempool()) - - -if __name__ == '__main__': - SchnorrActivationTest().main() diff --git a/test/functional/abc-schnorr.py b/test/functional/abc-schnorr.py new file mode 100755 --- /dev/null +++ b/test/functional/abc-schnorr.py @@ -0,0 +1,317 @@ +#!/usr/bin/env python3 +# Copyright (c) 2015-2016 The Bitcoin Core developers +# Copyright (c) 2017-2019 The Bitcoin developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. +""" +This tests the treatment of Schnorr transaction signatures: +- acceptance both in mempool and blocks. +- check banning for peers who send txns with 64 byte ECDSA DER sigs. + +Derived from abc-replay-protection.py with improvements borrowed from +abc-segwit-recovery-activation.py. Later reduced down to this feature test. +""" + +import time + +from test_framework.blocktools import ( + create_block, + create_coinbase, + create_transaction, + make_conform_to_ctor, +) +from test_framework.comptool import RejectResult, TestInstance, TestManager +from test_framework.key import CECKey +from test_framework.messages import ( + COIN, + COutPoint, + CTransaction, + CTxIn, + CTxOut, + msg_tx, + ToHex, +) +from test_framework.mininode import ( + network_thread_start, + P2PInterface, +) +from test_framework import schnorr +from test_framework.script import ( + CScript, + OP_1, + OP_CHECKMULTISIG, + OP_CHECKSIG, + OP_TRUE, + SIGHASH_ALL, + SIGHASH_FORKID, + SignatureHashForkId, +) +from test_framework.test_framework import BitcoinTestFramework +from test_framework.util import assert_raises_rpc_error, sync_blocks + +TEST_TIME = int(time.time()) + +# A mandatory (bannable) error occurs when people pass Schnorr signatures into OP_CHECKMULTISIG. +RPC_SCHNORR_MULTISIG_ERROR = '16: mandatory-script-verify-flag-failed (Signature cannot be 65 bytes in CHECKMULTISIG)' + +# A mandatory (bannable) error occurs when people send us ECDSA sigs. +RPC_DER64_CHECKSIG_ERROR = '16: mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation)' + +# To properly test exclusion of 64 byte ECDSA, we need "valid" signatures. +# (total 65 bytes with the appended hashtype byte, as in CHECKSIG/MULTISIG) +# The easiest way to do this is to fake them, and then temporarily modify +# VerifySignature in src/script/interpreter.cpp to always `return true;` +# for ECDSA sigs, instead of `return pubkey.VerifyECDSA(sighash, vchSig);` +# Once that patch is done, this test should still pass as-is. +fakeDER64 = bytes.fromhex('303e021d44444444444444444444444444444444444444444' + '44444444444444444021d4444444444444444444444444444' + '444444444444444444444444444444') + +assert len(fakeDER64) == 64 + + +class PreviousSpendableOutput(object): + + def __init__(self, tx=CTransaction(), n=-1): + self.tx = tx + self.n = n + + +class SchnorrTest(BitcoinTestFramework): + + def set_test_params(self): + self.num_nodes = 2 + self.setup_clean_chain = True + self.block_heights = {} + self.tip = None + self.blocks = {} + self.extra_args = [['-whitelist=127.0.0.1'], + []] + + def run_test(self): + for node in self.nodes: + node.setmocktime(TEST_TIME) + test = TestManager(self, self.options.tmpdir) + test.add_all_connections([self.nodes[0]]) + # We have made a second node for ban-testing, to which we connect + # the mininode (but not test framework). We make multiple connections + # since each disconnect event consumes a connection (and, after we + # run network_thread_start() we can't make any more connections). + for _ in range(3): + self.nodes[1].add_p2p_connection(P2PInterface()) + network_thread_start() + test.run() + + def next_block(self, number, transactions=None, nTime=None): + if self.tip == None: + base_block_hash = self.genesis_hash + block_time = TEST_TIME + else: + base_block_hash = self.tip.sha256 + block_time = self.tip.nTime + 1 + if nTime: + block_time = nTime + # First create the coinbase + height = self.block_heights[base_block_hash] + 1 + coinbase = create_coinbase(height) + coinbase.rehash() + block = create_block(base_block_hash, coinbase, block_time) + + # add in transactions + if transactions: + block.vtx.extend(transactions) + make_conform_to_ctor(block) + block.hashMerkleRoot = block.calc_merkle_root() + + # Do PoW, which is cheap on regnet + block.solve() + self.tip = block + self.block_heights[block.sha256] = height + assert number not in self.blocks + self.blocks[number] = block + return block + + def get_tests(self): + self.genesis_hash = int(self.nodes[0].getbestblockhash(), 16) + self.block_heights[self.genesis_hash] = 0 + spendable_outputs = [] + + # shorthand + block = self.next_block + node = self.nodes[0] + node_ban = self.nodes[1] + + # save the current tip so its coinbase can be spent by a later block + def save_spendable_output(): + spendable_outputs.append(self.tip) + + # get a coinbase that we previously marked as spendable + def get_spendable_output(): + return PreviousSpendableOutput(spendable_outputs.pop(0).vtx[0], 0) + + # returns a test case that asserts that the current tip was accepted + def accepted(): + return TestInstance([[self.tip, True]]) + + # returns a test case that asserts that the current tip was rejected + def rejected(reject=None): + if reject is None: + return TestInstance([[self.tip, False]]) + else: + return TestInstance([[self.tip, reject]]) + + # move the tip back to a previous block + def tip(number): + self.tip = self.blocks[number] + + # Create a new block + block(0) + save_spendable_output() + yield accepted() + + # Now we need that block to mature so we can spend the coinbase. + test = TestInstance(sync_every_block=False) + for i in range(199): + block(5000 + i) + test.blocks_and_transactions.append([self.tip, True]) + save_spendable_output() + yield test + + # collect spendable outputs now to avoid cluttering the code later on + out = [] + for i in range(100): + out.append(get_spendable_output()) + + # Generate a key pair to test P2SH sigops count + privkeybytes = b"Schnorr!" * 4 + private_key = CECKey() + private_key.set_secretbytes(privkeybytes) + # get uncompressed public key serialization + public_key = private_key.get_pubkey() + + def create_fund_and_spend_tx(spend, multi=False, sig='schnorr'): + if multi: + script = CScript([OP_1, public_key, OP_1, OP_CHECKMULTISIG]) + else: + script = CScript([public_key, OP_CHECKSIG]) + + # Fund transaction + txfund = create_transaction( + spend.tx, spend.n, b'', 50 * COIN, script) + txfund.rehash() + + # Spend transaction + txspend = CTransaction() + txspend.vout.append( + CTxOut(50 * COIN - 1000, CScript([OP_TRUE]))) + txspend.vin.append( + CTxIn(COutPoint(txfund.sha256, 0), b'')) + + # Sign the transaction + sighashtype = SIGHASH_ALL | SIGHASH_FORKID + hashbyte = bytes([sighashtype & 0xff]) + sighash = SignatureHashForkId( + script, txspend, 0, sighashtype, 50 * COIN) + if sig == 'schnorr': + txsig = schnorr.sign(privkeybytes, sighash) + hashbyte + elif sig == 'ecdsa': + txsig = private_key.sign(sighash) + hashbyte + elif isinstance(sig, bytes): + txsig = sig + hashbyte + if multi: + txspend.vin[0].scriptSig = CScript([b'', txsig]) + else: + txspend.vin[0].scriptSig = CScript([txsig]) + txspend.rehash() + + return txfund, txspend + + def send_transaction_to_mempool(tx): + tx_id = node.sendrawtransaction(ToHex(tx)) + assert(tx_id in set(node.getrawmempool())) + return tx_id + + # Check we are disconnected when sending a txn that node_ban rejects. + # (Can't actually get banned, since bitcoind won't ban local peers.) + def check_for_ban_on_rejected_tx(tx): + # Take a connection + p2p = node_ban.p2ps.pop() + assert(p2p.state == 'connected') + + # make sure we can ping + p2p.sync_with_ping() + + # send the naughty transaction + p2p.send_message(msg_tx(tx)) + + # if not "banned", this will timeout and raise exception. + p2p.wait_for_disconnect() + + # Setup fundings + fundings = [] + fund, schnorrchecksigtx = create_fund_and_spend_tx(out[0]) + fundings.append(fund) + fund, schnorrmultisigtx = create_fund_and_spend_tx(out[1], multi=True) + fundings.append(fund) + fund, ecdsachecksigtx = create_fund_and_spend_tx(out[2], sig='ecdsa') + fundings.append(fund) + + fund, DER64checksigtx = create_fund_and_spend_tx( + out[5], sig=fakeDER64) + fundings.append(fund) + fund, DER64multisigtx = create_fund_and_spend_tx( + out[6], multi=True, sig=fakeDER64) + fundings.append(fund) + + for fund in fundings: + send_transaction_to_mempool(fund) + block(1, transactions=fundings) + yield accepted() + + # we're now set up for the various spends; make sure the other node + # is set up, too. + sync_blocks(self.nodes) + + # Typical ECDSA and Schnorr CHECKSIG are valid + schnorr_tx_id = send_transaction_to_mempool(schnorrchecksigtx) + ecdsa_tx_id = send_transaction_to_mempool(ecdsachecksigtx) + # It can also be mined + block(2, transactions=[schnorrchecksigtx, ecdsachecksigtx]) + yield accepted() + assert schnorr_tx_id not in set(node.getrawmempool()) + assert ecdsa_tx_id not in set(node.getrawmempool()) + + # Schnorr in multisig is rejected with mandatory error. + assert_raises_rpc_error(-26, RPC_SCHNORR_MULTISIG_ERROR, + node.sendrawtransaction, ToHex(schnorrmultisigtx)) + # And it is banworthy. + check_for_ban_on_rejected_tx(schnorrmultisigtx) + # And it can't be mined + block(13, transactions=[schnorrmultisigtx]) + yield rejected(RejectResult(16, b'blk-bad-inputs')) + # Rewind bad block + tip(2) + + # If we try to submit 64-byte DER sigs, they fail with mandatory errors. + # In CHECKSIG it's invalid Schnorr and hence NULLFAIL. + assert_raises_rpc_error(-26, RPC_DER64_CHECKSIG_ERROR, + node.sendrawtransaction, ToHex(DER64checksigtx)) + # In CHECKMULTISIG it's invalid length and hence BAD_LENGTH. + assert_raises_rpc_error(-26, RPC_SCHNORR_MULTISIG_ERROR, + node.sendrawtransaction, ToHex(DER64multisigtx)) + # Getting sent these transactions is banworthy. + check_for_ban_on_rejected_tx(DER64checksigtx) + check_for_ban_on_rejected_tx(DER64multisigtx) + # And they can't be mined either... + block(14, transactions=[DER64checksigtx]) + yield rejected(RejectResult(16, b'blk-bad-inputs')) + # Rewind bad block + tip(2) + block(15, transactions=[DER64multisigtx]) + yield rejected(RejectResult(16, b'blk-bad-inputs')) + # Rewind bad block + tip(2) + + +if __name__ == '__main__': + SchnorrTest().main() diff --git a/test/functional/timing.json b/test/functional/timing.json --- a/test/functional/timing.json +++ b/test/functional/timing.json @@ -52,7 +52,7 @@ "time": 1 }, { - "name": "abc-schnorr-activation.py", + "name": "abc-schnorr.py", "time": 18 }, { @@ -411,4 +411,4 @@ "name": "wallet_zapwallettxes.py", "time": 4 } -] \ No newline at end of file +]