From ae1bec4091396263b83191eb5c20370b56e8535c Mon Sep 17 00:00:00 2001 From: Dao Nguyen Date: Sat, 19 Oct 2024 01:37:30 +0700 Subject: [PATCH 1/8] update --- packages/engine/src/errors.cairo | 2 + packages/engine/src/opcodes/crypto.cairo | 36 ++++--- packages/engine/src/signature/signature.cairo | 97 ++++++++++++------- tests/run-core-tests.sh | 19 +++- tests/run-failing-core-tests.sh | 5 +- tests/run-passing-core-tests.sh | 2 +- tests/script_tests_failing.json | 28 ++---- tests/script_tests_passing.json | 28 ++++-- 8 files changed, 135 insertions(+), 82 deletions(-) diff --git a/packages/engine/src/errors.cairo b/packages/engine/src/errors.cairo index dd697a7..f75634a 100644 --- a/packages/engine/src/errors.cairo +++ b/packages/engine/src/errors.cairo @@ -35,6 +35,8 @@ pub mod Error { pub const SCRIPT_TOO_LARGE: felt252 = 'Script is too large'; pub const SCRIPT_UNFINISHED: felt252 = 'Script unfinished'; pub const SCRIPT_ERR_SIG_DER: felt252 = 'Signature DER error'; + pub const PUBKEYTYPE: felt252 = 'Unsupported public key type'; + pub const SIG_HIGH_S: felt252 = 'Sig not canonical high S value'; } pub fn byte_array_err(err: felt252) -> ByteArray { diff --git a/packages/engine/src/opcodes/crypto.cairo b/packages/engine/src/opcodes/crypto.cairo index 2abd63a..0275d30 100644 --- a/packages/engine/src/opcodes/crypto.cairo +++ b/packages/engine/src/opcodes/crypto.cairo @@ -102,7 +102,7 @@ pub fn opcode_checksig< let res = BaseSigVerifierTrait::new(ref engine, @full_sig_bytes, @pk_bytes); if res.is_err() { let err = res.unwrap_err(); - if err == Error::SCRIPT_ERR_SIG_DER || err == Error::WITNESS_PUBKEYTYPE { + if err == Error::SCRIPT_ERR_SIG_DER || err == Error::PUBKEYTYPE { return Result::Err(err); }; engine.dstack.push_bool(false); @@ -161,6 +161,7 @@ pub fn opcode_checkmultisig< // TODO Error on taproot exec let verify_der = engine.has_flag(ScriptFlags::ScriptVerifyDERSignatures); + let strict_encoding = engine.has_flag(ScriptFlags::ScriptVerifyStrictEncoding); // Get number of public keys and construct array let num_keys = engine.dstack.pop_int()?; let mut num_pub_keys: i64 = ScriptNum::to_int32(num_keys).into(); @@ -210,7 +211,7 @@ pub fn opcode_checkmultisig< if err != 0 { return Result::Err(err); } - + println!("num_sigs: {}", sigs[0].len()); // Historical bug let dummy = engine.dstack.pop_byte_array()?; @@ -220,18 +221,19 @@ pub fn opcode_checkmultisig< let mut script = engine.sub_script(); - let mut s: u32 = 0; - let end = sigs.len(); - while s != end { - script = signature::remove_signature(@script, sigs.at(s)).clone(); - s += 1; - }; + if (engine.is_witness_active(0)) { + let mut s: u32 = 0; + let end = sigs.len(); + while s != end { + script = signature::remove_signature(@script, sigs.at(s)).clone(); + s += 1; + }; + } let mut success = true; num_pub_keys += 1; // Offset due to decrementing it in the loop let mut pub_key_idx: i64 = -1; let mut sig_idx: i64 = 0; - while num_sigs != 0 { pub_key_idx += 1; num_pub_keys -= 1; @@ -245,6 +247,7 @@ pub fn opcode_checkmultisig< if sig.len() == 0 { continue; } + let res = signature::parse_base_sig_and_pk(ref engine, pub_key, sig); if res.is_err() { success = false; @@ -263,10 +266,6 @@ pub fn opcode_checkmultisig< } }; - if err != 0 { - return Result::Err(err); - } - if !success { if engine.has_flag(ScriptFlags::ScriptVerifyNullFail) { let mut err = ''; @@ -279,8 +278,15 @@ pub fn opcode_checkmultisig< if err != '' { return Result::Err(err); } - } else if verify_der { - return Result::Err(Error::SCRIPT_ERR_SIG_DER); + } else if verify_der || strict_encoding { + if err == Error::SCRIPT_ERR_SIG_DER || err == Error::PUBKEYTYPE { + return Result::Err(err); + } + if err == 'invalid sig fmt: S padding' { + return Result::Err(Error::SCRIPT_ERR_SIG_DER); + } + } else if err == Error::SIG_HIGH_S { + return Result::Err(err); } } diff --git a/packages/engine/src/signature/signature.cairo b/packages/engine/src/signature/signature.cairo index 773ecf7..9afdee6 100644 --- a/packages/engine/src/signature/signature.cairo +++ b/packages/engine/src/signature/signature.cairo @@ -10,6 +10,8 @@ use crate::hash_cache::SigHashMidstateTrait; use shinigami_utils::byte_array::u256_from_byte_array_with_offset; use crate::signature::{sighash, constants}; use crate::errors::Error; +use shinigami_utils::byte_array::{sub_byte_array}; + //`BaseSigVerifier` is used to verify ECDSA signatures encoded in DER or BER format (pre-SegWit sig) #[derive(Drop)] @@ -153,8 +155,8 @@ pub fn check_hash_type_encoding< if hash_type > constants::SIG_HASH_ANYONECANPAY { hash_type -= constants::SIG_HASH_ANYONECANPAY; } - if hash_type < constants::SIG_HASH_ALL || hash_type > constants::SIG_HASH_SINGLE { + println!("Invalid hash type: {}", hash_type); return Result::Err('invalid hash type'); } @@ -185,9 +187,15 @@ pub fn check_signature_encoding< T, I, O, IEngineTransactionInputTrait, IEngineTransactionOutputTrait > >( - ref vm: Engine, sig_bytes: @ByteArray, strict_encoding: bool + ref vm: Engine, sig_bytes: @ByteArray ) -> Result<(), felt252> { + // https://github.com/btcsuite/btcd/blob/master/txscript/engine.go#L1221 let low_s = vm.has_flag(ScriptFlags::ScriptVerifyLowS); + let strict_encoding = vm.has_flag(ScriptFlags::ScriptVerifyStrictEncoding); + let verify_der = vm.has_flag(ScriptFlags::ScriptVerifyDERSignatures); + if !low_s && !strict_encoding && !verify_der { + return Result::Ok(()); + } // ASN.1 identifiers for sequence and integer types.* let asn1_sequence_id: u8 = 0x30; @@ -205,24 +213,29 @@ pub fn check_signature_encoding< if sig_bytes_len == 0 { return Result::Err('invalid sig fmt: empty sig'); } + // Calculate the actual length of the signature, excluding the hash type. let sig_len = sig_bytes_len - constants::HASH_TYPE_LEN; // Check if the signature is too short. if sig_len < constants::MIN_SIG_LEN { return Result::Err('invalid sig fmt: too short'); } + // Check if the signature is too long. if sig_len > constants::MAX_SIG_LEN { return Result::Err('invalid sig fmt: too long'); } + // Ensure the signature starts with the correct ASN.1 sequence identifier. if sig_bytes[sequence_offset] != asn1_sequence_id { return Result::Err('invalid sig fmt: wrong type'); } + // Verify that the length field matches the expected length. if sig_bytes[data_len_offset] != (sig_len - data_offset).try_into().unwrap() { return Result::Err('invalid sig fmt: bad length'); } + // Determine the length of the `R` value in the signature. let r_len: usize = sig_bytes[r_len_offset].into(); let s_type_offset = r_offset + r_len; @@ -231,6 +244,7 @@ pub fn check_signature_encoding< if s_type_offset > sig_len { return Result::Err('invalid sig fmt: S type missing'); } + // Check if the `S` length offset exceeds the length of the signature. if s_len_offset > sig_len { return Result::Err('invalid sig fmt: miss S length'); @@ -246,16 +260,14 @@ pub fn check_signature_encoding< if r_len <= 0 || r_len > sig_len - r_offset - 3 { return Result::Err('invalid sig fmt:R length'); } - // If strict encoding is enforced, check for negative or excessively padded `R` values. - if strict_encoding { - if sig_bytes[r_offset] & 0x80 != 0 { - return Result::Err('invalid sig fmt: negative R'); - } + if sig_bytes[r_offset] & 0x80 != 0 { + return Result::Err('invalid sig fmt: negative R'); + } - if r_len > 1 && sig_bytes[r_offset] == 0 && sig_bytes[r_offset + 1] & 0x80 == 0 { - return Result::Err('invalid sig fmt: R padding'); - } + if r_len > 1 && sig_bytes[r_offset] == 0 && sig_bytes[r_offset + 1] & 0x80 == 0 { + return Result::Err('invalid sig fmt: R padding'); } + // Ensure the `S` value is correctly identified as an ASN.1 integer. if sig_bytes[s_type_offset] != asn1_integer_id { return Result::Err('invalid sig fmt:S ASN.1'); @@ -264,16 +276,17 @@ pub fn check_signature_encoding< if s_len <= 0 || s_len > sig_len - s_offset { return Result::Err('invalid sig fmt:S length'); } + // If strict encoding is enforced, check for negative or excessively padded `S` values. if strict_encoding { if sig_bytes[s_offset] & 0x80 != 0 { return Result::Err('invalid sig fmt: negative S'); } - if s_len > 1 && sig_bytes[s_offset] == 0 && sig_bytes[s_offset + 1] & 0x80 == 0 { return Result::Err('invalid sig fmt: S padding'); } } + // If the "low S" rule is enforced, check that the `S` value is below the threshold. if low_s { let s_value = u256_from_byte_array_with_offset(sig_bytes, s_offset, 32); @@ -283,9 +296,8 @@ pub fn check_signature_encoding< let carry = half_order_high_lower; half_order.low = (half_order.low / 2) + (carry * (constants::MAX_U128 / 2 + 1)); half_order.high = half_order_high_upper; - if s_value > half_order { - return Result::Err('sig not canonical high S value'); + return Result::Err(Error::SIG_HIGH_S); } } @@ -341,7 +353,7 @@ pub fn check_pub_key_encoding< } if !is_supported_pub_key_type(pk_bytes) { - return Result::Err('unsupported public key type'); + return Result::Err(Error::PUBKEYTYPE); } return Result::Ok(()); @@ -392,13 +404,17 @@ pub fn parse_pub_key(pk_bytes: @ByteArray) -> Result { // This function extracts the `r` and `s` values from a DER-encoded ECDSA signature (`sig_bytes`). // The function performs various checks to ensure the integrity and validity of the signature. pub fn parse_signature(sig_bytes: @ByteArray) -> Result { - let mut sig_len: usize = sig_bytes.len() - constants::HASH_TYPE_LEN; + let mut sig_len: usize = sig_bytes[1].into(); + if sig_len + 2 > sig_bytes.len() || sig_len + 2 < constants::MIN_SIG_LEN { + return Result::Err('invalid sig fmt: bad length'); + } + let mut start = 0; + let sig_bytes = @sub_byte_array(sig_bytes, ref start, sig_len + 2); let mut r_len: usize = sig_bytes[3].into(); let mut s_len: usize = sig_bytes[r_len + 5].into(); let mut r_offset = 4; let mut s_offset = 6 + r_len; let order: u256 = Secp256Trait::::get_curve_size(); - let mut i = 0; //Strip leading zero @@ -440,9 +456,11 @@ pub fn parse_signature(sig_bytes: @ByteArray) -> Result { if s_sig == 0 { return Result::Err('invalid sig: S is zero'); } - if sig_len != r_len + s_len + 6 { + + if sig_bytes.len() != sig_bytes[3].into() + sig_bytes[sig_bytes[3].into() + 5].into() + 6 { return Result::Err('invalid sig: bad final length'); } + return Result::Ok(Signature { r: r_sig, s: s_sig, y_parity: false, }); } @@ -464,7 +482,9 @@ pub fn parse_base_sig_and_pk< ref vm: Engine, pk_bytes: @ByteArray, sig_bytes: @ByteArray ) -> Result<(Secp256k1Point, Signature, u32), felt252> { let verify_der = vm.has_flag(ScriptFlags::ScriptVerifyDERSignatures); - let strict_encoding = vm.has_flag(ScriptFlags::ScriptVerifyStrictEncoding) || verify_der; + let verify_strict_encoding = vm.has_flag(ScriptFlags::ScriptVerifyStrictEncoding); + let strict_encoding = verify_strict_encoding || verify_der; + if sig_bytes.len() == 0 { return if strict_encoding { Result::Err(Error::SCRIPT_ERR_SIG_DER) @@ -472,18 +492,21 @@ pub fn parse_base_sig_and_pk< Result::Err('empty signature') }; } - // TODO: strct encoding let hash_type_offset: usize = sig_bytes.len() - 1; let hash_type: u32 = sig_bytes[hash_type_offset].into(); - if let Result::Err(e) = check_hash_type_encoding(ref vm, hash_type) { - return if verify_der { - Result::Err(Error::SCRIPT_ERR_SIG_DER) - } else { - Result::Err(e) - }; + + if strict_encoding { + if let Result::Err(e) = check_hash_type_encoding(ref vm, hash_type) { + return if verify_der { + Result::Err(Error::SCRIPT_ERR_SIG_DER) + } else { + Result::Err(e) + }; + } } - if let Result::Err(e) = check_signature_encoding(ref vm, sig_bytes, strict_encoding) { + + if let Result::Err(e) = check_signature_encoding(ref vm, sig_bytes) { return if verify_der { Result::Err(Error::SCRIPT_ERR_SIG_DER) } else { @@ -499,15 +522,11 @@ pub fn parse_base_sig_and_pk< }; } - let pub_key = match parse_pub_key(pk_bytes) { - Result::Ok(key) => key, - Result::Err(e) => if verify_der { - return Result::Err(Error::SCRIPT_ERR_SIG_DER); - } else { - return Result::Err(e); - }, - }; - + let mut start = 0; + if hash_type_offset < 1 { + return Result::Err('invalid hash offset'); + } + let sig_bytes = @sub_byte_array(sig_bytes, ref start, hash_type_offset); let sig = match parse_signature(sig_bytes) { Result::Ok(signature) => signature, Result::Err(e) => if verify_der { @@ -516,6 +535,12 @@ pub fn parse_base_sig_and_pk< return Result::Err(e); }, }; + println!("Parsed sig and pk"); + + let pub_key = match parse_pub_key(pk_bytes) { + Result::Ok(key) => key, + Result::Err(e) => { return Result::Err(e); } + }; Result::Ok((pub_key, sig, hash_type)) } @@ -535,7 +560,6 @@ pub fn remove_signature(script: @ByteArray, sig_bytes: @ByteArray) -> @ByteArray if push_data >= 8 && push_data <= 72 { let mut len: usize = push_data.into(); let mut found: bool = false; - if len == sig_bytes.len() { found = compare_data(script, sig_bytes, i, push_data); } @@ -549,6 +573,7 @@ pub fn remove_signature(script: @ByteArray, sig_bytes: @ByteArray) -> @ByteArray i += 1; continue; } + processed_script.append_byte(push_data); while len != 0 && i - len < script_len { processed_script.append_byte(script[i - len + 1]); diff --git a/tests/run-core-tests.sh b/tests/run-core-tests.sh index 4f233dc..35fdeac 100755 --- a/tests/run-core-tests.sh +++ b/tests/run-core-tests.sh @@ -17,7 +17,7 @@ START=0 if [ -n "$1" ]; then START=$1 fi -END=100 +END=1257 if [ -n "$2" ]; then END=$2 fi @@ -48,6 +48,13 @@ jq -c '.[]' $SCRIPT_TESTS_JSON | { SCRIPT_IDX=$((SCRIPT_IDX+1)) continue fi + + # if start then write initial array bracket + if [ $SCRIPT_IDX -eq $START ]; then + echo "[" >> $FAILED_TESTS_JSON + echo "[" >> $PASSING_TESTS_JSON + fi + has_witness="false" # Otherwise, line encoded like [[wit..., amount]?, scriptSig, scriptPubKey, flags, expected_scripterror, ... comments] @@ -136,7 +143,7 @@ jq -c '.[]' $SCRIPT_TESTS_JSON | { SIG_COUNT="Execution failed: check multisig: num sigs > pk" SIG_PUSHONLY="Execution failed: Engine::new: not pushonly" SIG_PUSHONLY2="Execution failed: Engine::new: p2sh not pushonly" - PUBKEYTYPE="Execution failed: unsupported public key type" + PUBKEYTYPE="Execution failed: Unsupported public key type" INVALID_SIG_FMT="Execution failed: invalid sig fmt: too short" INVALID_HASH_TYPE="Execution failed: invalid hash type" INVALID_LOCKTIME="Execution failed: Unsatisfied locktime" @@ -153,6 +160,7 @@ jq -c '.[]' $SCRIPT_TESTS_JSON | { WITNESS_PROGRAM_EMPTY="Execution failed: Empty witness program" WITNESS_MALLEATED_P2SH="Execution failed: Signature script for p2sh wit" WITNESS_PUBKEYTYPE="Execution failed: Non-compressed key post-segwit" + SIG_HIGH_S="Execution failed: Sig not canonical high S value" if echo "$RESULT" | grep -q "$EVAL_FALSE_RES"; then SCRIPT_RESULT="EVAL_FALSE" elif echo "$RESULT" | grep -q "$EMPTY_STACK_RES"; then @@ -283,9 +291,16 @@ jq -c '.[]' $SCRIPT_TESTS_JSON | { SCRIPT_IDX=$((SCRIPT_IDX+1)) if [ $SCRIPT_IDX -eq $END ]; then + break #TODO: Remove this line fi done + # if end then write final array bracket, remove trailing comma from last element + truncate -s-2 $FAILED_TESTS_JSON + truncate -s-2 $PASSING_TESTS_JSON + echo "]" >> $FAILED_TESTS_JSON + echo "]" >> $PASSING_TESTS_JSON + echo "Script tests complete!" echo "Passed: $PASSED Failed: $FAILED Total: $((PASSED+FAILED))" diff --git a/tests/run-failing-core-tests.sh b/tests/run-failing-core-tests.sh index a3e4430..17c1e88 100755 --- a/tests/run-failing-core-tests.sh +++ b/tests/run-failing-core-tests.sh @@ -128,7 +128,7 @@ jq -c '.[]' $SCRIPT_TESTS_JSON | { SIG_COUNT="Execution failed: check multisig: num sigs > pk" SIG_PUSHONLY="Execution failed: Engine::new: not pushonly" SIG_PUSHONLY2="Execution failed: Engine::new: p2sh not pushonly" - PUBKEYTYPE="Execution failed: unsupported public key type" + PUBKEYTYPE="Execution failed: Unsupported public key type" INVALID_SIG_FMT="Execution failed: invalid sig fmt: too short" INVALID_HASH_TYPE="Execution failed: invalid hash type" INVALID_LOCKTIME="Execution failed: Unsatisfied locktime" @@ -137,6 +137,7 @@ jq -c '.[]' $SCRIPT_TESTS_JSON | { MINIMAL_DATA="Execution failed: Opcode represents non-minimal" INVALID_WITNESS="Execution failed: Invalid witness program" SIG_DER="Execution failed: Signature DER error" + SIG_HIGH_S="Execution failed: Sig not canonical high S value" if echo "$RESULT" | grep -q "$EVAL_FALSE_RES"; then SCRIPT_RESULT="EVAL_FALSE" elif echo "$RESULT" | grep -q "$EMPTY_STACK_RES"; then @@ -205,6 +206,8 @@ jq -c '.[]' $SCRIPT_TESTS_JSON | { SCRIPT_RESULT="MINIMALDATA" elif echo "$RESULT" | grep -q "$SIG_DER"; then SCRIPT_RESULT="SIG_DER" + elif echo "$RESULT" | grep -q "$SIG_HIGH_S"; then + SCRIPT_RESULT="SIG_HIGH_S" else SCRIPT_RESULT="FAIL" fi diff --git a/tests/run-passing-core-tests.sh b/tests/run-passing-core-tests.sh index 870d639..484765a 100755 --- a/tests/run-passing-core-tests.sh +++ b/tests/run-passing-core-tests.sh @@ -135,7 +135,7 @@ jq -c '.[]' $SCRIPT_TESTS_JSON | { SIG_COUNT="Execution failed: check multisig: num sigs > pk" SIG_PUSHONLY="Execution failed: Engine::new: not pushonly" SIG_PUSHONLY2="Execution failed: Engine::new: p2sh not pushonly" - PUBKEYTYPE="Execution failed: unsupported public key type" + PUBKEYTYPE="Execution failed: Unsupported public key type" INVALID_SIG_FMT="Execution failed: invalid sig fmt: too short" INVALID_HASH_TYPE="Execution failed: invalid hash type" INVALID_LOCKTIME="Execution failed: Unsatisfied locktime" diff --git a/tests/script_tests_failing.json b/tests/script_tests_failing.json index 4cd223e..35db1a9 100644 --- a/tests/script_tests_failing.json +++ b/tests/script_tests_failing.json @@ -1,21 +1,15 @@ -["","'dummy' 'sig1' 1 'pk1' 1 CHECKMULTISIG IF 1 ENDIF","","EVAL_FALSE","CHECKMULTISIG must push false to stack when signature is invalid when NOT in strict enc mode"], -["0 0x47 0x30440220cae00b1444babfbf6071b0ba8707f6bd373da3df494d6e74119b0430c5db810502205d5231b8c5939c8ff0c82242656d6e06edb073d42af336c99fe8837c36ea39d501 0","2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG","DERSIG","EVAL_FALSE","BIP66 example 11, with DERSIG"], -["0 0x47 0x30440220b119d67d389315308d1745f734a51ff3ec72e06081e84e236fdf9dc2f5d2a64802204b04e3bc38674c4422ea317231d642b56dc09d214a1ecbbf16ecca01ed996e2201 0","2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG NOT","DERSIG","OK","BIP66 example 12, with DERSIG"], -["0x48 0x304402203e4516da7253cf068effec6b95c41221c0cf3a8e6ccb8cbf1725b562e9afde2c022054e1c258c2981cdfba5df1f46661fb6541c44f77ca0092f3600331abfffb12510101","0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG","","OK","P2PK with multi-byte hashtype, without DERSIG"], +[ +["0x25 0x30220220000000000000000000000000000000000000000000000000000000000000000000","0 CHECKSIG NOT","","OK","Missing S is correctly encoded"], +["0 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501 1","2 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 2 CHECKMULTISIG NOT","STRICTENC","SIG_DER","2-of-2 CHECKMULTISIG NOT with both pubkeys valid, but first signature invalid."], +["0 0x47 0x304402205451ce65ad844dbb978b8bdedf5082e33b43cae8279c30f2c74d9e9ee49a94f802203fe95a7ccf74da7a232ee523ef4a53cb4d14bdd16289680cdb97a63819b8f42f01 0x46 0x304402205451ce65ad844dbb978b8bdedf5082e33b43cae8279c30f2c74d9e9ee49a94f802203fe95a7ccf74da7a232ee523ef4a53cb4d14bdd16289680cdb97a63819b8f42f","2 0x21 0x02a673638cb9587cb68ea08dbef685c6f2d2a751a8b3c6f2a7e9a4999e6e4bfaf5 0x21 0x02a673638cb9587cb68ea08dbef685c6f2d2a751a8b3c6f2a7e9a4999e6e4bfaf5 0x21 0x02a673638cb9587cb68ea08dbef685c6f2d2a751a8b3c6f2a7e9a4999e6e4bfaf5 3 CHECKMULTISIG","P2SH,STRICTENC","SIG_DER","2-of-3 with one valid and one invalid signature due to parse error, nSigs > validSigs"], +["0x27 0x302402107777777777777777777777777777777702108777777777777777777777777777777701","0 CHECKSIG NOT","DERSIG","SIG_DER","Negative S is incorrectly encoded for DERSIG"], +["0x48 0x304502202de8c03fc525285c9c535631019a5f2af7c6454fa9eb392a3756a4917c420edd02210046130bf2baf7cfc065067c8b9e33a066d9c15edcea9feb0ca2d233e3597925b401","0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG","DERSIG","SIG_DER","P2PK with too much S padding"], +["1","0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG","","EVAL_FALSE","BIP66 example 5, without DERSIG"], +["1","0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG NOT","","OK","BIP66 example 6, without DERSIG"], ["0x48 0x304502203e4516da7253cf068effec6b95c41221c0cf3a8e6ccb8cbf1725b562e9afde2c022100ab1e3da73d67e32045a20e0b999e049978ea8d6ee5480d485fcf2ce0d03b2ef001","0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG","LOW_S","SIG_HIGH_S","P2PK with high S"], -["0x47 0x3044022057292e2d4dfe775becdd0a9e6547997c728cdf35390f6a017da56d654d374e4902206b643be2fc53763b4e284845bfea2c597d2dc7759941dce937636c9d341b71ed01","0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG","STRICTENC","PUBKEYTYPE","P2PK with hybrid pubkey"], -["0x47 0x30440220035d554e3153c14950c9993f41c496607a8e24093db0595be7bf875cf64fcf1f02204731c8c4e5daf15e706cec19cdd8f2c5b1d05490e11dab8465ed426569b6e92101","0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG NOT","STRICTENC","PUBKEYTYPE","P2PK NOT with hybrid pubkey"], -["0x47 0x30440220035d554e3153c04950c9993f41c496607a8e24093db0595be7bf875cf64fcf1f02204731c8c4e5daf15e706cec19cdd8f2c5b1d05490e11dab8465ed426569b6e92101","0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG NOT","STRICTENC","PUBKEYTYPE","P2PK NOT with invalid hybrid pubkey"], ["0x47 0x304402206177d513ec2cda444c021a1f4f656fc4c72ba108ae063e157eb86dc3575784940220666fc66702815d0e5413bb9b1df22aed44f5f1efb8b99d41dd5dc9a5be6d205205","0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG","STRICTENC","SIG_HASHTYPE","P2PK with undefined hashtype"], ["0x47 0x304402207409b5b320296e5e2136a7b281a7f803028ca4ca44e2b83eebd46932677725de02202d4eea1c8d3c98e6f42614f54764e6e5e6542e213eb4d079737e9a8b6e9812ec05","0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG NOT","STRICTENC","SIG_HASHTYPE","P2PK NOT with invalid sig and undefined hashtype"], [["304402205ae57ae0534c05ca9981c8a6cdf353b505eaacb7375f96681a2d1a4ba6f02f84022056248e68643b7d8ce7c7d128c9f1f348bcab8be15d094ad5cadd24251a28df8001","0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",0E-8],"","1 0x14 0x91b24bf9f5288532960ac687abb035127b1d28a5","DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM,P2SH,WITNESS","DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM","P2WPKH with future witness version"], -[["3044022064100ca0e2a33332136775a86cd83d0230e58b9aebb889c5ac952abff79a46ef02205f1bf900e022039ad3091bdaf27ac2aef3eae9ed9f190d821d3e508405b9513101","0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",0E-8],"","0 0x1f 0xb34b78da162751647974d5cb7410aa428ad339dbf7d1e16e833f68a0cbf1c3","P2SH,WITNESS","WITNESS_PROGRAM_WRONG_LENGTH","P2WPKH with wrong witness program length"], -["","0 0x20 0xb95237b48faaa69eb078e1170be3b5cbb3fddf16d0a991e14ad274f7b33a4f64","P2SH,WITNESS","WITNESS_PROGRAM_WITNESS_EMPTY","P2WSH with empty witness"], -[["304402204209e49457c2358f80d0256bc24535b8754c14d08840fc4be762d6f5a0aed80b02202eaf7d8fc8d62f60c67adcd99295528d0e491ae93c195cec5a67e7a09532a88001","048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf",0E-8],"11 0x16 0x00147cf9c846cd4882efec4bf07e44ebdad495c94f4b","HASH160 0x14 0x4e0c2aed91315303fc6a1dc4c7bc21c88f75402e EQUAL","P2SH,WITNESS","WITNESS_MALLEATED_P2SH","P2SH(P2WPKH) with superfluous push in scriptSig"], -[["304402200d461c140cfdfcf36b94961db57ae8c18d1cb80e9d95a9e47ac22470c1bf125502201c8dc1cbfef6a3ef90acbbb992ca22fe9466ee6f9d4898eda277a7ac3ab4b25101","410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac",1E-8],"","0 0x20 0xb95237b48faaa69eb078e1170be3b5cbb3fddf16d0a991e14ad274f7b33a4f64","P2SH,WITNESS,WITNESS_PUBKEYTYPE","WITNESS_PUBKEYTYPE","Basic P2WSH"], -[["304402201e7216e5ccb3b61d46946ec6cc7e8c4e0117d13ac2fd4b152197e4805191c74202203e9903e33e84d9ee1dd13fb057afb7ccfb47006c23f6a067185efbc9dd780fc501","0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",1E-8],"","0 0x14 0x91b24bf9f5288532960ac687abb035127b1d28a5","P2SH,WITNESS,WITNESS_PUBKEYTYPE","WITNESS_PUBKEYTYPE","Basic P2WPKH"], -[["3044022066e02c19a513049d49349cf5311a1b012b7c4fae023795a18ab1d91c23496c22022025e216342c8e07ce8ef51e8daee88f84306a9de66236cab230bb63067ded1ad301","410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac",1E-8],"0x22 0x0020b95237b48faaa69eb078e1170be3b5cbb3fddf16d0a991e14ad274f7b33a4f64","HASH160 0x14 0xf386c2ba255cc56d20cfa6ea8b062f8b59945518 EQUAL","P2SH,WITNESS,WITNESS_PUBKEYTYPE","WITNESS_PUBKEYTYPE","Basic P2SH(P2WSH)"], -[["304402200929d11561cd958460371200f82e9cae64c727a495715a31828e27a7ad57b36d0220361732ced04a6f97351ecca21a56d0b8cd4932c1da1f8f569a2b68e5e48aed7801","0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",1E-8],"0x16 0x001491b24bf9f5288532960ac687abb035127b1d28a5","HASH160 0x14 0x17743beb429c55c942d2ec703b98c4d57c2df5c6 EQUAL","P2SH,WITNESS,WITNESS_PUBKEYTYPE","WITNESS_PUBKEYTYPE","Basic P2SH(P2WPKH)"], [["","304402207eb8a59b5c65fc3f6aeef77066556ed5c541948a53a3ba7f7c375b8eed76ee7502201e036a7a9a98ff919ff94dc905d67a1ec006f79ef7cff0708485c8bb79dce38e01","5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae",1E-8],"","0 0x20 0x06c24420938f0fa3c1cb2707d867154220dca365cdbfa0dd2a83854730221460","P2SH,WITNESS,WITNESS_PUBKEYTYPE","OK","P2WSH CHECKMULTISIG with compressed keys"], [["","3044022033706aed33b8155d5486df3b9bca8cdd3bd4bdb5436dce46d72cdaba51d22b4002203626e94fe53a178af46624f17315c6931f20a30b103f5e044e1eda0c3fe185c601","5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae",1E-8],"0x22 0x002006c24420938f0fa3c1cb2707d867154220dca365cdbfa0dd2a83854730221460","HASH160 0x14 0x26282aad7c29369d15fed062a778b6100d31a340 EQUAL","P2SH,WITNESS,WITNESS_PUBKEYTYPE","OK","P2SH(P2WSH) CHECKMULTISIG with compressed keys"], [["","304402204048b7371ab1c544362efb89af0c80154747d665aa4fcfb2edfd2d161e57b42e02207e043748e96637080ffc3acbd4dcc6fee1e58d30f6d1269535f32188e5ddae7301","5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae",1E-8],"","0 0x20 0x06c24420938f0fa3c1cb2707d867154220dca365cdbfa0dd2a83854730221460","P2SH,WITNESS,WITNESS_PUBKEYTYPE","OK","P2WSH CHECKMULTISIG with compressed keys"], @@ -37,8 +31,4 @@ [["","304402206c6d9f5daf85b54af2a93ec38b15ab27f205dbf5c735365ff12451e43613d1f40220736a44be63423ed5ebf53491618b7cc3d8a5093861908da853739c73717938b701","5141048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae",1E-8],"","0 0x20 0x230828ed48871f0f362ce9432aa52f620f442cc8d9ce7a8b5e798365595a38bb","P2SH,WITNESS,WITNESS_PUBKEYTYPE","WITNESS_PUBKEYTYPE","P2WSH CHECKMULTISIG with second key uncompressed and signing with the second key"], [["","30440220687871bc6144012d75baf585bb26ce13997f7d8c626f4d8825b069c3b2d064470220108936fe1c57327764782253e99090b09c203ec400ed35ce9e026ce2ecf842a001","5141048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae",1E-8],"0x22 0x0020230828ed48871f0f362ce9432aa52f620f442cc8d9ce7a8b5e798365595a38bb","HASH160 0x14 0x3478e7019ce61a68148f87549579b704cbe4c393 EQUAL","P2SH,WITNESS,WITNESS_PUBKEYTYPE","WITNESS_PUBKEYTYPE","P2SH(P2WSH) CHECKMULTISIG with second key uncompressed and signing with the second key"], ["0","CHECKSEQUENCEVERIFY","CHECKSEQUENCEVERIFY","UNSATISFIED_LOCKTIME","CSV fails if stack top bit 1 << 31 is set and the tx version < 2"], -["0x050000000001","CHECKSEQUENCEVERIFY","CHECKSEQUENCEVERIFY","UNSATISFIED_LOCKTIME","CSV fails if stack top bit 1 << 31 is not set, and tx version < 2"], -["0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0","0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT","DERSIG","OK","BIP66 and NULLFAIL-compliant"], -["0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0x09 0x300602010102010101","0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT","DERSIG","OK","BIP66-compliant but not NULLFAIL-compliant"], -["0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0x09 0x300602010102010101","0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT","DERSIG,NULLFAIL","NULLFAIL","BIP66-compliant but not NULLFAIL-compliant"], -["0 0x09 0x300602010102010101 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0","0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT","DERSIG","OK","BIP66-compliant but not NULLFAIL-compliant"], +["0x050000000001","CHECKSEQUENCEVERIFY","CHECKSEQUENCEVERIFY","UNSATISFIED_LOCKTIME","CSV fails if stack top bit 1 << 31 is not set, and tx version < 2"]] diff --git a/tests/script_tests_passing.json b/tests/script_tests_passing.json index 59c82ab..3f839c4 100644 --- a/tests/script_tests_passing.json +++ b/tests/script_tests_passing.json @@ -1,3 +1,4 @@ +[ ["","DEPTH 0 EQUAL","P2SH,STRICTENC","OK","Test the test: we should have an empty stack after scriptSig evaluation"], [" ","DEPTH 0 EQUAL","P2SH,STRICTENC","OK","and multiple spaces should not change that."], [" ","DEPTH 0 EQUAL","P2SH,STRICTENC","OK"], @@ -567,7 +568,6 @@ ["0 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501","2 0 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 2 CHECKMULTISIG NOT","STRICTENC","OK","2-of-2 CHECKMULTISIG NOT with the second pubkey invalid, and both signatures validly encoded. Valid pubkey fails, and CHECKMULTISIG exits early, prior to evaluation of second invalid pubkey."], ["0 0 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501","2 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 2 CHECKMULTISIG NOT","STRICTENC","OK","2-of-2 CHECKMULTISIG NOT with both pubkeys valid, but second signature invalid. Valid pubkey fails, and CHECKMULTISIG exits early, prior to evaluation of second invalid signature."], ["0x4a 0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","0 CHECKSIG NOT","","OK","Overly long signature is correctly encoded"], -["0x25 0x30220220000000000000000000000000000000000000000000000000000000000000000000","0 CHECKSIG NOT","","OK","Missing S is correctly encoded"], ["0x27 0x3024021077777777777777777777777777777777020a7777777777777777777777777777777701","0 CHECKSIG NOT","","OK","S with invalid S length is correctly encoded"], ["0x27 0x302403107777777777777777777777777777777702107777777777777777777777777777777701","0 CHECKSIG NOT","","OK","Non-integer R is correctly encoded"], ["0x27 0x302402107777777777777777777777777777777703107777777777777777777777777777777701","0 CHECKSIG NOT","","OK","Non-integer S is correctly encoded"], @@ -879,6 +879,7 @@ ["","1 CHECKMULTISIG NOT","STRICTENC","INVALID_STACK_OPERATION","CHECKMULTISIG must error when there are not enough pubkeys on the stack"], ["","-1 0 CHECKMULTISIG NOT","STRICTENC","SIG_COUNT","CHECKMULTISIG must error when the specified number of signatures is negative"], ["","1 'pk1' 1 CHECKMULTISIG NOT","STRICTENC","INVALID_STACK_OPERATION","CHECKMULTISIG must error when there are not enough signatures on the stack"], +["","'dummy' 'sig1' 1 'pk1' 1 CHECKMULTISIG IF 1 ENDIF","","EVAL_FALSE","CHECKMULTISIG must push false to stack when signature is invalid when NOT in strict enc mode"], ["","0 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG","P2SH,STRICTENC","OP_COUNT","202 CHECKMULTISIGS, fails due to 201 op limit"], ["1","0 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY","P2SH,STRICTENC","INVALID_STACK_OPERATION",""], ["","NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG","P2SH,STRICTENC","OP_COUNT","Fails due to 201 script operation limit"], @@ -966,8 +967,6 @@ ["0 0 0x02 0x0000","CHECKMULTISIGVERIFY 1","MINIMALDATA","UNKNOWN_ERROR"], ["0 0x02 0x0000 0","CHECKMULTISIGVERIFY 1","MINIMALDATA","UNKNOWN_ERROR"], ["0 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501","2 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 0 2 CHECKMULTISIG NOT","STRICTENC","PUBKEYTYPE","2-of-2 CHECKMULTISIG NOT with the first pubkey invalid, and both signatures validly encoded."], -["0 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501 1","2 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 2 CHECKMULTISIG NOT","STRICTENC","SIG_DER","2-of-2 CHECKMULTISIG NOT with both pubkeys valid, but first signature invalid."], -["0 0x47 0x304402205451ce65ad844dbb978b8bdedf5082e33b43cae8279c30f2c74d9e9ee49a94f802203fe95a7ccf74da7a232ee523ef4a53cb4d14bdd16289680cdb97a63819b8f42f01 0x46 0x304402205451ce65ad844dbb978b8bdedf5082e33b43cae8279c30f2c74d9e9ee49a94f802203fe95a7ccf74da7a232ee523ef4a53cb4d14bdd16289680cdb97a63819b8f42f","2 0x21 0x02a673638cb9587cb68ea08dbef685c6f2d2a751a8b3c6f2a7e9a4999e6e4bfaf5 0x21 0x02a673638cb9587cb68ea08dbef685c6f2d2a751a8b3c6f2a7e9a4999e6e4bfaf5 0x21 0x02a673638cb9587cb68ea08dbef685c6f2d2a751a8b3c6f2a7e9a4999e6e4bfaf5 3 CHECKMULTISIG","P2SH,STRICTENC","SIG_DER","2-of-3 with one valid and one invalid signature due to parse error, nSigs > validSigs"], ["0x4a 0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","0 CHECKSIG NOT","DERSIG","SIG_DER","Overly long signature is incorrectly encoded for DERSIG"], ["0x25 0x30220220000000000000000000000000000000000000000000000000000000000000000000","0 CHECKSIG NOT","DERSIG","SIG_DER","Missing S is incorrectly encoded for DERSIG"], ["0x27 0x3024021077777777777777777777777777777777020a7777777777777777777777777777777701","0 CHECKSIG NOT","DERSIG","SIG_DER","S with invalid S length is incorrectly encoded for DERSIG"], @@ -975,7 +974,6 @@ ["0x27 0x302402107777777777777777777777777777777703107777777777777777777777777777777701","0 CHECKSIG NOT","DERSIG","SIG_DER","Non-integer S is incorrectly encoded for DERSIG"], ["0x17 0x3014020002107777777777777777777777777777777701","0 CHECKSIG NOT","DERSIG","SIG_DER","Zero-length R is incorrectly encoded for DERSIG"], ["0x17 0x3014021077777777777777777777777777777777020001","0 CHECKSIG NOT","DERSIG","SIG_DER","Zero-length S is incorrectly encoded for DERSIG"], -["0x27 0x302402107777777777777777777777777777777702108777777777777777777777777777777701","0 CHECKSIG NOT","DERSIG","SIG_DER","Negative S is incorrectly encoded for DERSIG"], [["00",0E-8],"","0 0x206e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d","P2SH,WITNESS","EVAL_FALSE","Invalid witness script"], [["51",0E-8],"","0 0x206e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d","P2SH,WITNESS","WITNESS_PROGRAM_MISMATCH","Witness script hash mismatch"], [["00",0E-8],"","0 0x206e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d","","OK","Invalid witness script without WITNESS"], @@ -1002,7 +1000,6 @@ ["0x47 0x304402200060558477337b9022e70534f1fea71a318caf836812465a2509931c5e7c4987022078ec32bd50ac9e03a349ba953dfd9fe1c8d2dd8bdb1d38ddca844d3d5c78c11801","0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG","","OK","P2PK with too much R padding but no DERSIG"], ["0x47 0x304402200060558477337b9022e70534f1fea71a318caf836812465a2509931c5e7c4987022078ec32bd50ac9e03a349ba953dfd9fe1c8d2dd8bdb1d38ddca844d3d5c78c11801","0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG","DERSIG","SIG_DER","P2PK with too much R padding"], ["0x48 0x304502202de8c03fc525285c9c535631019a5f2af7c6454fa9eb392a3756a4917c420edd02210046130bf2baf7cfc065067c8b9e33a066d9c15edcea9feb0ca2d233e3597925b401","0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG","","OK","P2PK with too much S padding but no DERSIG"], -["0x48 0x304502202de8c03fc525285c9c535631019a5f2af7c6454fa9eb392a3756a4917c420edd02210046130bf2baf7cfc065067c8b9e33a066d9c15edcea9feb0ca2d233e3597925b401","0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG","DERSIG","SIG_DER","P2PK with too much S padding"], ["0x47 0x30440220d7a0417c3f6d1a15094d1cf2a3378ca0503eb8a57630953a9e2987e21ddd0a6502207a6266d686c99090920249991d3d42065b6d43eb70187b219c0db82e4f94d1a201","0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG","","OK","P2PK with too little R padding but no DERSIG"], ["0x47 0x30440220d7a0417c3f6d1a15094d1cf2a3378ca0503eb8a57630953a9e2987e21ddd0a6502207a6266d686c99090920249991d3d42065b6d43eb70187b219c0db82e4f94d1a201","0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG","DERSIG","SIG_DER","P2PK with too little R padding"], ["0x47 0x30440220005ece1335e7f757a1a1f476a7fb5bd90964e8a022489f890614a04acfb734c002206c12b8294a6513c7710e8c82d3c23d75cdbfe83200eb7efb495701958501a5d601","0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG NOT","","OK","P2PK NOT with bad sig with too much R padding but no DERSIG"], @@ -1020,9 +1017,7 @@ ["0x09 0x300602010102010101","0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG NOT","DERSIG","OK","BIP66 example 4, with DERSIG, non-null DER-compliant signature"], ["0","0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG NOT","DERSIG,NULLFAIL","OK","BIP66 example 4, with DERSIG and NULLFAIL"], ["0x09 0x300602010102010101","0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG NOT","DERSIG,NULLFAIL","NULLFAIL","BIP66 example 4, with DERSIG and NULLFAIL, non-null DER-compliant signature"], -["1","0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG","","EVAL_FALSE","BIP66 example 5, without DERSIG"], ["1","0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG","DERSIG","SIG_DER","BIP66 example 5, with DERSIG"], -["1","0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG NOT","","OK","BIP66 example 6, without DERSIG"], ["1","0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG NOT","DERSIG","SIG_DER","BIP66 example 6, with DERSIG"], ["0 0x47 0x30440220cae00b1444babfbf6071b0ba8707f6bd373da3df494d6e74119b0430c5db810502205d5231b8c5939c8ff0c82242656d6e06edb073d42af336c99fe8837c36ea39d501 0x47 0x3044022027c2714269ca5aeecc4d70edc88ba5ee0e3da4986e9216028f489ab4f1b8efce022022bd545b4951215267e4c5ceabd4c5350331b2e4a0b6494c56f361fa5a57a1a201","2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG","","OK","BIP66 example 7, without DERSIG"], ["0 0x47 0x30440220cae00b1444babfbf6071b0ba8707f6bd373da3df494d6e74119b0430c5db810502205d5231b8c5939c8ff0c82242656d6e06edb073d42af336c99fe8837c36ea39d501 0x47 0x3044022027c2714269ca5aeecc4d70edc88ba5ee0e3da4986e9216028f489ab4f1b8efce022022bd545b4951215267e4c5ceabd4c5350331b2e4a0b6494c56f361fa5a57a1a201","2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG","DERSIG","SIG_DER","BIP66 example 7, with DERSIG"], @@ -1033,12 +1028,18 @@ ["0 0 0x47 0x30440220da6f441dc3b4b2c84cfa8db0cd5b34ed92c9e01686de5a800d40498b70c0dcac02207c2cf91b0c32b860c4cd4994be36cfb84caf8bb7c3a8e4d96a31b2022c5299c501","2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG NOT","","OK","BIP66 example 10, without DERSIG"], ["0 0 0x47 0x30440220da6f441dc3b4b2c84cfa8db0cd5b34ed92c9e01686de5a800d40498b70c0dcac02207c2cf91b0c32b860c4cd4994be36cfb84caf8bb7c3a8e4d96a31b2022c5299c501","2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG NOT","DERSIG","SIG_DER","BIP66 example 10, with DERSIG"], ["0 0x47 0x30440220cae00b1444babfbf6071b0ba8707f6bd373da3df494d6e74119b0430c5db810502205d5231b8c5939c8ff0c82242656d6e06edb073d42af336c99fe8837c36ea39d501 0","2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG","","EVAL_FALSE","BIP66 example 11, without DERSIG"], +["0 0x47 0x30440220cae00b1444babfbf6071b0ba8707f6bd373da3df494d6e74119b0430c5db810502205d5231b8c5939c8ff0c82242656d6e06edb073d42af336c99fe8837c36ea39d501 0","2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG","DERSIG","EVAL_FALSE","BIP66 example 11, with DERSIG"], ["0 0x47 0x30440220b119d67d389315308d1745f734a51ff3ec72e06081e84e236fdf9dc2f5d2a64802204b04e3bc38674c4422ea317231d642b56dc09d214a1ecbbf16ecca01ed996e2201 0","2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG NOT","","OK","BIP66 example 12, without DERSIG"], +["0 0x47 0x30440220b119d67d389315308d1745f734a51ff3ec72e06081e84e236fdf9dc2f5d2a64802204b04e3bc38674c4422ea317231d642b56dc09d214a1ecbbf16ecca01ed996e2201 0","2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG NOT","DERSIG","OK","BIP66 example 12, with DERSIG"], +["0x48 0x304402203e4516da7253cf068effec6b95c41221c0cf3a8e6ccb8cbf1725b562e9afde2c022054e1c258c2981cdfba5df1f46661fb6541c44f77ca0092f3600331abfffb12510101","0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG","","OK","P2PK with multi-byte hashtype, without DERSIG"], ["0x48 0x304402203e4516da7253cf068effec6b95c41221c0cf3a8e6ccb8cbf1725b562e9afde2c022054e1c258c2981cdfba5df1f46661fb6541c44f77ca0092f3600331abfffb12510101","0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG","DERSIG","SIG_DER","P2PK with multi-byte hashtype, with DERSIG"], ["0x48 0x304502203e4516da7253cf068effec6b95c41221c0cf3a8e6ccb8cbf1725b562e9afde2c022100ab1e3da73d67e32045a20e0b999e049978ea8d6ee5480d485fcf2ce0d03b2ef001","0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG","","OK","P2PK with high S but no LOW_S"], ["0x47 0x3044022057292e2d4dfe775becdd0a9e6547997c728cdf35390f6a017da56d654d374e4902206b643be2fc53763b4e284845bfea2c597d2dc7759941dce937636c9d341b71ed01","0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG","","OK","P2PK with hybrid pubkey but no STRICTENC"], +["0x47 0x3044022057292e2d4dfe775becdd0a9e6547997c728cdf35390f6a017da56d654d374e4902206b643be2fc53763b4e284845bfea2c597d2dc7759941dce937636c9d341b71ed01","0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG","STRICTENC","PUBKEYTYPE","P2PK with hybrid pubkey"], ["0x47 0x30440220035d554e3153c14950c9993f41c496607a8e24093db0595be7bf875cf64fcf1f02204731c8c4e5daf15e706cec19cdd8f2c5b1d05490e11dab8465ed426569b6e92101","0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG NOT","","EVAL_FALSE","P2PK NOT with hybrid pubkey but no STRICTENC"], +["0x47 0x30440220035d554e3153c14950c9993f41c496607a8e24093db0595be7bf875cf64fcf1f02204731c8c4e5daf15e706cec19cdd8f2c5b1d05490e11dab8465ed426569b6e92101","0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG NOT","STRICTENC","PUBKEYTYPE","P2PK NOT with hybrid pubkey"], ["0x47 0x30440220035d554e3153c04950c9993f41c496607a8e24093db0595be7bf875cf64fcf1f02204731c8c4e5daf15e706cec19cdd8f2c5b1d05490e11dab8465ed426569b6e92101","0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG NOT","","OK","P2PK NOT with invalid hybrid pubkey but no STRICTENC"], +["0x47 0x30440220035d554e3153c04950c9993f41c496607a8e24093db0595be7bf875cf64fcf1f02204731c8c4e5daf15e706cec19cdd8f2c5b1d05490e11dab8465ed426569b6e92101","0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG NOT","STRICTENC","PUBKEYTYPE","P2PK NOT with invalid hybrid pubkey"], ["0 0x47 0x304402202e79441ad1baf5a07fb86bae3753184f6717d9692680947ea8b6e8b777c69af1022079a262e13d868bb5a0964fefe3ba26942e1b0669af1afb55ef3344bc9d4fc4c401","1 0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 2 CHECKMULTISIG","","OK","1-of-2 with the second 1 hybrid pubkey and no STRICTENC"], ["0 0x47 0x304402202e79441ad1baf5a07fb86bae3753184f6717d9692680947ea8b6e8b777c69af1022079a262e13d868bb5a0964fefe3ba26942e1b0669af1afb55ef3344bc9d4fc4c401","1 0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 2 CHECKMULTISIG","STRICTENC","OK","1-of-2 with the second 1 hybrid pubkey"], ["0 0x47 0x3044022079c7824d6c868e0e1a273484e28c2654a27d043c8a27f49f52cb72efed0759090220452bbbf7089574fa082095a4fc1b3a16bafcf97a3a34d745fafc922cce66b27201","1 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 2 CHECKMULTISIG","STRICTENC","PUBKEYTYPE","1-of-2 with the first 1 hybrid pubkey"], @@ -1076,14 +1077,21 @@ [["304402203b3389b87448d7dfdb5e82fb854fcf92d7925f9938ea5444e36abef02c3d6a9602202410bc3265049abb07fd2e252c65ab7034d95c9d5acccabe9fadbdc63a52712601","0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",0E-8],"","0 0x14 0x91b24bf9f5288532960ac687abb035127b1d28a5","P2SH,WITNESS","EVAL_FALSE","Basic P2WPKH with wrong value"], [["3044022000a30c4cfc10e4387be528613575434826ad3c15587475e0df8ce3b1746aa210022008149265e4f8e9dafe1f3ea50d90cb425e9e40ea7ebdd383069a7cfa2b77004701","410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac",0E-8],"0x22 0x0020b95237b48faaa69eb078e1170be3b5cbb3fddf16d0a991e14ad274f7b33a4f64","HASH160 0x14 0xf386c2ba255cc56d20cfa6ea8b062f8b59945518 EQUAL","P2SH,WITNESS","EVAL_FALSE","Basic P2SH(P2WSH) with wrong value"], [["304402204fc3a2cd61a47913f2a5f9107d0ad4a504c7b31ee2d6b3b2f38c2b10ee031e940220055d58b7c3c281aaa381d8f486ac0f3e361939acfd568046cb6a311cdfa974cf01","0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",0E-8],"0x16 0x001491b24bf9f5288532960ac687abb035127b1d28a5","HASH160 0x14 0x17743beb429c55c942d2ec703b98c4d57c2df5c6 EQUAL","P2SH,WITNESS","EVAL_FALSE","Basic P2SH(P2WPKH) with wrong value"], +[["3044022064100ca0e2a33332136775a86cd83d0230e58b9aebb889c5ac952abff79a46ef02205f1bf900e022039ad3091bdaf27ac2aef3eae9ed9f190d821d3e508405b9513101","0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",0E-8],"","0 0x1f 0xb34b78da162751647974d5cb7410aa428ad339dbf7d1e16e833f68a0cbf1c3","P2SH,WITNESS","WITNESS_PROGRAM_WRONG_LENGTH","P2WPKH with wrong witness program length"], +["","0 0x20 0xb95237b48faaa69eb078e1170be3b5cbb3fddf16d0a991e14ad274f7b33a4f64","P2SH,WITNESS","WITNESS_PROGRAM_WITNESS_EMPTY","P2WSH with empty witness"], [["3044022039105b995a5f448639a997a5c90fda06f50b49df30c3bdb6663217bf79323db002206fecd54269dec569fcc517178880eb58bb40f381a282bb75766ff3637d5f4b4301","400479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac",0E-8],"","0 0x20 0xb95237b48faaa69eb078e1170be3b5cbb3fddf16d0a991e14ad274f7b33a4f64","P2SH,WITNESS","WITNESS_PROGRAM_MISMATCH","P2WSH with witness program mismatch"], [["304402201a96950593cb0af32d080b0f193517f4559241a8ebd1e95e414533ad64a3f423022047f4f6d3095c23235bdff3aeff480d0529c027a3f093cb265b7cbf148553b85101","0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8","",0E-8],"","0 0x14 0x91b24bf9f5288532960ac687abb035127b1d28a5","P2SH,WITNESS","WITNESS_PROGRAM_MISMATCH","P2WPKH with witness program mismatch"], [["304402201a96950593cb0af32d080b0f193517f4559241a8ebd1e95e414533ad64a3f423022047f4f6d3095c23235bdff3aeff480d0529c027a3f093cb265b7cbf148553b85101","0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",0E-8],"11","0 0x14 0x91b24bf9f5288532960ac687abb035127b1d28a5","P2SH,WITNESS","WITNESS_MALLEATED","P2WPKH with non-empty scriptSig"], +[["304402204209e49457c2358f80d0256bc24535b8754c14d08840fc4be762d6f5a0aed80b02202eaf7d8fc8d62f60c67adcd99295528d0e491ae93c195cec5a67e7a09532a88001","048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf",0E-8],"11 0x16 0x00147cf9c846cd4882efec4bf07e44ebdad495c94f4b","HASH160 0x14 0x4e0c2aed91315303fc6a1dc4c7bc21c88f75402e EQUAL","P2SH,WITNESS","WITNESS_MALLEATED_P2SH","P2SH(P2WPKH) with superfluous push in scriptSig"], [["",0E-8],"0x47 0x304402200a5c6163f07b8d3b013c4d1d6dba25e780b39658d79ba37af7057a3b7f15ffa102201fd9b4eaa9943f734928b99a83592c2e7bf342ea2680f6a2bb705167966b742001","0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG","P2SH,WITNESS","WITNESS_UNEXPECTED","P2PK with witness"], [["304402204256146fcf8e73b0fd817ffa2a4e408ff0418ff987dd08a4f485b62546f6c43c02203f3c8c3e2febc051e1222867f5f9d0eaf039d6792911c10940aa3cc74123378e01","210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798ac",1E-8],"","0 0x20 0x1863143c14c5166804bd19203356da136c985678cd4d27a1b8c6329604903262","P2SH,WITNESS,WITNESS_PUBKEYTYPE","OK","Basic P2WSH with compressed key"], [["304402204edf27486f11432466b744df533e1acac727e0c83e5f912eb289a3df5bf8035f022075809fdd876ede40ad21667eba8b7e96394938f9c9c50f11b6a1280cce2cea8601","0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",1E-8],"","0 0x14 0x751e76e8199196d454941c45d1b3a323f1433bd6","P2SH,WITNESS,WITNESS_PUBKEYTYPE","OK","Basic P2WPKH with compressed key"], [["304402203a549090cc46bce1e5e95c4922ea2c12747988e0207b04c42f81cdbe87bb1539022050f57a245b875fd5119c419aaf050bcdf41384f0765f04b809e5bced1fe7093d01","210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798ac",1E-8],"0x22 0x00201863143c14c5166804bd19203356da136c985678cd4d27a1b8c6329604903262","HASH160 0x14 0xe4300531190587e3880d4c3004f5355d88ff928d EQUAL","P2SH,WITNESS,WITNESS_PUBKEYTYPE","OK","Basic P2SH(P2WSH) with compressed key"], [["304402201bc0d53046827f4a35a3166e33e3b3366c4085540dc383b95d21ed2ab11e368a0220333e78c6231214f5f8e59621e15d7eeab0d4e4d0796437e00bfbd2680c5f9c1701","0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",1E-8],"0x16 0x0014751e76e8199196d454941c45d1b3a323f1433bd6","HASH160 0x14 0xbcfeb728b584253d5f3f70bcb780e9ef218a68f4 EQUAL","P2SH,WITNESS,WITNESS_PUBKEYTYPE","OK","Basic P2SH(P2WPKH) with compressed key"], +[["304402200d461c140cfdfcf36b94961db57ae8c18d1cb80e9d95a9e47ac22470c1bf125502201c8dc1cbfef6a3ef90acbbb992ca22fe9466ee6f9d4898eda277a7ac3ab4b25101","410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac",1E-8],"","0 0x20 0xb95237b48faaa69eb078e1170be3b5cbb3fddf16d0a991e14ad274f7b33a4f64","P2SH,WITNESS,WITNESS_PUBKEYTYPE","WITNESS_PUBKEYTYPE","Basic P2WSH"], +[["304402201e7216e5ccb3b61d46946ec6cc7e8c4e0117d13ac2fd4b152197e4805191c74202203e9903e33e84d9ee1dd13fb057afb7ccfb47006c23f6a067185efbc9dd780fc501","0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",1E-8],"","0 0x14 0x91b24bf9f5288532960ac687abb035127b1d28a5","P2SH,WITNESS,WITNESS_PUBKEYTYPE","WITNESS_PUBKEYTYPE","Basic P2WPKH"], +[["3044022066e02c19a513049d49349cf5311a1b012b7c4fae023795a18ab1d91c23496c22022025e216342c8e07ce8ef51e8daee88f84306a9de66236cab230bb63067ded1ad301","410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac",1E-8],"0x22 0x0020b95237b48faaa69eb078e1170be3b5cbb3fddf16d0a991e14ad274f7b33a4f64","HASH160 0x14 0xf386c2ba255cc56d20cfa6ea8b062f8b59945518 EQUAL","P2SH,WITNESS,WITNESS_PUBKEYTYPE","WITNESS_PUBKEYTYPE","Basic P2SH(P2WSH)"], +[["304402200929d11561cd958460371200f82e9cae64c727a495715a31828e27a7ad57b36d0220361732ced04a6f97351ecca21a56d0b8cd4932c1da1f8f569a2b68e5e48aed7801","0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",1E-8],"0x16 0x001491b24bf9f5288532960ac687abb035127b1d28a5","HASH160 0x14 0x17743beb429c55c942d2ec703b98c4d57c2df5c6 EQUAL","P2SH,WITNESS,WITNESS_PUBKEYTYPE","WITNESS_PUBKEYTYPE","Basic P2SH(P2WPKH)"], ["","CHECKSEQUENCEVERIFY","CHECKSEQUENCEVERIFY","INVALID_STACK_OPERATION","CSV automatically fails on an empty stack"], ["-1","CHECKSEQUENCEVERIFY","CHECKSEQUENCEVERIFY","NEGATIVE_LOCKTIME","CSV automatically fails if stack top is negative"], ["0x0100","CHECKSEQUENCEVERIFY","CHECKSEQUENCEVERIFY,MINIMALDATA","UNKNOWN_ERROR","CSV fails if stack top is not minimally encoded"], @@ -1157,7 +1165,11 @@ [["00","645168",1E-8],"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL","P2SH,WITNESS,MINIMALIF","MINIMALIF"], [["645168",1E-8],"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL","P2SH,WITNESS","UNBALANCED_CONDITIONAL"], [["645168",1E-8],"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL","P2SH,WITNESS,MINIMALIF","UNBALANCED_CONDITIONAL"], +["0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0","0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT","DERSIG","OK","BIP66 and NULLFAIL-compliant"], ["0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0","0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT","DERSIG,NULLFAIL","OK","BIP66 and NULLFAIL-compliant"], ["1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0","0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT","DERSIG,NULLFAIL","OK","BIP66 and NULLFAIL-compliant, not NULLDUMMY-compliant"], ["1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0","0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT","DERSIG,NULLFAIL,NULLDUMMY","SIG_NULLDUMMY","BIP66 and NULLFAIL-compliant, not NULLDUMMY-compliant"], -["0 0x09 0x300602010102010101 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0","0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT","DERSIG,NULLFAIL","NULLFAIL","BIP66-compliant but not NULLFAIL-compliant"], +["0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0x09 0x300602010102010101","0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT","DERSIG","OK","BIP66-compliant but not NULLFAIL-compliant"], +["0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0x09 0x300602010102010101","0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT","DERSIG,NULLFAIL","NULLFAIL","BIP66-compliant but not NULLFAIL-compliant"], +["0 0x09 0x300602010102010101 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0","0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT","DERSIG","OK","BIP66-compliant but not NULLFAIL-compliant"], +["0 0x09 0x300602010102010101 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0","0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT","DERSIG,NULLFAIL","NULLFAIL","BIP66-compliant but not NULLFAIL-compliant"]] From ab381addb226d66570c98e8f9e3d54d18dd4d3e9 Mon Sep 17 00:00:00 2001 From: Dao Nguyen Date: Mon, 21 Oct 2024 23:36:35 +0700 Subject: [PATCH 2/8] more fix --- packages/engine/src/errors.cairo | 1 + packages/engine/src/opcodes/crypto.cairo | 11 +- packages/engine/src/signature/signature.cairo | 37 +++- tests/run-failing-core-tests.sh | 2 +- tests/script_tests_failing.json | 52 +++-- tests/script_tests_passing.json | 180 +++++++++--------- 6 files changed, 151 insertions(+), 132 deletions(-) diff --git a/packages/engine/src/errors.cairo b/packages/engine/src/errors.cairo index f75634a..18bde66 100644 --- a/packages/engine/src/errors.cairo +++ b/packages/engine/src/errors.cairo @@ -37,6 +37,7 @@ pub mod Error { pub const SCRIPT_ERR_SIG_DER: felt252 = 'Signature DER error'; pub const PUBKEYTYPE: felt252 = 'Unsupported public key type'; pub const SIG_HIGH_S: felt252 = 'Sig not canonical high S value'; + pub const SIG_HASHTYPE: felt252 = 'invalid hash type'; } pub fn byte_array_err(err: felt252) -> ByteArray { diff --git a/packages/engine/src/opcodes/crypto.cairo b/packages/engine/src/opcodes/crypto.cairo index 0275d30..8de0f13 100644 --- a/packages/engine/src/opcodes/crypto.cairo +++ b/packages/engine/src/opcodes/crypto.cairo @@ -102,7 +102,7 @@ pub fn opcode_checksig< let res = BaseSigVerifierTrait::new(ref engine, @full_sig_bytes, @pk_bytes); if res.is_err() { let err = res.unwrap_err(); - if err == Error::SCRIPT_ERR_SIG_DER || err == Error::PUBKEYTYPE { + if err == Error::SCRIPT_ERR_SIG_DER || err == Error::PUBKEYTYPE || err == Error::SIG_HASHTYPE { return Result::Err(err); }; engine.dstack.push_bool(false); @@ -211,7 +211,6 @@ pub fn opcode_checkmultisig< if err != 0 { return Result::Err(err); } - println!("num_sigs: {}", sigs[0].len()); // Historical bug let dummy = engine.dstack.pop_byte_array()?; @@ -234,6 +233,7 @@ pub fn opcode_checkmultisig< num_pub_keys += 1; // Offset due to decrementing it in the loop let mut pub_key_idx: i64 = -1; let mut sig_idx: i64 = 0; + while num_sigs != 0 { pub_key_idx += 1; num_pub_keys -= 1; @@ -279,12 +279,11 @@ pub fn opcode_checkmultisig< return Result::Err(err); } } else if verify_der || strict_encoding { - if err == Error::SCRIPT_ERR_SIG_DER || err == Error::PUBKEYTYPE { - return Result::Err(err); - } if err == 'invalid sig fmt: S padding' { return Result::Err(Error::SCRIPT_ERR_SIG_DER); - } + } else if err != ''{ + return Result::Err(err); + } } else if err == Error::SIG_HIGH_S { return Result::Err(err); } diff --git a/packages/engine/src/signature/signature.cairo b/packages/engine/src/signature/signature.cairo index 9afdee6..c4e9991 100644 --- a/packages/engine/src/signature/signature.cairo +++ b/packages/engine/src/signature/signature.cairo @@ -156,8 +156,7 @@ pub fn check_hash_type_encoding< hash_type -= constants::SIG_HASH_ANYONECANPAY; } if hash_type < constants::SIG_HASH_ALL || hash_type > constants::SIG_HASH_SINGLE { - println!("Invalid hash type: {}", hash_type); - return Result::Err('invalid hash type'); + return Result::Err(Error::SIG_HASHTYPE); } return Result::Ok(()); @@ -268,6 +267,7 @@ pub fn check_signature_encoding< return Result::Err('invalid sig fmt: R padding'); } + // Ensure the `S` value is correctly identified as an ASN.1 integer. if sig_bytes[s_type_offset] != asn1_integer_id { return Result::Err('invalid sig fmt:S ASN.1'); @@ -277,19 +277,17 @@ pub fn check_signature_encoding< return Result::Err('invalid sig fmt:S length'); } - // If strict encoding is enforced, check for negative or excessively padded `S` values. - if strict_encoding { if sig_bytes[s_offset] & 0x80 != 0 { return Result::Err('invalid sig fmt: negative S'); } if s_len > 1 && sig_bytes[s_offset] == 0 && sig_bytes[s_offset + 1] & 0x80 == 0 { return Result::Err('invalid sig fmt: S padding'); } - } + // If the "low S" rule is enforced, check that the `S` value is below the threshold. if low_s { - let s_value = u256_from_byte_array_with_offset(sig_bytes, s_offset, 32); + let s_value = u256_from_byte_array_with_offset(sig_bytes, s_offset, s_len); let mut half_order = Secp256Trait::::get_curve_size(); let (half_order_high_upper, half_order_high_lower) = DivRem::div_rem(half_order.high, 2); @@ -404,14 +402,30 @@ pub fn parse_pub_key(pk_bytes: @ByteArray) -> Result { // This function extracts the `r` and `s` values from a DER-encoded ECDSA signature (`sig_bytes`). // The function performs various checks to ensure the integrity and validity of the signature. pub fn parse_signature(sig_bytes: @ByteArray) -> Result { + if sig_bytes[0] != 0x30 { + return Result::Err('invalid sig fmt: no header'); + } let mut sig_len: usize = sig_bytes[1].into(); if sig_len + 2 > sig_bytes.len() || sig_len + 2 < constants::MIN_SIG_LEN { return Result::Err('invalid sig fmt: bad length'); } + let mut start = 0; let sig_bytes = @sub_byte_array(sig_bytes, ref start, sig_len + 2); + if sig_bytes[2] != 0x02 { + return Result::Err('invalid sig fmt: no 1st marker'); + } + let mut r_len: usize = sig_bytes[3].into(); + if r_len <= 0 || r_len > sig_len - 5 { + return Result::Err('invalid sig fmt: bogus R length'); + } + let mut s_len: usize = sig_bytes[r_len + 5].into(); + if s_len <= 0 || s_len > sig_len - r_len - 4 { + return Result::Err('invalid sig fmt: bogus S length'); + } + let mut r_offset = 4; let mut s_offset = 6 + r_len; let order: u256 = Secp256Trait::::get_curve_size(); @@ -505,14 +519,16 @@ pub fn parse_base_sig_and_pk< }; } } + println!("1"); if let Result::Err(e) = check_signature_encoding(ref vm, sig_bytes) { - return if verify_der { + return if strict_encoding { Result::Err(Error::SCRIPT_ERR_SIG_DER) } else { Result::Err(e) }; } + println!("2"); if let Result::Err(e) = check_pub_key_encoding(ref vm, pk_bytes) { return if verify_der { @@ -521,11 +537,14 @@ pub fn parse_base_sig_and_pk< Result::Err(e) }; } + println!("3"); let mut start = 0; if hash_type_offset < 1 { return Result::Err('invalid hash offset'); } + println!("4"); + let sig_bytes = @sub_byte_array(sig_bytes, ref start, hash_type_offset); let sig = match parse_signature(sig_bytes) { Result::Ok(signature) => signature, @@ -535,13 +554,13 @@ pub fn parse_base_sig_and_pk< return Result::Err(e); }, }; - println!("Parsed sig and pk"); + println!("5"); + let pub_key = match parse_pub_key(pk_bytes) { Result::Ok(key) => key, Result::Err(e) => { return Result::Err(e); } }; - Result::Ok((pub_key, sig, hash_type)) } diff --git a/tests/run-failing-core-tests.sh b/tests/run-failing-core-tests.sh index 17c1e88..3d45f92 100755 --- a/tests/run-failing-core-tests.sh +++ b/tests/run-failing-core-tests.sh @@ -185,7 +185,7 @@ jq -c '.[]' $SCRIPT_TESTS_JSON | { elif echo "$RESULT" | grep -q "$INVALID_SIG_FMT"; then SCRIPT_RESULT="SIG_DER" elif echo "$RESULT" | grep -q "$INVALID_HASH_TYPE"; then - SCRIPT_RESULT="SIG_DER" + SCRIPT_RESULT="SIG_HASHTYPE" elif echo "$RESULT" | grep -q "$NONZERO_NULLFAIL"; then SCRIPT_RESULT="NULLFAIL" elif echo "$RESULT" | grep -q "$SIG_NULLFAIL"; then diff --git a/tests/script_tests_failing.json b/tests/script_tests_failing.json index 35db1a9..437517b 100644 --- a/tests/script_tests_failing.json +++ b/tests/script_tests_failing.json @@ -1,34 +1,28 @@ [ -["0x25 0x30220220000000000000000000000000000000000000000000000000000000000000000000","0 CHECKSIG NOT","","OK","Missing S is correctly encoded"], -["0 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501 1","2 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 2 CHECKMULTISIG NOT","STRICTENC","SIG_DER","2-of-2 CHECKMULTISIG NOT with both pubkeys valid, but first signature invalid."], -["0 0x47 0x304402205451ce65ad844dbb978b8bdedf5082e33b43cae8279c30f2c74d9e9ee49a94f802203fe95a7ccf74da7a232ee523ef4a53cb4d14bdd16289680cdb97a63819b8f42f01 0x46 0x304402205451ce65ad844dbb978b8bdedf5082e33b43cae8279c30f2c74d9e9ee49a94f802203fe95a7ccf74da7a232ee523ef4a53cb4d14bdd16289680cdb97a63819b8f42f","2 0x21 0x02a673638cb9587cb68ea08dbef685c6f2d2a751a8b3c6f2a7e9a4999e6e4bfaf5 0x21 0x02a673638cb9587cb68ea08dbef685c6f2d2a751a8b3c6f2a7e9a4999e6e4bfaf5 0x21 0x02a673638cb9587cb68ea08dbef685c6f2d2a751a8b3c6f2a7e9a4999e6e4bfaf5 3 CHECKMULTISIG","P2SH,STRICTENC","SIG_DER","2-of-3 with one valid and one invalid signature due to parse error, nSigs > validSigs"], -["0x27 0x302402107777777777777777777777777777777702108777777777777777777777777777777701","0 CHECKSIG NOT","DERSIG","SIG_DER","Negative S is incorrectly encoded for DERSIG"], -["0x48 0x304502202de8c03fc525285c9c535631019a5f2af7c6454fa9eb392a3756a4917c420edd02210046130bf2baf7cfc065067c8b9e33a066d9c15edcea9feb0ca2d233e3597925b401","0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG","DERSIG","SIG_DER","P2PK with too much S padding"], -["1","0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG","","EVAL_FALSE","BIP66 example 5, without DERSIG"], -["1","0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG NOT","","OK","BIP66 example 6, without DERSIG"], ["0x48 0x304502203e4516da7253cf068effec6b95c41221c0cf3a8e6ccb8cbf1725b562e9afde2c022100ab1e3da73d67e32045a20e0b999e049978ea8d6ee5480d485fcf2ce0d03b2ef001","0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG","LOW_S","SIG_HIGH_S","P2PK with high S"], ["0x47 0x304402206177d513ec2cda444c021a1f4f656fc4c72ba108ae063e157eb86dc3575784940220666fc66702815d0e5413bb9b1df22aed44f5f1efb8b99d41dd5dc9a5be6d205205","0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG","STRICTENC","SIG_HASHTYPE","P2PK with undefined hashtype"], ["0x47 0x304402207409b5b320296e5e2136a7b281a7f803028ca4ca44e2b83eebd46932677725de02202d4eea1c8d3c98e6f42614f54764e6e5e6542e213eb4d079737e9a8b6e9812ec05","0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG NOT","STRICTENC","SIG_HASHTYPE","P2PK NOT with invalid sig and undefined hashtype"], -[["304402205ae57ae0534c05ca9981c8a6cdf353b505eaacb7375f96681a2d1a4ba6f02f84022056248e68643b7d8ce7c7d128c9f1f348bcab8be15d094ad5cadd24251a28df8001","0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",0E-8],"","1 0x14 0x91b24bf9f5288532960ac687abb035127b1d28a5","DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM,P2SH,WITNESS","DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM","P2WPKH with future witness version"], -[["","304402207eb8a59b5c65fc3f6aeef77066556ed5c541948a53a3ba7f7c375b8eed76ee7502201e036a7a9a98ff919ff94dc905d67a1ec006f79ef7cff0708485c8bb79dce38e01","5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae",1E-8],"","0 0x20 0x06c24420938f0fa3c1cb2707d867154220dca365cdbfa0dd2a83854730221460","P2SH,WITNESS,WITNESS_PUBKEYTYPE","OK","P2WSH CHECKMULTISIG with compressed keys"], -[["","3044022033706aed33b8155d5486df3b9bca8cdd3bd4bdb5436dce46d72cdaba51d22b4002203626e94fe53a178af46624f17315c6931f20a30b103f5e044e1eda0c3fe185c601","5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae",1E-8],"0x22 0x002006c24420938f0fa3c1cb2707d867154220dca365cdbfa0dd2a83854730221460","HASH160 0x14 0x26282aad7c29369d15fed062a778b6100d31a340 EQUAL","P2SH,WITNESS,WITNESS_PUBKEYTYPE","OK","P2SH(P2WSH) CHECKMULTISIG with compressed keys"], -[["","304402204048b7371ab1c544362efb89af0c80154747d665aa4fcfb2edfd2d161e57b42e02207e043748e96637080ffc3acbd4dcc6fee1e58d30f6d1269535f32188e5ddae7301","5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae",1E-8],"","0 0x20 0x06c24420938f0fa3c1cb2707d867154220dca365cdbfa0dd2a83854730221460","P2SH,WITNESS,WITNESS_PUBKEYTYPE","OK","P2WSH CHECKMULTISIG with compressed keys"], -[["","3044022073902ef0b8a554c36c44cc03c1b64df96ce2914ebcf946f5bb36078fd5245cdf02205b148f1ba127065fb8c83a5a9576f2dcd111739788ed4bb3ee08b2bd3860c91c01","5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae",1E-8],"0x22 0x002006c24420938f0fa3c1cb2707d867154220dca365cdbfa0dd2a83854730221460","HASH160 0x14 0x26282aad7c29369d15fed062a778b6100d31a340 EQUAL","P2SH,WITNESS,WITNESS_PUBKEYTYPE","OK","P2SH(P2WSH) CHECKMULTISIG with compressed keys"], -[["","304402202d092ededd1f060609dbf8cb76950634ff42b3e62cf4adb69ab92397b07d742302204ff886f8d0817491a96d1daccdcc820f6feb122ee6230143303100db37dfa79f01","5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b852ae",1E-8],"","0 0x20 0x08a6665ebfd43b02323423e764e185d98d1587f903b81507dbb69bfc41005efa","P2SH,WITNESS","OK","P2WSH CHECKMULTISIG with first key uncompressed and signing with the first key"], -[["","304402202dd7e91243f2235481ffb626c3b7baf2c859ae3a5a77fb750ef97b99a8125dc002204960de3d3c3ab9496e218ec57e5240e0e10a6f9546316fe240c216d45116d29301","5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b852ae",1E-8],"0x22 0x002008a6665ebfd43b02323423e764e185d98d1587f903b81507dbb69bfc41005efa","HASH160 0x14 0x6f5ecd4b83b77f3c438f5214eff96454934fc5d1 EQUAL","P2SH,WITNESS","OK","P2SH(P2WSH) CHECKMULTISIG first key uncompressed and signing with the first key"], -[["","304402202d092ededd1f060609dbf8cb76950634ff42b3e62cf4adb69ab92397b07d742302204ff886f8d0817491a96d1daccdcc820f6feb122ee6230143303100db37dfa79f01","5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b852ae",1E-8],"","0 0x20 0x08a6665ebfd43b02323423e764e185d98d1587f903b81507dbb69bfc41005efa","P2SH,WITNESS,WITNESS_PUBKEYTYPE","WITNESS_PUBKEYTYPE","P2WSH CHECKMULTISIG with first key uncompressed and signing with the first key"], -[["","304402202dd7e91243f2235481ffb626c3b7baf2c859ae3a5a77fb750ef97b99a8125dc002204960de3d3c3ab9496e218ec57e5240e0e10a6f9546316fe240c216d45116d29301","5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b852ae",1E-8],"0x22 0x002008a6665ebfd43b02323423e764e185d98d1587f903b81507dbb69bfc41005efa","HASH160 0x14 0x6f5ecd4b83b77f3c438f5214eff96454934fc5d1 EQUAL","P2SH,WITNESS,WITNESS_PUBKEYTYPE","WITNESS_PUBKEYTYPE","P2SH(P2WSH) CHECKMULTISIG with first key uncompressed and signing with the first key"], -[["","304402201e9e6f7deef5b2f21d8223c5189b7d5e82d237c10e97165dd08f547c4e5ce6ed02206796372eb1cc6acb52e13ee2d7f45807780bf96b132cb6697f69434be74b1af901","5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b852ae",1E-8],"","0 0x20 0x08a6665ebfd43b02323423e764e185d98d1587f903b81507dbb69bfc41005efa","P2SH,WITNESS","OK","P2WSH CHECKMULTISIG with first key uncompressed and signing with the second key"], -[["","3044022045e667f3f0f3147b95597a24babe9afecea1f649fd23637dfa7ed7e9f3ac18440220295748e81005231135289fe3a88338dabba55afa1bdb4478691337009d82b68d01","5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b852ae",1E-8],"0x22 0x002008a6665ebfd43b02323423e764e185d98d1587f903b81507dbb69bfc41005efa","HASH160 0x14 0x6f5ecd4b83b77f3c438f5214eff96454934fc5d1 EQUAL","P2SH,WITNESS","OK","P2SH(P2WSH) CHECKMULTISIG with first key uncompressed and signing with the second key"], -[["","304402201e9e6f7deef5b2f21d8223c5189b7d5e82d237c10e97165dd08f547c4e5ce6ed02206796372eb1cc6acb52e13ee2d7f45807780bf96b132cb6697f69434be74b1af901","5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b852ae",1E-8],"","0 0x20 0x08a6665ebfd43b02323423e764e185d98d1587f903b81507dbb69bfc41005efa","P2SH,WITNESS,WITNESS_PUBKEYTYPE","WITNESS_PUBKEYTYPE","P2WSH CHECKMULTISIG with first key uncompressed and signing with the second key"], -[["","3044022045e667f3f0f3147b95597a24babe9afecea1f649fd23637dfa7ed7e9f3ac18440220295748e81005231135289fe3a88338dabba55afa1bdb4478691337009d82b68d01","5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b852ae",1E-8],"0x22 0x002008a6665ebfd43b02323423e764e185d98d1587f903b81507dbb69bfc41005efa","HASH160 0x14 0x6f5ecd4b83b77f3c438f5214eff96454934fc5d1 EQUAL","P2SH,WITNESS,WITNESS_PUBKEYTYPE","WITNESS_PUBKEYTYPE","P2SH(P2WSH) CHECKMULTISIG with first key uncompressed and signing with the second key"], -[["","3044022046f5367a261fd8f8d7de6eb390491344f8ec2501638fb9a1095a0599a21d3f4c02205c1b3b51d20091c5f1020841bbca87b44ebe25405c64e4acf758f2eae8665f8401","5141048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae",1E-8],"","0 0x20 0x230828ed48871f0f362ce9432aa52f620f442cc8d9ce7a8b5e798365595a38bb","P2SH,WITNESS","OK","P2WSH CHECKMULTISIG with second key uncompressed and signing with the first key"], -[["","3044022053e210e4fb1881e6092fd75c3efc5163105599e246ded661c0ee2b5682cc2d6c02203a26b7ada8682a095b84c6d1b881637000b47d761fc837c4cee33555296d63f101","5141048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae",1E-8],"0x22 0x0020230828ed48871f0f362ce9432aa52f620f442cc8d9ce7a8b5e798365595a38bb","HASH160 0x14 0x3478e7019ce61a68148f87549579b704cbe4c393 EQUAL","P2SH,WITNESS","OK","P2SH(P2WSH) CHECKMULTISIG second key uncompressed and signing with the first key"], -[["","3044022046f5367a261fd8f8d7de6eb390491344f8ec2501638fb9a1095a0599a21d3f4c02205c1b3b51d20091c5f1020841bbca87b44ebe25405c64e4acf758f2eae8665f8401","5141048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae",1E-8],"","0 0x20 0x230828ed48871f0f362ce9432aa52f620f442cc8d9ce7a8b5e798365595a38bb","P2SH,WITNESS,WITNESS_PUBKEYTYPE","OK","P2WSH CHECKMULTISIG with second key uncompressed and signing with the first key should pass as the uncompressed key is not used"], -[["","3044022053e210e4fb1881e6092fd75c3efc5163105599e246ded661c0ee2b5682cc2d6c02203a26b7ada8682a095b84c6d1b881637000b47d761fc837c4cee33555296d63f101","5141048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae",1E-8],"0x22 0x0020230828ed48871f0f362ce9432aa52f620f442cc8d9ce7a8b5e798365595a38bb","HASH160 0x14 0x3478e7019ce61a68148f87549579b704cbe4c393 EQUAL","P2SH,WITNESS,WITNESS_PUBKEYTYPE","OK","P2SH(P2WSH) CHECKMULTISIG with second key uncompressed and signing with the first key should pass as the uncompressed key is not used"], -[["","304402206c6d9f5daf85b54af2a93ec38b15ab27f205dbf5c735365ff12451e43613d1f40220736a44be63423ed5ebf53491618b7cc3d8a5093861908da853739c73717938b701","5141048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae",1E-8],"","0 0x20 0x230828ed48871f0f362ce9432aa52f620f442cc8d9ce7a8b5e798365595a38bb","P2SH,WITNESS","OK","P2WSH CHECKMULTISIG with second key uncompressed and signing with the second key"], -[["","30440220687871bc6144012d75baf585bb26ce13997f7d8c626f4d8825b069c3b2d064470220108936fe1c57327764782253e99090b09c203ec400ed35ce9e026ce2ecf842a001","5141048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae",1E-8],"0x22 0x0020230828ed48871f0f362ce9432aa52f620f442cc8d9ce7a8b5e798365595a38bb","HASH160 0x14 0x3478e7019ce61a68148f87549579b704cbe4c393 EQUAL","P2SH,WITNESS","OK","P2SH(P2WSH) CHECKMULTISIG with second key uncompressed and signing with the second key"], -[["","304402206c6d9f5daf85b54af2a93ec38b15ab27f205dbf5c735365ff12451e43613d1f40220736a44be63423ed5ebf53491618b7cc3d8a5093861908da853739c73717938b701","5141048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae",1E-8],"","0 0x20 0x230828ed48871f0f362ce9432aa52f620f442cc8d9ce7a8b5e798365595a38bb","P2SH,WITNESS,WITNESS_PUBKEYTYPE","WITNESS_PUBKEYTYPE","P2WSH CHECKMULTISIG with second key uncompressed and signing with the second key"], -[["","30440220687871bc6144012d75baf585bb26ce13997f7d8c626f4d8825b069c3b2d064470220108936fe1c57327764782253e99090b09c203ec400ed35ce9e026ce2ecf842a001","5141048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae",1E-8],"0x22 0x0020230828ed48871f0f362ce9432aa52f620f442cc8d9ce7a8b5e798365595a38bb","HASH160 0x14 0x3478e7019ce61a68148f87549579b704cbe4c393 EQUAL","P2SH,WITNESS,WITNESS_PUBKEYTYPE","WITNESS_PUBKEYTYPE","P2SH(P2WSH) CHECKMULTISIG with second key uncompressed and signing with the second key"], +[["304402205ae57ae0534c05ca9981c8a6cdf353b505eaacb7375f96681a2d1a4ba6f02f84022056248e68643b7d8ce7c7d128c9f1f348bcab8be15d094ad5cadd24251a28df8001","0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",0],"","1 0x14 0x91b24bf9f5288532960ac687abb035127b1d28a5","DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM,P2SH,WITNESS","DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM","P2WPKH with future witness version"], +[["","304402207eb8a59b5c65fc3f6aeef77066556ed5c541948a53a3ba7f7c375b8eed76ee7502201e036a7a9a98ff919ff94dc905d67a1ec006f79ef7cff0708485c8bb79dce38e01","5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae",1e-08],"","0 0x20 0x06c24420938f0fa3c1cb2707d867154220dca365cdbfa0dd2a83854730221460","P2SH,WITNESS,WITNESS_PUBKEYTYPE","OK","P2WSH CHECKMULTISIG with compressed keys"], +[["","3044022033706aed33b8155d5486df3b9bca8cdd3bd4bdb5436dce46d72cdaba51d22b4002203626e94fe53a178af46624f17315c6931f20a30b103f5e044e1eda0c3fe185c601","5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae",1e-08],"0x22 0x002006c24420938f0fa3c1cb2707d867154220dca365cdbfa0dd2a83854730221460","HASH160 0x14 0x26282aad7c29369d15fed062a778b6100d31a340 EQUAL","P2SH,WITNESS,WITNESS_PUBKEYTYPE","OK","P2SH(P2WSH) CHECKMULTISIG with compressed keys"], +[["","304402204048b7371ab1c544362efb89af0c80154747d665aa4fcfb2edfd2d161e57b42e02207e043748e96637080ffc3acbd4dcc6fee1e58d30f6d1269535f32188e5ddae7301","5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae",1e-08],"","0 0x20 0x06c24420938f0fa3c1cb2707d867154220dca365cdbfa0dd2a83854730221460","P2SH,WITNESS,WITNESS_PUBKEYTYPE","OK","P2WSH CHECKMULTISIG with compressed keys"], +[["","3044022073902ef0b8a554c36c44cc03c1b64df96ce2914ebcf946f5bb36078fd5245cdf02205b148f1ba127065fb8c83a5a9576f2dcd111739788ed4bb3ee08b2bd3860c91c01","5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae",1e-08],"0x22 0x002006c24420938f0fa3c1cb2707d867154220dca365cdbfa0dd2a83854730221460","HASH160 0x14 0x26282aad7c29369d15fed062a778b6100d31a340 EQUAL","P2SH,WITNESS,WITNESS_PUBKEYTYPE","OK","P2SH(P2WSH) CHECKMULTISIG with compressed keys"], +[["","304402202d092ededd1f060609dbf8cb76950634ff42b3e62cf4adb69ab92397b07d742302204ff886f8d0817491a96d1daccdcc820f6feb122ee6230143303100db37dfa79f01","5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b852ae",1e-08],"","0 0x20 0x08a6665ebfd43b02323423e764e185d98d1587f903b81507dbb69bfc41005efa","P2SH,WITNESS","OK","P2WSH CHECKMULTISIG with first key uncompressed and signing with the first key"], +[["","304402202dd7e91243f2235481ffb626c3b7baf2c859ae3a5a77fb750ef97b99a8125dc002204960de3d3c3ab9496e218ec57e5240e0e10a6f9546316fe240c216d45116d29301","5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b852ae",1e-08],"0x22 0x002008a6665ebfd43b02323423e764e185d98d1587f903b81507dbb69bfc41005efa","HASH160 0x14 0x6f5ecd4b83b77f3c438f5214eff96454934fc5d1 EQUAL","P2SH,WITNESS","OK","P2SH(P2WSH) CHECKMULTISIG first key uncompressed and signing with the first key"], +[["","304402202d092ededd1f060609dbf8cb76950634ff42b3e62cf4adb69ab92397b07d742302204ff886f8d0817491a96d1daccdcc820f6feb122ee6230143303100db37dfa79f01","5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b852ae",1e-08],"","0 0x20 0x08a6665ebfd43b02323423e764e185d98d1587f903b81507dbb69bfc41005efa","P2SH,WITNESS,WITNESS_PUBKEYTYPE","WITNESS_PUBKEYTYPE","P2WSH CHECKMULTISIG with first key uncompressed and signing with the first key"], +[["","304402202dd7e91243f2235481ffb626c3b7baf2c859ae3a5a77fb750ef97b99a8125dc002204960de3d3c3ab9496e218ec57e5240e0e10a6f9546316fe240c216d45116d29301","5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b852ae",1e-08],"0x22 0x002008a6665ebfd43b02323423e764e185d98d1587f903b81507dbb69bfc41005efa","HASH160 0x14 0x6f5ecd4b83b77f3c438f5214eff96454934fc5d1 EQUAL","P2SH,WITNESS,WITNESS_PUBKEYTYPE","WITNESS_PUBKEYTYPE","P2SH(P2WSH) CHECKMULTISIG with first key uncompressed and signing with the first key"], +[["","304402201e9e6f7deef5b2f21d8223c5189b7d5e82d237c10e97165dd08f547c4e5ce6ed02206796372eb1cc6acb52e13ee2d7f45807780bf96b132cb6697f69434be74b1af901","5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b852ae",1e-08],"","0 0x20 0x08a6665ebfd43b02323423e764e185d98d1587f903b81507dbb69bfc41005efa","P2SH,WITNESS","OK","P2WSH CHECKMULTISIG with first key uncompressed and signing with the second key"], +[["","3044022045e667f3f0f3147b95597a24babe9afecea1f649fd23637dfa7ed7e9f3ac18440220295748e81005231135289fe3a88338dabba55afa1bdb4478691337009d82b68d01","5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b852ae",1e-08],"0x22 0x002008a6665ebfd43b02323423e764e185d98d1587f903b81507dbb69bfc41005efa","HASH160 0x14 0x6f5ecd4b83b77f3c438f5214eff96454934fc5d1 EQUAL","P2SH,WITNESS","OK","P2SH(P2WSH) CHECKMULTISIG with first key uncompressed and signing with the second key"], +[["","304402201e9e6f7deef5b2f21d8223c5189b7d5e82d237c10e97165dd08f547c4e5ce6ed02206796372eb1cc6acb52e13ee2d7f45807780bf96b132cb6697f69434be74b1af901","5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b852ae",1e-08],"","0 0x20 0x08a6665ebfd43b02323423e764e185d98d1587f903b81507dbb69bfc41005efa","P2SH,WITNESS,WITNESS_PUBKEYTYPE","WITNESS_PUBKEYTYPE","P2WSH CHECKMULTISIG with first key uncompressed and signing with the second key"], +[["","3044022045e667f3f0f3147b95597a24babe9afecea1f649fd23637dfa7ed7e9f3ac18440220295748e81005231135289fe3a88338dabba55afa1bdb4478691337009d82b68d01","5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b852ae",1e-08],"0x22 0x002008a6665ebfd43b02323423e764e185d98d1587f903b81507dbb69bfc41005efa","HASH160 0x14 0x6f5ecd4b83b77f3c438f5214eff96454934fc5d1 EQUAL","P2SH,WITNESS,WITNESS_PUBKEYTYPE","WITNESS_PUBKEYTYPE","P2SH(P2WSH) CHECKMULTISIG with first key uncompressed and signing with the second key"], +[["","3044022046f5367a261fd8f8d7de6eb390491344f8ec2501638fb9a1095a0599a21d3f4c02205c1b3b51d20091c5f1020841bbca87b44ebe25405c64e4acf758f2eae8665f8401","5141048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae",1e-08],"","0 0x20 0x230828ed48871f0f362ce9432aa52f620f442cc8d9ce7a8b5e798365595a38bb","P2SH,WITNESS","OK","P2WSH CHECKMULTISIG with second key uncompressed and signing with the first key"], +[["","3044022053e210e4fb1881e6092fd75c3efc5163105599e246ded661c0ee2b5682cc2d6c02203a26b7ada8682a095b84c6d1b881637000b47d761fc837c4cee33555296d63f101","5141048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae",1e-08],"0x22 0x0020230828ed48871f0f362ce9432aa52f620f442cc8d9ce7a8b5e798365595a38bb","HASH160 0x14 0x3478e7019ce61a68148f87549579b704cbe4c393 EQUAL","P2SH,WITNESS","OK","P2SH(P2WSH) CHECKMULTISIG second key uncompressed and signing with the first key"], +[["","3044022046f5367a261fd8f8d7de6eb390491344f8ec2501638fb9a1095a0599a21d3f4c02205c1b3b51d20091c5f1020841bbca87b44ebe25405c64e4acf758f2eae8665f8401","5141048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae",1e-08],"","0 0x20 0x230828ed48871f0f362ce9432aa52f620f442cc8d9ce7a8b5e798365595a38bb","P2SH,WITNESS,WITNESS_PUBKEYTYPE","OK","P2WSH CHECKMULTISIG with second key uncompressed and signing with the first key should pass as the uncompressed key is not used"], +[["","3044022053e210e4fb1881e6092fd75c3efc5163105599e246ded661c0ee2b5682cc2d6c02203a26b7ada8682a095b84c6d1b881637000b47d761fc837c4cee33555296d63f101","5141048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae",1e-08],"0x22 0x0020230828ed48871f0f362ce9432aa52f620f442cc8d9ce7a8b5e798365595a38bb","HASH160 0x14 0x3478e7019ce61a68148f87549579b704cbe4c393 EQUAL","P2SH,WITNESS,WITNESS_PUBKEYTYPE","OK","P2SH(P2WSH) CHECKMULTISIG with second key uncompressed and signing with the first key should pass as the uncompressed key is not used"], +[["","304402206c6d9f5daf85b54af2a93ec38b15ab27f205dbf5c735365ff12451e43613d1f40220736a44be63423ed5ebf53491618b7cc3d8a5093861908da853739c73717938b701","5141048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae",1e-08],"","0 0x20 0x230828ed48871f0f362ce9432aa52f620f442cc8d9ce7a8b5e798365595a38bb","P2SH,WITNESS","OK","P2WSH CHECKMULTISIG with second key uncompressed and signing with the second key"], +[["","30440220687871bc6144012d75baf585bb26ce13997f7d8c626f4d8825b069c3b2d064470220108936fe1c57327764782253e99090b09c203ec400ed35ce9e026ce2ecf842a001","5141048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae",1e-08],"0x22 0x0020230828ed48871f0f362ce9432aa52f620f442cc8d9ce7a8b5e798365595a38bb","HASH160 0x14 0x3478e7019ce61a68148f87549579b704cbe4c393 EQUAL","P2SH,WITNESS","OK","P2SH(P2WSH) CHECKMULTISIG with second key uncompressed and signing with the second key"], +[["","304402206c6d9f5daf85b54af2a93ec38b15ab27f205dbf5c735365ff12451e43613d1f40220736a44be63423ed5ebf53491618b7cc3d8a5093861908da853739c73717938b701","5141048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae",1e-08],"","0 0x20 0x230828ed48871f0f362ce9432aa52f620f442cc8d9ce7a8b5e798365595a38bb","P2SH,WITNESS,WITNESS_PUBKEYTYPE","WITNESS_PUBKEYTYPE","P2WSH CHECKMULTISIG with second key uncompressed and signing with the second key"], +[["","30440220687871bc6144012d75baf585bb26ce13997f7d8c626f4d8825b069c3b2d064470220108936fe1c57327764782253e99090b09c203ec400ed35ce9e026ce2ecf842a001","5141048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae",1e-08],"0x22 0x0020230828ed48871f0f362ce9432aa52f620f442cc8d9ce7a8b5e798365595a38bb","HASH160 0x14 0x3478e7019ce61a68148f87549579b704cbe4c393 EQUAL","P2SH,WITNESS,WITNESS_PUBKEYTYPE","WITNESS_PUBKEYTYPE","P2SH(P2WSH) CHECKMULTISIG with second key uncompressed and signing with the second key"], ["0","CHECKSEQUENCEVERIFY","CHECKSEQUENCEVERIFY","UNSATISFIED_LOCKTIME","CSV fails if stack top bit 1 << 31 is set and the tx version < 2"], -["0x050000000001","CHECKSEQUENCEVERIFY","CHECKSEQUENCEVERIFY","UNSATISFIED_LOCKTIME","CSV fails if stack top bit 1 << 31 is not set, and tx version < 2"]] +["0x050000000001","CHECKSEQUENCEVERIFY","CHECKSEQUENCEVERIFY","UNSATISFIED_LOCKTIME","CSV fails if stack top bit 1 << 31 is not set, and tx version < 2"], +["0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0x09 0x300602010102010101","0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT","DERSIG","OK","BIP66-compliant but not NULLFAIL-compliant"]] diff --git a/tests/script_tests_passing.json b/tests/script_tests_passing.json index 3f839c4..31965e0 100644 --- a/tests/script_tests_passing.json +++ b/tests/script_tests_passing.json @@ -568,6 +568,7 @@ ["0 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501","2 0 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 2 CHECKMULTISIG NOT","STRICTENC","OK","2-of-2 CHECKMULTISIG NOT with the second pubkey invalid, and both signatures validly encoded. Valid pubkey fails, and CHECKMULTISIG exits early, prior to evaluation of second invalid pubkey."], ["0 0 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501","2 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 2 CHECKMULTISIG NOT","STRICTENC","OK","2-of-2 CHECKMULTISIG NOT with both pubkeys valid, but second signature invalid. Valid pubkey fails, and CHECKMULTISIG exits early, prior to evaluation of second invalid signature."], ["0x4a 0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","0 CHECKSIG NOT","","OK","Overly long signature is correctly encoded"], +["0x25 0x30220220000000000000000000000000000000000000000000000000000000000000000000","0 CHECKSIG NOT","","OK","Missing S is correctly encoded"], ["0x27 0x3024021077777777777777777777777777777777020a7777777777777777777777777777777701","0 CHECKSIG NOT","","OK","S with invalid S length is correctly encoded"], ["0x27 0x302403107777777777777777777777777777777702107777777777777777777777777777777701","0 CHECKSIG NOT","","OK","Non-integer R is correctly encoded"], ["0x27 0x302402107777777777777777777777777777777703107777777777777777777777777777777701","0 CHECKSIG NOT","","OK","Non-integer S is correctly encoded"], @@ -967,6 +968,8 @@ ["0 0 0x02 0x0000","CHECKMULTISIGVERIFY 1","MINIMALDATA","UNKNOWN_ERROR"], ["0 0x02 0x0000 0","CHECKMULTISIGVERIFY 1","MINIMALDATA","UNKNOWN_ERROR"], ["0 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501","2 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 0 2 CHECKMULTISIG NOT","STRICTENC","PUBKEYTYPE","2-of-2 CHECKMULTISIG NOT with the first pubkey invalid, and both signatures validly encoded."], +["0 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501 1","2 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 2 CHECKMULTISIG NOT","STRICTENC","SIG_DER","2-of-2 CHECKMULTISIG NOT with both pubkeys valid, but first signature invalid."], +["0 0x47 0x304402205451ce65ad844dbb978b8bdedf5082e33b43cae8279c30f2c74d9e9ee49a94f802203fe95a7ccf74da7a232ee523ef4a53cb4d14bdd16289680cdb97a63819b8f42f01 0x46 0x304402205451ce65ad844dbb978b8bdedf5082e33b43cae8279c30f2c74d9e9ee49a94f802203fe95a7ccf74da7a232ee523ef4a53cb4d14bdd16289680cdb97a63819b8f42f","2 0x21 0x02a673638cb9587cb68ea08dbef685c6f2d2a751a8b3c6f2a7e9a4999e6e4bfaf5 0x21 0x02a673638cb9587cb68ea08dbef685c6f2d2a751a8b3c6f2a7e9a4999e6e4bfaf5 0x21 0x02a673638cb9587cb68ea08dbef685c6f2d2a751a8b3c6f2a7e9a4999e6e4bfaf5 3 CHECKMULTISIG","P2SH,STRICTENC","SIG_DER","2-of-3 with one valid and one invalid signature due to parse error, nSigs > validSigs"], ["0x4a 0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","0 CHECKSIG NOT","DERSIG","SIG_DER","Overly long signature is incorrectly encoded for DERSIG"], ["0x25 0x30220220000000000000000000000000000000000000000000000000000000000000000000","0 CHECKSIG NOT","DERSIG","SIG_DER","Missing S is incorrectly encoded for DERSIG"], ["0x27 0x3024021077777777777777777777777777777777020a7777777777777777777777777777777701","0 CHECKSIG NOT","DERSIG","SIG_DER","S with invalid S length is incorrectly encoded for DERSIG"], @@ -974,14 +977,15 @@ ["0x27 0x302402107777777777777777777777777777777703107777777777777777777777777777777701","0 CHECKSIG NOT","DERSIG","SIG_DER","Non-integer S is incorrectly encoded for DERSIG"], ["0x17 0x3014020002107777777777777777777777777777777701","0 CHECKSIG NOT","DERSIG","SIG_DER","Zero-length R is incorrectly encoded for DERSIG"], ["0x17 0x3014021077777777777777777777777777777777020001","0 CHECKSIG NOT","DERSIG","SIG_DER","Zero-length S is incorrectly encoded for DERSIG"], -[["00",0E-8],"","0 0x206e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d","P2SH,WITNESS","EVAL_FALSE","Invalid witness script"], -[["51",0E-8],"","0 0x206e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d","P2SH,WITNESS","WITNESS_PROGRAM_MISMATCH","Witness script hash mismatch"], -[["00",0E-8],"","0 0x206e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d","","OK","Invalid witness script without WITNESS"], -[["51",0E-8],"","0 0x206e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d","","OK","Witness script hash mismatch without WITNESS"], -[["51",0E-8],"","-1 0x021234","P2SH,WITNESS","WITNESS_UNEXPECTED","OP_1NEGATE does not introduce a witness program"], -[["51",0E-8],"00","1 0x021234","P2SH,WITNESS","WITNESS_MALLEATED","OP_1 does introduce a witness program"], -[["51",0E-8],"00","16 0x021234","P2SH,WITNESS","WITNESS_MALLEATED","OP_16 does introduce a witness program"], -[["51",0E-8],"","NOP 0x021234","P2SH,WITNESS","WITNESS_UNEXPECTED","NOP does not introduce a witness program"], +["0x27 0x302402107777777777777777777777777777777702108777777777777777777777777777777701","0 CHECKSIG NOT","DERSIG","SIG_DER","Negative S is incorrectly encoded for DERSIG"], +[["00",0],"","0 0x206e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d","P2SH,WITNESS","EVAL_FALSE","Invalid witness script"], +[["51",0],"","0 0x206e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d","P2SH,WITNESS","WITNESS_PROGRAM_MISMATCH","Witness script hash mismatch"], +[["00",0],"","0 0x206e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d","","OK","Invalid witness script without WITNESS"], +[["51",0],"","0 0x206e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d","","OK","Witness script hash mismatch without WITNESS"], +[["51",0],"","-1 0x021234","P2SH,WITNESS","WITNESS_UNEXPECTED","OP_1NEGATE does not introduce a witness program"], +[["51",0],"00","1 0x021234","P2SH,WITNESS","WITNESS_MALLEATED","OP_1 does introduce a witness program"], +[["51",0],"00","16 0x021234","P2SH,WITNESS","WITNESS_MALLEATED","OP_16 does introduce a witness program"], +[["51",0],"","NOP 0x021234","P2SH,WITNESS","WITNESS_UNEXPECTED","NOP does not introduce a witness program"], ["0x47 0x304402200a5c6163f07b8d3b013c4d1d6dba25e780b39658d79ba37af7057a3b7f15ffa102201fd9b4eaa9943f734928b99a83592c2e7bf342ea2680f6a2bb705167966b742001","0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG","","OK","P2PK"], ["0x47 0x304402200a5c6163f07b8c3b013c4d1d6dba25e780b39658d79ba37af7057a3b7f15ffa102201fd9b4eaa9943f734928b99a83592c2e7bf342ea2680f6a2bb705167966b742001","0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG","","EVAL_FALSE","P2PK, bad sig"], ["0x47 0x304402206e05a6fe23c59196ffe176c9ddc31e73a9885638f9d1328d47c0c703863b8876022076feb53811aa5b04e0e79f938eb19906cc5e67548bc555a8e8b8b0fc603d840c01 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","DUP HASH160 0x14 0x1018853670f9f3b0582c5b9ee8ce93764ac32b93 EQUALVERIFY CHECKSIG","","OK","P2PKH"], @@ -1000,6 +1004,7 @@ ["0x47 0x304402200060558477337b9022e70534f1fea71a318caf836812465a2509931c5e7c4987022078ec32bd50ac9e03a349ba953dfd9fe1c8d2dd8bdb1d38ddca844d3d5c78c11801","0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG","","OK","P2PK with too much R padding but no DERSIG"], ["0x47 0x304402200060558477337b9022e70534f1fea71a318caf836812465a2509931c5e7c4987022078ec32bd50ac9e03a349ba953dfd9fe1c8d2dd8bdb1d38ddca844d3d5c78c11801","0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG","DERSIG","SIG_DER","P2PK with too much R padding"], ["0x48 0x304502202de8c03fc525285c9c535631019a5f2af7c6454fa9eb392a3756a4917c420edd02210046130bf2baf7cfc065067c8b9e33a066d9c15edcea9feb0ca2d233e3597925b401","0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG","","OK","P2PK with too much S padding but no DERSIG"], +["0x48 0x304502202de8c03fc525285c9c535631019a5f2af7c6454fa9eb392a3756a4917c420edd02210046130bf2baf7cfc065067c8b9e33a066d9c15edcea9feb0ca2d233e3597925b401","0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG","DERSIG","SIG_DER","P2PK with too much S padding"], ["0x47 0x30440220d7a0417c3f6d1a15094d1cf2a3378ca0503eb8a57630953a9e2987e21ddd0a6502207a6266d686c99090920249991d3d42065b6d43eb70187b219c0db82e4f94d1a201","0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG","","OK","P2PK with too little R padding but no DERSIG"], ["0x47 0x30440220d7a0417c3f6d1a15094d1cf2a3378ca0503eb8a57630953a9e2987e21ddd0a6502207a6266d686c99090920249991d3d42065b6d43eb70187b219c0db82e4f94d1a201","0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG","DERSIG","SIG_DER","P2PK with too little R padding"], ["0x47 0x30440220005ece1335e7f757a1a1f476a7fb5bd90964e8a022489f890614a04acfb734c002206c12b8294a6513c7710e8c82d3c23d75cdbfe83200eb7efb495701958501a5d601","0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG NOT","","OK","P2PK NOT with bad sig with too much R padding but no DERSIG"], @@ -1017,7 +1022,9 @@ ["0x09 0x300602010102010101","0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG NOT","DERSIG","OK","BIP66 example 4, with DERSIG, non-null DER-compliant signature"], ["0","0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG NOT","DERSIG,NULLFAIL","OK","BIP66 example 4, with DERSIG and NULLFAIL"], ["0x09 0x300602010102010101","0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG NOT","DERSIG,NULLFAIL","NULLFAIL","BIP66 example 4, with DERSIG and NULLFAIL, non-null DER-compliant signature"], +["1","0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG","","EVAL_FALSE","BIP66 example 5, without DERSIG"], ["1","0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG","DERSIG","SIG_DER","BIP66 example 5, with DERSIG"], +["1","0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG NOT","","OK","BIP66 example 6, without DERSIG"], ["1","0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG NOT","DERSIG","SIG_DER","BIP66 example 6, with DERSIG"], ["0 0x47 0x30440220cae00b1444babfbf6071b0ba8707f6bd373da3df494d6e74119b0430c5db810502205d5231b8c5939c8ff0c82242656d6e06edb073d42af336c99fe8837c36ea39d501 0x47 0x3044022027c2714269ca5aeecc4d70edc88ba5ee0e3da4986e9216028f489ab4f1b8efce022022bd545b4951215267e4c5ceabd4c5350331b2e4a0b6494c56f361fa5a57a1a201","2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG","","OK","BIP66 example 7, without DERSIG"], ["0 0x47 0x30440220cae00b1444babfbf6071b0ba8707f6bd373da3df494d6e74119b0430c5db810502205d5231b8c5939c8ff0c82242656d6e06edb073d42af336c99fe8837c36ea39d501 0x47 0x3044022027c2714269ca5aeecc4d70edc88ba5ee0e3da4986e9216028f489ab4f1b8efce022022bd545b4951215267e4c5ceabd4c5350331b2e4a0b6494c56f361fa5a57a1a201","2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG","DERSIG","SIG_DER","BIP66 example 7, with DERSIG"], @@ -1061,37 +1068,37 @@ ["11 0x47 0x304402202f7505132be14872581f35d74b759212d9da40482653f1ffa3116c3294a4a51702206adbf347a2240ca41c66522b1a22a41693610b76a8e7770645dc721d1635854f01 0x43 0x410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac","HASH160 0x14 0x31edc23bdafda4639e669f89ad6b2318dd79d032 EQUAL","P2SH","OK","P2SH with unnecessary input but no CLEANSTACK"], ["11 0x47 0x304402202f7505132be14872581f35d74b759212d9da40482653f1ffa3116c3294a4a51702206adbf347a2240ca41c66522b1a22a41693610b76a8e7770645dc721d1635854f01 0x43 0x410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac","HASH160 0x14 0x31edc23bdafda4639e669f89ad6b2318dd79d032 EQUAL","CLEANSTACK,P2SH","CLEANSTACK","P2SH with unnecessary input"], ["0x47 0x304402202f7505132be14872581f35d74b759212d9da40482653f1ffa3116c3294a4a51702206adbf347a2240ca41c66522b1a22a41693610b76a8e7770645dc721d1635854f01 0x43 0x410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac","HASH160 0x14 0x31edc23bdafda4639e669f89ad6b2318dd79d032 EQUAL","CLEANSTACK,P2SH","OK","P2SH with CLEANSTACK"], -[["304402200d461c140cfdfcf36b94961db57ae8c18d1cb80e9d95a9e47ac22470c1bf125502201c8dc1cbfef6a3ef90acbbb992ca22fe9466ee6f9d4898eda277a7ac3ab4b25101","410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac",1E-8],"","0 0x20 0xb95237b48faaa69eb078e1170be3b5cbb3fddf16d0a991e14ad274f7b33a4f64","P2SH,WITNESS","OK","Basic P2WSH"], -[["304402201e7216e5ccb3b61d46946ec6cc7e8c4e0117d13ac2fd4b152197e4805191c74202203e9903e33e84d9ee1dd13fb057afb7ccfb47006c23f6a067185efbc9dd780fc501","0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",1E-8],"","0 0x14 0x91b24bf9f5288532960ac687abb035127b1d28a5","P2SH,WITNESS","OK","Basic P2WPKH"], -[["3044022066e02c19a513049d49349cf5311a1b012b7c4fae023795a18ab1d91c23496c22022025e216342c8e07ce8ef51e8daee88f84306a9de66236cab230bb63067ded1ad301","410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac",1E-8],"0x22 0x0020b95237b48faaa69eb078e1170be3b5cbb3fddf16d0a991e14ad274f7b33a4f64","HASH160 0x14 0xf386c2ba255cc56d20cfa6ea8b062f8b59945518 EQUAL","P2SH,WITNESS","OK","Basic P2SH(P2WSH)"], -[["304402200929d11561cd958460371200f82e9cae64c727a495715a31828e27a7ad57b36d0220361732ced04a6f97351ecca21a56d0b8cd4932c1da1f8f569a2b68e5e48aed7801","0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",1E-8],"0x16 0x001491b24bf9f5288532960ac687abb035127b1d28a5","HASH160 0x14 0x17743beb429c55c942d2ec703b98c4d57c2df5c6 EQUAL","P2SH,WITNESS","OK","Basic P2SH(P2WPKH)"], -[["304402202589f0512cb2408fb08ed9bd24f85eb3059744d9e4f2262d0b7f1338cff6e8b902206c0978f449693e0578c71bc543b11079fd0baae700ee5e9a6bee94db490af9fc01","41048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26cafac",0E-8],"","0 0x20 0xac8ebd9e52c17619a381fa4f71aebb696087c6ef17c960fd0587addad99c0610","P2SH,WITNESS","EVAL_FALSE","Basic P2WSH with the wrong key"], -[["304402206ef7fdb2986325d37c6eb1a8bb24aeb46dede112ed8fc76c7d7500b9b83c0d3d02201edc2322c794fe2d6b0bd73ed319e714aa9b86d8891961530d5c9b7156b60d4e01","048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf",0E-8],"","0 0x14 0x7cf9c846cd4882efec4bf07e44ebdad495c94f4b","P2SH,WITNESS","EVAL_FALSE","Basic P2WPKH with the wrong key"], -[["30440220069ea3581afaf8187f63feee1fd2bd1f9c0dc71ea7d6e8a8b07ee2ebcf824bf402201a4fdef4c532eae59223be1eda6a397fc835142d4ddc6c74f4aa85b766a5c16f01","41048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26cafac",0E-8],"0x22 0x0020ac8ebd9e52c17619a381fa4f71aebb696087c6ef17c960fd0587addad99c0610","HASH160 0x14 0x61039a003883787c0d6ebc66d97fdabe8e31449d EQUAL","P2SH,WITNESS","EVAL_FALSE","Basic P2SH(P2WSH) with the wrong key"], -[["304402204209e49457c2358f80d0256bc24535b8754c14d08840fc4be762d6f5a0aed80b02202eaf7d8fc8d62f60c67adcd99295528d0e491ae93c195cec5a67e7a09532a88001","048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf",0E-8],"0x16 0x00147cf9c846cd4882efec4bf07e44ebdad495c94f4b","HASH160 0x14 0x4e0c2aed91315303fc6a1dc4c7bc21c88f75402e EQUAL","P2SH,WITNESS","EVAL_FALSE","Basic P2SH(P2WPKH) with the wrong key"], -[["304402202589f0512cb2408fb08ed9bd24f85eb3059744d9e4f2262d0b7f1338cff6e8b902206c0978f449693e0578c71bc543b11079fd0baae700ee5e9a6bee94db490af9fc01","41048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26cafac",0E-8],"","0 0x20 0xac8ebd9e52c17619a381fa4f71aebb696087c6ef17c960fd0587addad99c0610","P2SH","OK","Basic P2WSH with the wrong key but no WITNESS"], -[["304402206ef7fdb2986325d37c6eb1a8bb24aeb46dede112ed8fc76c7d7500b9b83c0d3d02201edc2322c794fe2d6b0bd73ed319e714aa9b86d8891961530d5c9b7156b60d4e01","048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf",0E-8],"","0 0x14 0x7cf9c846cd4882efec4bf07e44ebdad495c94f4b","P2SH","OK","Basic P2WPKH with the wrong key but no WITNESS"], -[["30440220069ea3581afaf8187f63feee1fd2bd1f9c0dc71ea7d6e8a8b07ee2ebcf824bf402201a4fdef4c532eae59223be1eda6a397fc835142d4ddc6c74f4aa85b766a5c16f01","41048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26cafac",0E-8],"0x22 0x0020ac8ebd9e52c17619a381fa4f71aebb696087c6ef17c960fd0587addad99c0610","HASH160 0x14 0x61039a003883787c0d6ebc66d97fdabe8e31449d EQUAL","P2SH","OK","Basic P2SH(P2WSH) with the wrong key but no WITNESS"], -[["304402204209e49457c2358f80d0256bc24535b8754c14d08840fc4be762d6f5a0aed80b02202eaf7d8fc8d62f60c67adcd99295528d0e491ae93c195cec5a67e7a09532a88001","048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf",0E-8],"0x16 0x00147cf9c846cd4882efec4bf07e44ebdad495c94f4b","HASH160 0x14 0x4e0c2aed91315303fc6a1dc4c7bc21c88f75402e EQUAL","P2SH","OK","Basic P2SH(P2WPKH) with the wrong key but no WITNESS"], -[["3044022066faa86e74e8b30e82691b985b373de4f9e26dc144ec399c4f066aa59308e7c202204712b86f28c32503faa051dbeabff2c238ece861abc36c5e0b40b1139ca222f001","410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac",0E-8],"","0 0x20 0xb95237b48faaa69eb078e1170be3b5cbb3fddf16d0a991e14ad274f7b33a4f64","P2SH,WITNESS","EVAL_FALSE","Basic P2WSH with wrong value"], -[["304402203b3389b87448d7dfdb5e82fb854fcf92d7925f9938ea5444e36abef02c3d6a9602202410bc3265049abb07fd2e252c65ab7034d95c9d5acccabe9fadbdc63a52712601","0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",0E-8],"","0 0x14 0x91b24bf9f5288532960ac687abb035127b1d28a5","P2SH,WITNESS","EVAL_FALSE","Basic P2WPKH with wrong value"], -[["3044022000a30c4cfc10e4387be528613575434826ad3c15587475e0df8ce3b1746aa210022008149265e4f8e9dafe1f3ea50d90cb425e9e40ea7ebdd383069a7cfa2b77004701","410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac",0E-8],"0x22 0x0020b95237b48faaa69eb078e1170be3b5cbb3fddf16d0a991e14ad274f7b33a4f64","HASH160 0x14 0xf386c2ba255cc56d20cfa6ea8b062f8b59945518 EQUAL","P2SH,WITNESS","EVAL_FALSE","Basic P2SH(P2WSH) with wrong value"], -[["304402204fc3a2cd61a47913f2a5f9107d0ad4a504c7b31ee2d6b3b2f38c2b10ee031e940220055d58b7c3c281aaa381d8f486ac0f3e361939acfd568046cb6a311cdfa974cf01","0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",0E-8],"0x16 0x001491b24bf9f5288532960ac687abb035127b1d28a5","HASH160 0x14 0x17743beb429c55c942d2ec703b98c4d57c2df5c6 EQUAL","P2SH,WITNESS","EVAL_FALSE","Basic P2SH(P2WPKH) with wrong value"], -[["3044022064100ca0e2a33332136775a86cd83d0230e58b9aebb889c5ac952abff79a46ef02205f1bf900e022039ad3091bdaf27ac2aef3eae9ed9f190d821d3e508405b9513101","0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",0E-8],"","0 0x1f 0xb34b78da162751647974d5cb7410aa428ad339dbf7d1e16e833f68a0cbf1c3","P2SH,WITNESS","WITNESS_PROGRAM_WRONG_LENGTH","P2WPKH with wrong witness program length"], +[["304402200d461c140cfdfcf36b94961db57ae8c18d1cb80e9d95a9e47ac22470c1bf125502201c8dc1cbfef6a3ef90acbbb992ca22fe9466ee6f9d4898eda277a7ac3ab4b25101","410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac",1e-08],"","0 0x20 0xb95237b48faaa69eb078e1170be3b5cbb3fddf16d0a991e14ad274f7b33a4f64","P2SH,WITNESS","OK","Basic P2WSH"], +[["304402201e7216e5ccb3b61d46946ec6cc7e8c4e0117d13ac2fd4b152197e4805191c74202203e9903e33e84d9ee1dd13fb057afb7ccfb47006c23f6a067185efbc9dd780fc501","0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",1e-08],"","0 0x14 0x91b24bf9f5288532960ac687abb035127b1d28a5","P2SH,WITNESS","OK","Basic P2WPKH"], +[["3044022066e02c19a513049d49349cf5311a1b012b7c4fae023795a18ab1d91c23496c22022025e216342c8e07ce8ef51e8daee88f84306a9de66236cab230bb63067ded1ad301","410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac",1e-08],"0x22 0x0020b95237b48faaa69eb078e1170be3b5cbb3fddf16d0a991e14ad274f7b33a4f64","HASH160 0x14 0xf386c2ba255cc56d20cfa6ea8b062f8b59945518 EQUAL","P2SH,WITNESS","OK","Basic P2SH(P2WSH)"], +[["304402200929d11561cd958460371200f82e9cae64c727a495715a31828e27a7ad57b36d0220361732ced04a6f97351ecca21a56d0b8cd4932c1da1f8f569a2b68e5e48aed7801","0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",1e-08],"0x16 0x001491b24bf9f5288532960ac687abb035127b1d28a5","HASH160 0x14 0x17743beb429c55c942d2ec703b98c4d57c2df5c6 EQUAL","P2SH,WITNESS","OK","Basic P2SH(P2WPKH)"], +[["304402202589f0512cb2408fb08ed9bd24f85eb3059744d9e4f2262d0b7f1338cff6e8b902206c0978f449693e0578c71bc543b11079fd0baae700ee5e9a6bee94db490af9fc01","41048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26cafac",0],"","0 0x20 0xac8ebd9e52c17619a381fa4f71aebb696087c6ef17c960fd0587addad99c0610","P2SH,WITNESS","EVAL_FALSE","Basic P2WSH with the wrong key"], +[["304402206ef7fdb2986325d37c6eb1a8bb24aeb46dede112ed8fc76c7d7500b9b83c0d3d02201edc2322c794fe2d6b0bd73ed319e714aa9b86d8891961530d5c9b7156b60d4e01","048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf",0],"","0 0x14 0x7cf9c846cd4882efec4bf07e44ebdad495c94f4b","P2SH,WITNESS","EVAL_FALSE","Basic P2WPKH with the wrong key"], +[["30440220069ea3581afaf8187f63feee1fd2bd1f9c0dc71ea7d6e8a8b07ee2ebcf824bf402201a4fdef4c532eae59223be1eda6a397fc835142d4ddc6c74f4aa85b766a5c16f01","41048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26cafac",0],"0x22 0x0020ac8ebd9e52c17619a381fa4f71aebb696087c6ef17c960fd0587addad99c0610","HASH160 0x14 0x61039a003883787c0d6ebc66d97fdabe8e31449d EQUAL","P2SH,WITNESS","EVAL_FALSE","Basic P2SH(P2WSH) with the wrong key"], +[["304402204209e49457c2358f80d0256bc24535b8754c14d08840fc4be762d6f5a0aed80b02202eaf7d8fc8d62f60c67adcd99295528d0e491ae93c195cec5a67e7a09532a88001","048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf",0],"0x16 0x00147cf9c846cd4882efec4bf07e44ebdad495c94f4b","HASH160 0x14 0x4e0c2aed91315303fc6a1dc4c7bc21c88f75402e EQUAL","P2SH,WITNESS","EVAL_FALSE","Basic P2SH(P2WPKH) with the wrong key"], +[["304402202589f0512cb2408fb08ed9bd24f85eb3059744d9e4f2262d0b7f1338cff6e8b902206c0978f449693e0578c71bc543b11079fd0baae700ee5e9a6bee94db490af9fc01","41048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26cafac",0],"","0 0x20 0xac8ebd9e52c17619a381fa4f71aebb696087c6ef17c960fd0587addad99c0610","P2SH","OK","Basic P2WSH with the wrong key but no WITNESS"], +[["304402206ef7fdb2986325d37c6eb1a8bb24aeb46dede112ed8fc76c7d7500b9b83c0d3d02201edc2322c794fe2d6b0bd73ed319e714aa9b86d8891961530d5c9b7156b60d4e01","048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf",0],"","0 0x14 0x7cf9c846cd4882efec4bf07e44ebdad495c94f4b","P2SH","OK","Basic P2WPKH with the wrong key but no WITNESS"], +[["30440220069ea3581afaf8187f63feee1fd2bd1f9c0dc71ea7d6e8a8b07ee2ebcf824bf402201a4fdef4c532eae59223be1eda6a397fc835142d4ddc6c74f4aa85b766a5c16f01","41048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26cafac",0],"0x22 0x0020ac8ebd9e52c17619a381fa4f71aebb696087c6ef17c960fd0587addad99c0610","HASH160 0x14 0x61039a003883787c0d6ebc66d97fdabe8e31449d EQUAL","P2SH","OK","Basic P2SH(P2WSH) with the wrong key but no WITNESS"], +[["304402204209e49457c2358f80d0256bc24535b8754c14d08840fc4be762d6f5a0aed80b02202eaf7d8fc8d62f60c67adcd99295528d0e491ae93c195cec5a67e7a09532a88001","048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf",0],"0x16 0x00147cf9c846cd4882efec4bf07e44ebdad495c94f4b","HASH160 0x14 0x4e0c2aed91315303fc6a1dc4c7bc21c88f75402e EQUAL","P2SH","OK","Basic P2SH(P2WPKH) with the wrong key but no WITNESS"], +[["3044022066faa86e74e8b30e82691b985b373de4f9e26dc144ec399c4f066aa59308e7c202204712b86f28c32503faa051dbeabff2c238ece861abc36c5e0b40b1139ca222f001","410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac",0],"","0 0x20 0xb95237b48faaa69eb078e1170be3b5cbb3fddf16d0a991e14ad274f7b33a4f64","P2SH,WITNESS","EVAL_FALSE","Basic P2WSH with wrong value"], +[["304402203b3389b87448d7dfdb5e82fb854fcf92d7925f9938ea5444e36abef02c3d6a9602202410bc3265049abb07fd2e252c65ab7034d95c9d5acccabe9fadbdc63a52712601","0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",0],"","0 0x14 0x91b24bf9f5288532960ac687abb035127b1d28a5","P2SH,WITNESS","EVAL_FALSE","Basic P2WPKH with wrong value"], +[["3044022000a30c4cfc10e4387be528613575434826ad3c15587475e0df8ce3b1746aa210022008149265e4f8e9dafe1f3ea50d90cb425e9e40ea7ebdd383069a7cfa2b77004701","410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac",0],"0x22 0x0020b95237b48faaa69eb078e1170be3b5cbb3fddf16d0a991e14ad274f7b33a4f64","HASH160 0x14 0xf386c2ba255cc56d20cfa6ea8b062f8b59945518 EQUAL","P2SH,WITNESS","EVAL_FALSE","Basic P2SH(P2WSH) with wrong value"], +[["304402204fc3a2cd61a47913f2a5f9107d0ad4a504c7b31ee2d6b3b2f38c2b10ee031e940220055d58b7c3c281aaa381d8f486ac0f3e361939acfd568046cb6a311cdfa974cf01","0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",0],"0x16 0x001491b24bf9f5288532960ac687abb035127b1d28a5","HASH160 0x14 0x17743beb429c55c942d2ec703b98c4d57c2df5c6 EQUAL","P2SH,WITNESS","EVAL_FALSE","Basic P2SH(P2WPKH) with wrong value"], +[["3044022064100ca0e2a33332136775a86cd83d0230e58b9aebb889c5ac952abff79a46ef02205f1bf900e022039ad3091bdaf27ac2aef3eae9ed9f190d821d3e508405b9513101","0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",0],"","0 0x1f 0xb34b78da162751647974d5cb7410aa428ad339dbf7d1e16e833f68a0cbf1c3","P2SH,WITNESS","WITNESS_PROGRAM_WRONG_LENGTH","P2WPKH with wrong witness program length"], ["","0 0x20 0xb95237b48faaa69eb078e1170be3b5cbb3fddf16d0a991e14ad274f7b33a4f64","P2SH,WITNESS","WITNESS_PROGRAM_WITNESS_EMPTY","P2WSH with empty witness"], -[["3044022039105b995a5f448639a997a5c90fda06f50b49df30c3bdb6663217bf79323db002206fecd54269dec569fcc517178880eb58bb40f381a282bb75766ff3637d5f4b4301","400479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac",0E-8],"","0 0x20 0xb95237b48faaa69eb078e1170be3b5cbb3fddf16d0a991e14ad274f7b33a4f64","P2SH,WITNESS","WITNESS_PROGRAM_MISMATCH","P2WSH with witness program mismatch"], -[["304402201a96950593cb0af32d080b0f193517f4559241a8ebd1e95e414533ad64a3f423022047f4f6d3095c23235bdff3aeff480d0529c027a3f093cb265b7cbf148553b85101","0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8","",0E-8],"","0 0x14 0x91b24bf9f5288532960ac687abb035127b1d28a5","P2SH,WITNESS","WITNESS_PROGRAM_MISMATCH","P2WPKH with witness program mismatch"], -[["304402201a96950593cb0af32d080b0f193517f4559241a8ebd1e95e414533ad64a3f423022047f4f6d3095c23235bdff3aeff480d0529c027a3f093cb265b7cbf148553b85101","0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",0E-8],"11","0 0x14 0x91b24bf9f5288532960ac687abb035127b1d28a5","P2SH,WITNESS","WITNESS_MALLEATED","P2WPKH with non-empty scriptSig"], -[["304402204209e49457c2358f80d0256bc24535b8754c14d08840fc4be762d6f5a0aed80b02202eaf7d8fc8d62f60c67adcd99295528d0e491ae93c195cec5a67e7a09532a88001","048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf",0E-8],"11 0x16 0x00147cf9c846cd4882efec4bf07e44ebdad495c94f4b","HASH160 0x14 0x4e0c2aed91315303fc6a1dc4c7bc21c88f75402e EQUAL","P2SH,WITNESS","WITNESS_MALLEATED_P2SH","P2SH(P2WPKH) with superfluous push in scriptSig"], -[["",0E-8],"0x47 0x304402200a5c6163f07b8d3b013c4d1d6dba25e780b39658d79ba37af7057a3b7f15ffa102201fd9b4eaa9943f734928b99a83592c2e7bf342ea2680f6a2bb705167966b742001","0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG","P2SH,WITNESS","WITNESS_UNEXPECTED","P2PK with witness"], -[["304402204256146fcf8e73b0fd817ffa2a4e408ff0418ff987dd08a4f485b62546f6c43c02203f3c8c3e2febc051e1222867f5f9d0eaf039d6792911c10940aa3cc74123378e01","210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798ac",1E-8],"","0 0x20 0x1863143c14c5166804bd19203356da136c985678cd4d27a1b8c6329604903262","P2SH,WITNESS,WITNESS_PUBKEYTYPE","OK","Basic P2WSH with compressed key"], -[["304402204edf27486f11432466b744df533e1acac727e0c83e5f912eb289a3df5bf8035f022075809fdd876ede40ad21667eba8b7e96394938f9c9c50f11b6a1280cce2cea8601","0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",1E-8],"","0 0x14 0x751e76e8199196d454941c45d1b3a323f1433bd6","P2SH,WITNESS,WITNESS_PUBKEYTYPE","OK","Basic P2WPKH with compressed key"], -[["304402203a549090cc46bce1e5e95c4922ea2c12747988e0207b04c42f81cdbe87bb1539022050f57a245b875fd5119c419aaf050bcdf41384f0765f04b809e5bced1fe7093d01","210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798ac",1E-8],"0x22 0x00201863143c14c5166804bd19203356da136c985678cd4d27a1b8c6329604903262","HASH160 0x14 0xe4300531190587e3880d4c3004f5355d88ff928d EQUAL","P2SH,WITNESS,WITNESS_PUBKEYTYPE","OK","Basic P2SH(P2WSH) with compressed key"], -[["304402201bc0d53046827f4a35a3166e33e3b3366c4085540dc383b95d21ed2ab11e368a0220333e78c6231214f5f8e59621e15d7eeab0d4e4d0796437e00bfbd2680c5f9c1701","0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",1E-8],"0x16 0x0014751e76e8199196d454941c45d1b3a323f1433bd6","HASH160 0x14 0xbcfeb728b584253d5f3f70bcb780e9ef218a68f4 EQUAL","P2SH,WITNESS,WITNESS_PUBKEYTYPE","OK","Basic P2SH(P2WPKH) with compressed key"], -[["304402200d461c140cfdfcf36b94961db57ae8c18d1cb80e9d95a9e47ac22470c1bf125502201c8dc1cbfef6a3ef90acbbb992ca22fe9466ee6f9d4898eda277a7ac3ab4b25101","410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac",1E-8],"","0 0x20 0xb95237b48faaa69eb078e1170be3b5cbb3fddf16d0a991e14ad274f7b33a4f64","P2SH,WITNESS,WITNESS_PUBKEYTYPE","WITNESS_PUBKEYTYPE","Basic P2WSH"], -[["304402201e7216e5ccb3b61d46946ec6cc7e8c4e0117d13ac2fd4b152197e4805191c74202203e9903e33e84d9ee1dd13fb057afb7ccfb47006c23f6a067185efbc9dd780fc501","0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",1E-8],"","0 0x14 0x91b24bf9f5288532960ac687abb035127b1d28a5","P2SH,WITNESS,WITNESS_PUBKEYTYPE","WITNESS_PUBKEYTYPE","Basic P2WPKH"], -[["3044022066e02c19a513049d49349cf5311a1b012b7c4fae023795a18ab1d91c23496c22022025e216342c8e07ce8ef51e8daee88f84306a9de66236cab230bb63067ded1ad301","410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac",1E-8],"0x22 0x0020b95237b48faaa69eb078e1170be3b5cbb3fddf16d0a991e14ad274f7b33a4f64","HASH160 0x14 0xf386c2ba255cc56d20cfa6ea8b062f8b59945518 EQUAL","P2SH,WITNESS,WITNESS_PUBKEYTYPE","WITNESS_PUBKEYTYPE","Basic P2SH(P2WSH)"], -[["304402200929d11561cd958460371200f82e9cae64c727a495715a31828e27a7ad57b36d0220361732ced04a6f97351ecca21a56d0b8cd4932c1da1f8f569a2b68e5e48aed7801","0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",1E-8],"0x16 0x001491b24bf9f5288532960ac687abb035127b1d28a5","HASH160 0x14 0x17743beb429c55c942d2ec703b98c4d57c2df5c6 EQUAL","P2SH,WITNESS,WITNESS_PUBKEYTYPE","WITNESS_PUBKEYTYPE","Basic P2SH(P2WPKH)"], +[["3044022039105b995a5f448639a997a5c90fda06f50b49df30c3bdb6663217bf79323db002206fecd54269dec569fcc517178880eb58bb40f381a282bb75766ff3637d5f4b4301","400479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac",0],"","0 0x20 0xb95237b48faaa69eb078e1170be3b5cbb3fddf16d0a991e14ad274f7b33a4f64","P2SH,WITNESS","WITNESS_PROGRAM_MISMATCH","P2WSH with witness program mismatch"], +[["304402201a96950593cb0af32d080b0f193517f4559241a8ebd1e95e414533ad64a3f423022047f4f6d3095c23235bdff3aeff480d0529c027a3f093cb265b7cbf148553b85101","0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8","",0],"","0 0x14 0x91b24bf9f5288532960ac687abb035127b1d28a5","P2SH,WITNESS","WITNESS_PROGRAM_MISMATCH","P2WPKH with witness program mismatch"], +[["304402201a96950593cb0af32d080b0f193517f4559241a8ebd1e95e414533ad64a3f423022047f4f6d3095c23235bdff3aeff480d0529c027a3f093cb265b7cbf148553b85101","0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",0],"11","0 0x14 0x91b24bf9f5288532960ac687abb035127b1d28a5","P2SH,WITNESS","WITNESS_MALLEATED","P2WPKH with non-empty scriptSig"], +[["304402204209e49457c2358f80d0256bc24535b8754c14d08840fc4be762d6f5a0aed80b02202eaf7d8fc8d62f60c67adcd99295528d0e491ae93c195cec5a67e7a09532a88001","048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf",0],"11 0x16 0x00147cf9c846cd4882efec4bf07e44ebdad495c94f4b","HASH160 0x14 0x4e0c2aed91315303fc6a1dc4c7bc21c88f75402e EQUAL","P2SH,WITNESS","WITNESS_MALLEATED_P2SH","P2SH(P2WPKH) with superfluous push in scriptSig"], +[["",0],"0x47 0x304402200a5c6163f07b8d3b013c4d1d6dba25e780b39658d79ba37af7057a3b7f15ffa102201fd9b4eaa9943f734928b99a83592c2e7bf342ea2680f6a2bb705167966b742001","0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG","P2SH,WITNESS","WITNESS_UNEXPECTED","P2PK with witness"], +[["304402204256146fcf8e73b0fd817ffa2a4e408ff0418ff987dd08a4f485b62546f6c43c02203f3c8c3e2febc051e1222867f5f9d0eaf039d6792911c10940aa3cc74123378e01","210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798ac",1e-08],"","0 0x20 0x1863143c14c5166804bd19203356da136c985678cd4d27a1b8c6329604903262","P2SH,WITNESS,WITNESS_PUBKEYTYPE","OK","Basic P2WSH with compressed key"], +[["304402204edf27486f11432466b744df533e1acac727e0c83e5f912eb289a3df5bf8035f022075809fdd876ede40ad21667eba8b7e96394938f9c9c50f11b6a1280cce2cea8601","0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",1e-08],"","0 0x14 0x751e76e8199196d454941c45d1b3a323f1433bd6","P2SH,WITNESS,WITNESS_PUBKEYTYPE","OK","Basic P2WPKH with compressed key"], +[["304402203a549090cc46bce1e5e95c4922ea2c12747988e0207b04c42f81cdbe87bb1539022050f57a245b875fd5119c419aaf050bcdf41384f0765f04b809e5bced1fe7093d01","210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798ac",1e-08],"0x22 0x00201863143c14c5166804bd19203356da136c985678cd4d27a1b8c6329604903262","HASH160 0x14 0xe4300531190587e3880d4c3004f5355d88ff928d EQUAL","P2SH,WITNESS,WITNESS_PUBKEYTYPE","OK","Basic P2SH(P2WSH) with compressed key"], +[["304402201bc0d53046827f4a35a3166e33e3b3366c4085540dc383b95d21ed2ab11e368a0220333e78c6231214f5f8e59621e15d7eeab0d4e4d0796437e00bfbd2680c5f9c1701","0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",1e-08],"0x16 0x0014751e76e8199196d454941c45d1b3a323f1433bd6","HASH160 0x14 0xbcfeb728b584253d5f3f70bcb780e9ef218a68f4 EQUAL","P2SH,WITNESS,WITNESS_PUBKEYTYPE","OK","Basic P2SH(P2WPKH) with compressed key"], +[["304402200d461c140cfdfcf36b94961db57ae8c18d1cb80e9d95a9e47ac22470c1bf125502201c8dc1cbfef6a3ef90acbbb992ca22fe9466ee6f9d4898eda277a7ac3ab4b25101","410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac",1e-08],"","0 0x20 0xb95237b48faaa69eb078e1170be3b5cbb3fddf16d0a991e14ad274f7b33a4f64","P2SH,WITNESS,WITNESS_PUBKEYTYPE","WITNESS_PUBKEYTYPE","Basic P2WSH"], +[["304402201e7216e5ccb3b61d46946ec6cc7e8c4e0117d13ac2fd4b152197e4805191c74202203e9903e33e84d9ee1dd13fb057afb7ccfb47006c23f6a067185efbc9dd780fc501","0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",1e-08],"","0 0x14 0x91b24bf9f5288532960ac687abb035127b1d28a5","P2SH,WITNESS,WITNESS_PUBKEYTYPE","WITNESS_PUBKEYTYPE","Basic P2WPKH"], +[["3044022066e02c19a513049d49349cf5311a1b012b7c4fae023795a18ab1d91c23496c22022025e216342c8e07ce8ef51e8daee88f84306a9de66236cab230bb63067ded1ad301","410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac",1e-08],"0x22 0x0020b95237b48faaa69eb078e1170be3b5cbb3fddf16d0a991e14ad274f7b33a4f64","HASH160 0x14 0xf386c2ba255cc56d20cfa6ea8b062f8b59945518 EQUAL","P2SH,WITNESS,WITNESS_PUBKEYTYPE","WITNESS_PUBKEYTYPE","Basic P2SH(P2WSH)"], +[["304402200929d11561cd958460371200f82e9cae64c727a495715a31828e27a7ad57b36d0220361732ced04a6f97351ecca21a56d0b8cd4932c1da1f8f569a2b68e5e48aed7801","0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",1e-08],"0x16 0x001491b24bf9f5288532960ac687abb035127b1d28a5","HASH160 0x14 0x17743beb429c55c942d2ec703b98c4d57c2df5c6 EQUAL","P2SH,WITNESS,WITNESS_PUBKEYTYPE","WITNESS_PUBKEYTYPE","Basic P2SH(P2WPKH)"], ["","CHECKSEQUENCEVERIFY","CHECKSEQUENCEVERIFY","INVALID_STACK_OPERATION","CSV automatically fails on an empty stack"], ["-1","CHECKSEQUENCEVERIFY","CHECKSEQUENCEVERIFY","NEGATIVE_LOCKTIME","CSV automatically fails if stack top is negative"], ["0x0100","CHECKSEQUENCEVERIFY","CHECKSEQUENCEVERIFY,MINIMALDATA","UNKNOWN_ERROR","CSV fails if stack top is not minimally encoded"], @@ -1117,59 +1124,58 @@ ["0 0x03 0x645168","HASH160 0x14 0x0c3f8fe3d6ca266e76311ecda544c67d15fdd5b0 EQUAL","P2SH,WITNESS,MINIMALIF","OK"], ["0x01 0x00 0x03 0x645168","HASH160 0x14 0x0c3f8fe3d6ca266e76311ecda544c67d15fdd5b0 EQUAL","P2SH,WITNESS,MINIMALIF","OK"], ["0x03 0x645168","HASH160 0x14 0x0c3f8fe3d6ca266e76311ecda544c67d15fdd5b0 EQUAL","P2SH,WITNESS,MINIMALIF","UNBALANCED_CONDITIONAL"], -[["01","635168",1E-8],"","0 0x20 0xc7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","P2SH,WITNESS","OK"], -[["02","635168",1E-8],"","0 0x20 0xc7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","P2SH,WITNESS","OK"], -[["0100","635168",1E-8],"","0 0x20 0xc7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","P2SH,WITNESS","OK"], -[["","635168",1E-8],"","0 0x20 0xc7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","P2SH,WITNESS","CLEANSTACK"], -[["00","635168",1E-8],"","0 0x20 0xc7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","P2SH,WITNESS","CLEANSTACK"], -[["01","635168",1E-8],"","0 0x20 0xc7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","P2SH,WITNESS,MINIMALIF","OK"], -[["02","635168",1E-8],"","0 0x20 0xc7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","P2SH,WITNESS,MINIMALIF","MINIMALIF"], -[["0100","635168",1E-8],"","0 0x20 0xc7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","P2SH,WITNESS,MINIMALIF","MINIMALIF"], -[["","635168",1E-8],"","0 0x20 0xc7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","P2SH,WITNESS,MINIMALIF","CLEANSTACK"], -[["00","635168",1E-8],"","0 0x20 0xc7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","P2SH,WITNESS,MINIMALIF","MINIMALIF"], -[["635168",1E-8],"","0 0x20 0xc7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","P2SH,WITNESS","UNBALANCED_CONDITIONAL"], -[["635168",1E-8],"","0 0x20 0xc7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","P2SH,WITNESS,MINIMALIF","UNBALANCED_CONDITIONAL"], -[["01","645168",1E-8],"","0 0x20 0xf913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","P2SH,WITNESS","CLEANSTACK"], -[["02","645168",1E-8],"","0 0x20 0xf913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","P2SH,WITNESS","CLEANSTACK"], -[["0100","645168",1E-8],"","0 0x20 0xf913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","P2SH,WITNESS","CLEANSTACK"], -[["","645168",1E-8],"","0 0x20 0xf913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","P2SH,WITNESS","OK"], -[["00","645168",1E-8],"","0 0x20 0xf913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","P2SH,WITNESS","OK"], -[["01","645168",1E-8],"","0 0x20 0xf913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","P2SH,WITNESS,MINIMALIF","CLEANSTACK"], -[["02","645168",1E-8],"","0 0x20 0xf913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","P2SH,WITNESS,MINIMALIF","MINIMALIF"], -[["0100","645168",1E-8],"","0 0x20 0xf913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","P2SH,WITNESS,MINIMALIF","MINIMALIF"], -[["","645168",1E-8],"","0 0x20 0xf913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","P2SH,WITNESS,MINIMALIF","OK"], -[["00","645168",1E-8],"","0 0x20 0xf913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","P2SH,WITNESS,MINIMALIF","MINIMALIF"], -[["645168",1E-8],"","0 0x20 0xf913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","P2SH,WITNESS","UNBALANCED_CONDITIONAL"], -[["645168",1E-8],"","0 0x20 0xf913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","P2SH,WITNESS,MINIMALIF","UNBALANCED_CONDITIONAL"], -[["01","635168",1E-8],"0x22 0x0020c7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","HASH160 0x14 0x9b27ee6d9010c21bf837b334d043be5d150e7ba7 EQUAL","P2SH,WITNESS","OK"], -[["02","635168",1E-8],"0x22 0x0020c7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","HASH160 0x14 0x9b27ee6d9010c21bf837b334d043be5d150e7ba7 EQUAL","P2SH,WITNESS","OK"], -[["0100","635168",1E-8],"0x22 0x0020c7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","HASH160 0x14 0x9b27ee6d9010c21bf837b334d043be5d150e7ba7 EQUAL","P2SH,WITNESS","OK"], -[["","635168",1E-8],"0x22 0x0020c7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","HASH160 0x14 0x9b27ee6d9010c21bf837b334d043be5d150e7ba7 EQUAL","P2SH,WITNESS","CLEANSTACK"], -[["00","635168",1E-8],"0x22 0x0020c7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","HASH160 0x14 0x9b27ee6d9010c21bf837b334d043be5d150e7ba7 EQUAL","P2SH,WITNESS","CLEANSTACK"], -[["01","635168",1E-8],"0x22 0x0020c7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","HASH160 0x14 0x9b27ee6d9010c21bf837b334d043be5d150e7ba7 EQUAL","P2SH,WITNESS,MINIMALIF","OK"], -[["02","635168",1E-8],"0x22 0x0020c7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","HASH160 0x14 0x9b27ee6d9010c21bf837b334d043be5d150e7ba7 EQUAL","P2SH,WITNESS,MINIMALIF","MINIMALIF"], -[["0100","635168",1E-8],"0x22 0x0020c7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","HASH160 0x14 0x9b27ee6d9010c21bf837b334d043be5d150e7ba7 EQUAL","P2SH,WITNESS,MINIMALIF","MINIMALIF"], -[["","635168",1E-8],"0x22 0x0020c7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","HASH160 0x14 0x9b27ee6d9010c21bf837b334d043be5d150e7ba7 EQUAL","P2SH,WITNESS,MINIMALIF","CLEANSTACK"], -[["00","635168",1E-8],"0x22 0x0020c7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","HASH160 0x14 0x9b27ee6d9010c21bf837b334d043be5d150e7ba7 EQUAL","P2SH,WITNESS,MINIMALIF","MINIMALIF"], -[["635168",1E-8],"0x22 0x0020c7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","HASH160 0x14 0x9b27ee6d9010c21bf837b334d043be5d150e7ba7 EQUAL","P2SH,WITNESS","UNBALANCED_CONDITIONAL"], -[["635168",1E-8],"0x22 0x0020c7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","HASH160 0x14 0x9b27ee6d9010c21bf837b334d043be5d150e7ba7 EQUAL","P2SH,WITNESS,MINIMALIF","UNBALANCED_CONDITIONAL"], -[["01","645168",1E-8],"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL","P2SH,WITNESS","CLEANSTACK"], -[["02","645168",1E-8],"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL","P2SH,WITNESS","CLEANSTACK"], -[["0100","645168",1E-8],"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL","P2SH,WITNESS","CLEANSTACK"], -[["","645168",1E-8],"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL","P2SH,WITNESS","OK"], -[["00","645168",1E-8],"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL","P2SH,WITNESS","OK"], -[["01","645168",1E-8],"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL","P2SH,WITNESS,MINIMALIF","CLEANSTACK"], -[["02","645168",1E-8],"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL","P2SH,WITNESS,MINIMALIF","MINIMALIF"], -[["0100","645168",1E-8],"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL","P2SH,WITNESS,MINIMALIF","MINIMALIF"], -[["","645168",1E-8],"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL","P2SH,WITNESS,MINIMALIF","OK"], -[["00","645168",1E-8],"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL","P2SH,WITNESS,MINIMALIF","MINIMALIF"], -[["645168",1E-8],"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL","P2SH,WITNESS","UNBALANCED_CONDITIONAL"], -[["645168",1E-8],"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL","P2SH,WITNESS,MINIMALIF","UNBALANCED_CONDITIONAL"], +[["01","635168",1e-08],"","0 0x20 0xc7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","P2SH,WITNESS","OK"], +[["02","635168",1e-08],"","0 0x20 0xc7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","P2SH,WITNESS","OK"], +[["0100","635168",1e-08],"","0 0x20 0xc7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","P2SH,WITNESS","OK"], +[["","635168",1e-08],"","0 0x20 0xc7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","P2SH,WITNESS","CLEANSTACK"], +[["00","635168",1e-08],"","0 0x20 0xc7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","P2SH,WITNESS","CLEANSTACK"], +[["01","635168",1e-08],"","0 0x20 0xc7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","P2SH,WITNESS,MINIMALIF","OK"], +[["02","635168",1e-08],"","0 0x20 0xc7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","P2SH,WITNESS,MINIMALIF","MINIMALIF"], +[["0100","635168",1e-08],"","0 0x20 0xc7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","P2SH,WITNESS,MINIMALIF","MINIMALIF"], +[["","635168",1e-08],"","0 0x20 0xc7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","P2SH,WITNESS,MINIMALIF","CLEANSTACK"], +[["00","635168",1e-08],"","0 0x20 0xc7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","P2SH,WITNESS,MINIMALIF","MINIMALIF"], +[["635168",1e-08],"","0 0x20 0xc7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","P2SH,WITNESS","UNBALANCED_CONDITIONAL"], +[["635168",1e-08],"","0 0x20 0xc7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","P2SH,WITNESS,MINIMALIF","UNBALANCED_CONDITIONAL"], +[["01","645168",1e-08],"","0 0x20 0xf913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","P2SH,WITNESS","CLEANSTACK"], +[["02","645168",1e-08],"","0 0x20 0xf913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","P2SH,WITNESS","CLEANSTACK"], +[["0100","645168",1e-08],"","0 0x20 0xf913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","P2SH,WITNESS","CLEANSTACK"], +[["","645168",1e-08],"","0 0x20 0xf913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","P2SH,WITNESS","OK"], +[["00","645168",1e-08],"","0 0x20 0xf913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","P2SH,WITNESS","OK"], +[["01","645168",1e-08],"","0 0x20 0xf913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","P2SH,WITNESS,MINIMALIF","CLEANSTACK"], +[["02","645168",1e-08],"","0 0x20 0xf913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","P2SH,WITNESS,MINIMALIF","MINIMALIF"], +[["0100","645168",1e-08],"","0 0x20 0xf913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","P2SH,WITNESS,MINIMALIF","MINIMALIF"], +[["","645168",1e-08],"","0 0x20 0xf913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","P2SH,WITNESS,MINIMALIF","OK"], +[["00","645168",1e-08],"","0 0x20 0xf913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","P2SH,WITNESS,MINIMALIF","MINIMALIF"], +[["645168",1e-08],"","0 0x20 0xf913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","P2SH,WITNESS","UNBALANCED_CONDITIONAL"], +[["645168",1e-08],"","0 0x20 0xf913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","P2SH,WITNESS,MINIMALIF","UNBALANCED_CONDITIONAL"], +[["01","635168",1e-08],"0x22 0x0020c7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","HASH160 0x14 0x9b27ee6d9010c21bf837b334d043be5d150e7ba7 EQUAL","P2SH,WITNESS","OK"], +[["02","635168",1e-08],"0x22 0x0020c7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","HASH160 0x14 0x9b27ee6d9010c21bf837b334d043be5d150e7ba7 EQUAL","P2SH,WITNESS","OK"], +[["0100","635168",1e-08],"0x22 0x0020c7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","HASH160 0x14 0x9b27ee6d9010c21bf837b334d043be5d150e7ba7 EQUAL","P2SH,WITNESS","OK"], +[["","635168",1e-08],"0x22 0x0020c7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","HASH160 0x14 0x9b27ee6d9010c21bf837b334d043be5d150e7ba7 EQUAL","P2SH,WITNESS","CLEANSTACK"], +[["00","635168",1e-08],"0x22 0x0020c7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","HASH160 0x14 0x9b27ee6d9010c21bf837b334d043be5d150e7ba7 EQUAL","P2SH,WITNESS","CLEANSTACK"], +[["01","635168",1e-08],"0x22 0x0020c7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","HASH160 0x14 0x9b27ee6d9010c21bf837b334d043be5d150e7ba7 EQUAL","P2SH,WITNESS,MINIMALIF","OK"], +[["02","635168",1e-08],"0x22 0x0020c7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","HASH160 0x14 0x9b27ee6d9010c21bf837b334d043be5d150e7ba7 EQUAL","P2SH,WITNESS,MINIMALIF","MINIMALIF"], +[["0100","635168",1e-08],"0x22 0x0020c7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","HASH160 0x14 0x9b27ee6d9010c21bf837b334d043be5d150e7ba7 EQUAL","P2SH,WITNESS,MINIMALIF","MINIMALIF"], +[["","635168",1e-08],"0x22 0x0020c7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","HASH160 0x14 0x9b27ee6d9010c21bf837b334d043be5d150e7ba7 EQUAL","P2SH,WITNESS,MINIMALIF","CLEANSTACK"], +[["00","635168",1e-08],"0x22 0x0020c7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","HASH160 0x14 0x9b27ee6d9010c21bf837b334d043be5d150e7ba7 EQUAL","P2SH,WITNESS,MINIMALIF","MINIMALIF"], +[["635168",1e-08],"0x22 0x0020c7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","HASH160 0x14 0x9b27ee6d9010c21bf837b334d043be5d150e7ba7 EQUAL","P2SH,WITNESS","UNBALANCED_CONDITIONAL"], +[["635168",1e-08],"0x22 0x0020c7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d","HASH160 0x14 0x9b27ee6d9010c21bf837b334d043be5d150e7ba7 EQUAL","P2SH,WITNESS,MINIMALIF","UNBALANCED_CONDITIONAL"], +[["01","645168",1e-08],"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL","P2SH,WITNESS","CLEANSTACK"], +[["02","645168",1e-08],"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL","P2SH,WITNESS","CLEANSTACK"], +[["0100","645168",1e-08],"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL","P2SH,WITNESS","CLEANSTACK"], +[["","645168",1e-08],"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL","P2SH,WITNESS","OK"], +[["00","645168",1e-08],"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL","P2SH,WITNESS","OK"], +[["01","645168",1e-08],"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL","P2SH,WITNESS,MINIMALIF","CLEANSTACK"], +[["02","645168",1e-08],"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL","P2SH,WITNESS,MINIMALIF","MINIMALIF"], +[["0100","645168",1e-08],"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL","P2SH,WITNESS,MINIMALIF","MINIMALIF"], +[["","645168",1e-08],"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL","P2SH,WITNESS,MINIMALIF","OK"], +[["00","645168",1e-08],"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL","P2SH,WITNESS,MINIMALIF","MINIMALIF"], +[["645168",1e-08],"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL","P2SH,WITNESS","UNBALANCED_CONDITIONAL"], +[["645168",1e-08],"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8","HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL","P2SH,WITNESS,MINIMALIF","UNBALANCED_CONDITIONAL"], ["0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0","0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT","DERSIG","OK","BIP66 and NULLFAIL-compliant"], ["0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0","0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT","DERSIG,NULLFAIL","OK","BIP66 and NULLFAIL-compliant"], ["1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0","0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT","DERSIG,NULLFAIL","OK","BIP66 and NULLFAIL-compliant, not NULLDUMMY-compliant"], ["1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0","0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT","DERSIG,NULLFAIL,NULLDUMMY","SIG_NULLDUMMY","BIP66 and NULLFAIL-compliant, not NULLDUMMY-compliant"], -["0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0x09 0x300602010102010101","0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT","DERSIG","OK","BIP66-compliant but not NULLFAIL-compliant"], ["0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0x09 0x300602010102010101","0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT","DERSIG,NULLFAIL","NULLFAIL","BIP66-compliant but not NULLFAIL-compliant"], ["0 0x09 0x300602010102010101 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0","0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT","DERSIG","OK","BIP66-compliant but not NULLFAIL-compliant"], ["0 0x09 0x300602010102010101 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0","0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT","DERSIG,NULLFAIL","NULLFAIL","BIP66-compliant but not NULLFAIL-compliant"]] From aeb0fc0a2518731793d59c7e097b70e216f5b8e4 Mon Sep 17 00:00:00 2001 From: Dao Nguyen Date: Mon, 21 Oct 2024 23:39:23 +0700 Subject: [PATCH 3/8] scarb fmt --- packages/engine/src/opcodes/crypto.cairo | 8 ++++--- packages/engine/src/signature/signature.cairo | 22 ++++++------------- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/packages/engine/src/opcodes/crypto.cairo b/packages/engine/src/opcodes/crypto.cairo index cf13a10..7d9f20b 100644 --- a/packages/engine/src/opcodes/crypto.cairo +++ b/packages/engine/src/opcodes/crypto.cairo @@ -73,7 +73,9 @@ pub fn opcode_checksig< let res = BaseSigVerifierTrait::new(ref engine, @full_sig_bytes, @pk_bytes); if res.is_err() { let err = res.unwrap_err(); - if err == Error::SCRIPT_ERR_SIG_DER || err == Error::PUBKEYTYPE || err == Error::SIG_HASHTYPE { + if err == Error::SCRIPT_ERR_SIG_DER + || err == Error::PUBKEYTYPE + || err == Error::SIG_HASHTYPE { return Result::Err(err); }; engine.dstack.push_bool(false); @@ -252,9 +254,9 @@ pub fn opcode_checkmultisig< } else if verify_der || strict_encoding { if err == 'invalid sig fmt: S padding' { return Result::Err(Error::SCRIPT_ERR_SIG_DER); - } else if err != ''{ + } else if err != '' { return Result::Err(err); - } + } } else if err == Error::SIG_HIGH_S { return Result::Err(err); } diff --git a/packages/engine/src/signature/signature.cairo b/packages/engine/src/signature/signature.cairo index f2ee862..d8d4256 100644 --- a/packages/engine/src/signature/signature.cairo +++ b/packages/engine/src/signature/signature.cairo @@ -267,7 +267,6 @@ pub fn check_signature_encoding< return Result::Err('invalid sig fmt: R padding'); } - // Ensure the `S` value is correctly identified as an ASN.1 integer. if sig_bytes[s_type_offset] != asn1_integer_id { return Result::Err('invalid sig fmt:S ASN.1'); @@ -277,13 +276,12 @@ pub fn check_signature_encoding< return Result::Err('invalid sig fmt:S length'); } - if sig_bytes[s_offset] & 0x80 != 0 { - return Result::Err('invalid sig fmt: negative S'); - } - if s_len > 1 && sig_bytes[s_offset] == 0 && sig_bytes[s_offset + 1] & 0x80 == 0 { - return Result::Err('invalid sig fmt: S padding'); - } - + if sig_bytes[s_offset] & 0x80 != 0 { + return Result::Err('invalid sig fmt: negative S'); + } + if s_len > 1 && sig_bytes[s_offset] == 0 && sig_bytes[s_offset + 1] & 0x80 == 0 { + return Result::Err('invalid sig fmt: S padding'); + } // If the "low S" rule is enforced, check that the `S` value is below the threshold. if low_s { @@ -425,7 +423,7 @@ pub fn parse_signature(sig_bytes: @ByteArray) -> Result { if s_len <= 0 || s_len > sig_len - r_len - 4 { return Result::Err('invalid sig fmt: bogus S length'); } - + let mut r_offset = 4; let mut s_offset = 6 + r_len; let order: u256 = Secp256Trait::::get_curve_size(); @@ -519,7 +517,6 @@ pub fn parse_base_sig_and_pk< }; } } - println!("1"); if let Result::Err(e) = check_signature_encoding(ref vm, sig_bytes) { return if strict_encoding { @@ -528,7 +525,6 @@ pub fn parse_base_sig_and_pk< Result::Err(e) }; } - println!("2"); if let Result::Err(e) = check_pub_key_encoding(ref vm, pk_bytes) { return if verify_der { @@ -537,13 +533,11 @@ pub fn parse_base_sig_and_pk< Result::Err(e) }; } - println!("3"); let mut start = 0; if hash_type_offset < 1 { return Result::Err('invalid hash offset'); } - println!("4"); let sig_bytes = @sub_byte_array(sig_bytes, ref start, hash_type_offset); let sig = match parse_signature(sig_bytes) { @@ -554,8 +548,6 @@ pub fn parse_base_sig_and_pk< return Result::Err(e); }, }; - println!("5"); - let pub_key = match parse_pub_key(pk_bytes) { Result::Ok(key) => key, From 7ea91db38b2f5a361ab51cb3855864790506c418 Mon Sep 17 00:00:00 2001 From: Dao Nguyen Date: Tue, 22 Oct 2024 00:51:58 +0700 Subject: [PATCH 4/8] update --- packages/engine/src/opcodes/crypto.cairo | 3 ++- packages/engine/src/signature/signature.cairo | 26 ++++--------------- tests/run-core-tests.sh | 2 +- 3 files changed, 8 insertions(+), 23 deletions(-) diff --git a/packages/engine/src/opcodes/crypto.cairo b/packages/engine/src/opcodes/crypto.cairo index 7d9f20b..537e200 100644 --- a/packages/engine/src/opcodes/crypto.cairo +++ b/packages/engine/src/opcodes/crypto.cairo @@ -75,7 +75,8 @@ pub fn opcode_checksig< let err = res.unwrap_err(); if err == Error::SCRIPT_ERR_SIG_DER || err == Error::PUBKEYTYPE - || err == Error::SIG_HASHTYPE { + || err == Error::SIG_HASHTYPE + || err == Error::SIG_HIGH_S { return Result::Err(err); }; engine.dstack.push_bool(false); diff --git a/packages/engine/src/signature/signature.cairo b/packages/engine/src/signature/signature.cairo index d8d4256..bdb90b4 100644 --- a/packages/engine/src/signature/signature.cairo +++ b/packages/engine/src/signature/signature.cairo @@ -567,31 +567,15 @@ pub fn remove_signature(script: @ByteArray, sig_bytes: @ByteArray) -> @ByteArray let script_len = script.len(); while i < script_len { - let push_data: u8 = script[i]; - if push_data >= 8 && push_data <= 72 { - let mut len: usize = push_data.into(); - let mut found: bool = false; - if len == sig_bytes.len() { - found = compare_data(script, sig_bytes, i, push_data); - } - - if i + len <= script.len() { - i += len; - } else { - i += 1; - } + let opcode = script[i]; + let data_len = parser::data_len(script, i).unwrap(); + let end = i + data_len + 1; + if data_len == sig_bytes.len() { + let mut found = compare_data(script, sig_bytes, i, opcode); if found { i = end; continue; } - - processed_script.append_byte(push_data); - while len != 0 && i - len < script_len { - processed_script.append_byte(script[i - len + 1]); - len -= 1; - }; - } else { - processed_script.append_byte(push_data); } while i != end { processed_script.append_byte(script[i]); diff --git a/tests/run-core-tests.sh b/tests/run-core-tests.sh index 35fdeac..e351092 100755 --- a/tests/run-core-tests.sh +++ b/tests/run-core-tests.sh @@ -208,7 +208,7 @@ jq -c '.[]' $SCRIPT_TESTS_JSON | { elif echo "$RESULT" | grep -q "$INVALID_SIG_FMT"; then SCRIPT_RESULT="SIG_DER" elif echo "$RESULT" | grep -q "$INVALID_HASH_TYPE"; then - SCRIPT_RESULT="SIG_DER" + SCRIPT_RESULT="SIG_HASHTYPE" elif echo "$RESULT" | grep -q "$NONZERO_NULLFAIL"; then SCRIPT_RESULT="NULLFAIL" elif echo "$RESULT" | grep -q "$SIG_NULLFAIL"; then From 598f59323c89289f1c044ff7c38a02910cbf376b Mon Sep 17 00:00:00 2001 From: Dao Nguyen Date: Tue, 22 Oct 2024 16:43:07 +0700 Subject: [PATCH 5/8] fix --- packages/engine/src/errors.cairo | 1 + packages/engine/src/opcodes/crypto.cairo | 4 +++- packages/engine/src/signature/signature.cairo | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/engine/src/errors.cairo b/packages/engine/src/errors.cairo index 1ca74c1..c58e931 100644 --- a/packages/engine/src/errors.cairo +++ b/packages/engine/src/errors.cairo @@ -39,6 +39,7 @@ pub mod Error { pub const PUBKEYTYPE: felt252 = 'Unsupported public key type'; pub const SIG_HIGH_S: felt252 = 'Sig not canonical high S value'; pub const SIG_HASHTYPE: felt252 = 'invalid hash type'; + pub const INVALID_PUBKEY_LEN: felt252 = 'Invalid public key length'; } pub fn byte_array_err(err: felt252) -> ByteArray { diff --git a/packages/engine/src/opcodes/crypto.cairo b/packages/engine/src/opcodes/crypto.cairo index 537e200..98069a6 100644 --- a/packages/engine/src/opcodes/crypto.cairo +++ b/packages/engine/src/opcodes/crypto.cairo @@ -256,7 +256,9 @@ pub fn opcode_checkmultisig< if err == 'invalid sig fmt: S padding' { return Result::Err(Error::SCRIPT_ERR_SIG_DER); } else if err != '' { - return Result::Err(err); + if err != Error::INVALID_PUBKEY_LEN{ + return Result::Err(err); + } } } else if err == Error::SIG_HIGH_S { return Result::Err(err); diff --git a/packages/engine/src/signature/signature.cairo b/packages/engine/src/signature/signature.cairo index bdb90b4..06b5940 100644 --- a/packages/engine/src/signature/signature.cairo +++ b/packages/engine/src/signature/signature.cairo @@ -382,7 +382,7 @@ pub fn parse_pub_key(pk_bytes: @ByteArray) -> Result { } else { // Extract X coordinate and determine parity from last byte. if pk_bytes_uncompressed.len() != 65 { - return Result::Err('Invalid public key length'); + return Result::Err(Error::INVALID_PUBKEY_LEN); } let pub_key: u256 = u256_from_byte_array_with_offset(@pk_bytes_uncompressed, 1, 32); let parity = !(pk_bytes_uncompressed[64] & 1 == 0); From bfa0ce25b42a909fe6d11904c3aec220357103d7 Mon Sep 17 00:00:00 2001 From: Dao Nguyen Date: Tue, 22 Oct 2024 16:43:48 +0700 Subject: [PATCH 6/8] update test result --- tests/script_tests_failing.json | 3 +-- tests/script_tests_passing.json | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/script_tests_failing.json b/tests/script_tests_failing.json index 437517b..37573a5 100644 --- a/tests/script_tests_failing.json +++ b/tests/script_tests_failing.json @@ -24,5 +24,4 @@ [["","304402206c6d9f5daf85b54af2a93ec38b15ab27f205dbf5c735365ff12451e43613d1f40220736a44be63423ed5ebf53491618b7cc3d8a5093861908da853739c73717938b701","5141048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae",1e-08],"","0 0x20 0x230828ed48871f0f362ce9432aa52f620f442cc8d9ce7a8b5e798365595a38bb","P2SH,WITNESS,WITNESS_PUBKEYTYPE","WITNESS_PUBKEYTYPE","P2WSH CHECKMULTISIG with second key uncompressed and signing with the second key"], [["","30440220687871bc6144012d75baf585bb26ce13997f7d8c626f4d8825b069c3b2d064470220108936fe1c57327764782253e99090b09c203ec400ed35ce9e026ce2ecf842a001","5141048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae",1e-08],"0x22 0x0020230828ed48871f0f362ce9432aa52f620f442cc8d9ce7a8b5e798365595a38bb","HASH160 0x14 0x3478e7019ce61a68148f87549579b704cbe4c393 EQUAL","P2SH,WITNESS,WITNESS_PUBKEYTYPE","WITNESS_PUBKEYTYPE","P2SH(P2WSH) CHECKMULTISIG with second key uncompressed and signing with the second key"], ["0","CHECKSEQUENCEVERIFY","CHECKSEQUENCEVERIFY","UNSATISFIED_LOCKTIME","CSV fails if stack top bit 1 << 31 is set and the tx version < 2"], -["0x050000000001","CHECKSEQUENCEVERIFY","CHECKSEQUENCEVERIFY","UNSATISFIED_LOCKTIME","CSV fails if stack top bit 1 << 31 is not set, and tx version < 2"], -["0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0x09 0x300602010102010101","0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT","DERSIG","OK","BIP66-compliant but not NULLFAIL-compliant"]] +["0x050000000001","CHECKSEQUENCEVERIFY","CHECKSEQUENCEVERIFY","UNSATISFIED_LOCKTIME","CSV fails if stack top bit 1 << 31 is not set, and tx version < 2"]] \ No newline at end of file diff --git a/tests/script_tests_passing.json b/tests/script_tests_passing.json index 31965e0..b2b1821 100644 --- a/tests/script_tests_passing.json +++ b/tests/script_tests_passing.json @@ -1178,4 +1178,5 @@ ["1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0","0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT","DERSIG,NULLFAIL,NULLDUMMY","SIG_NULLDUMMY","BIP66 and NULLFAIL-compliant, not NULLDUMMY-compliant"], ["0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0x09 0x300602010102010101","0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT","DERSIG,NULLFAIL","NULLFAIL","BIP66-compliant but not NULLFAIL-compliant"], ["0 0x09 0x300602010102010101 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0","0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT","DERSIG","OK","BIP66-compliant but not NULLFAIL-compliant"], -["0 0x09 0x300602010102010101 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0","0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT","DERSIG,NULLFAIL","NULLFAIL","BIP66-compliant but not NULLFAIL-compliant"]] +["0 0x09 0x300602010102010101 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0","0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT","DERSIG,NULLFAIL","NULLFAIL","BIP66-compliant but not NULLFAIL-compliant"], +["0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0x09 0x300602010102010101","0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT","DERSIG","OK","BIP66-compliant but not NULLFAIL-compliant"]] From 9bafec1fedd2bba9a7e22cb6e4af0f2d025a1092 Mon Sep 17 00:00:00 2001 From: Dao Nguyen Date: Tue, 22 Oct 2024 17:43:21 +0700 Subject: [PATCH 7/8] update test running --- tests/script_tests_failing.json | 5 ++--- tests/script_tests_passing.json | 7 ++++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/script_tests_failing.json b/tests/script_tests_failing.json index 37573a5..daa4c76 100644 --- a/tests/script_tests_failing.json +++ b/tests/script_tests_failing.json @@ -1,7 +1,6 @@ [ +["0 0x47 0x304402205451ce65ad844dbb978b8bdedf5082e33b43cae8279c30f2c74d9e9ee49a94f802203fe95a7ccf74da7a232ee523ef4a53cb4d14bdd16289680cdb97a63819b8f42f01 0x46 0x304402205451ce65ad844dbb978b8bdedf5082e33b43cae8279c30f2c74d9e9ee49a94f802203fe95a7ccf74da7a232ee523ef4a53cb4d14bdd16289680cdb97a63819b8f42f","2 0x21 0x02a673638cb9587cb68ea08dbef685c6f2d2a751a8b3c6f2a7e9a4999e6e4bfaf5 0x21 0x02a673638cb9587cb68ea08dbef685c6f2d2a751a8b3c6f2a7e9a4999e6e4bfaf5 0x21 0x02a673638cb9587cb68ea08dbef685c6f2d2a751a8b3c6f2a7e9a4999e6e4bfaf5 3 CHECKMULTISIG","P2SH,STRICTENC","SIG_DER","2-of-3 with one valid and one invalid signature due to parse error, nSigs > validSigs"], ["0x48 0x304502203e4516da7253cf068effec6b95c41221c0cf3a8e6ccb8cbf1725b562e9afde2c022100ab1e3da73d67e32045a20e0b999e049978ea8d6ee5480d485fcf2ce0d03b2ef001","0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG","LOW_S","SIG_HIGH_S","P2PK with high S"], -["0x47 0x304402206177d513ec2cda444c021a1f4f656fc4c72ba108ae063e157eb86dc3575784940220666fc66702815d0e5413bb9b1df22aed44f5f1efb8b99d41dd5dc9a5be6d205205","0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG","STRICTENC","SIG_HASHTYPE","P2PK with undefined hashtype"], -["0x47 0x304402207409b5b320296e5e2136a7b281a7f803028ca4ca44e2b83eebd46932677725de02202d4eea1c8d3c98e6f42614f54764e6e5e6542e213eb4d079737e9a8b6e9812ec05","0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG NOT","STRICTENC","SIG_HASHTYPE","P2PK NOT with invalid sig and undefined hashtype"], [["304402205ae57ae0534c05ca9981c8a6cdf353b505eaacb7375f96681a2d1a4ba6f02f84022056248e68643b7d8ce7c7d128c9f1f348bcab8be15d094ad5cadd24251a28df8001","0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",0],"","1 0x14 0x91b24bf9f5288532960ac687abb035127b1d28a5","DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM,P2SH,WITNESS","DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM","P2WPKH with future witness version"], [["","304402207eb8a59b5c65fc3f6aeef77066556ed5c541948a53a3ba7f7c375b8eed76ee7502201e036a7a9a98ff919ff94dc905d67a1ec006f79ef7cff0708485c8bb79dce38e01","5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae",1e-08],"","0 0x20 0x06c24420938f0fa3c1cb2707d867154220dca365cdbfa0dd2a83854730221460","P2SH,WITNESS,WITNESS_PUBKEYTYPE","OK","P2WSH CHECKMULTISIG with compressed keys"], [["","3044022033706aed33b8155d5486df3b9bca8cdd3bd4bdb5436dce46d72cdaba51d22b4002203626e94fe53a178af46624f17315c6931f20a30b103f5e044e1eda0c3fe185c601","5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae",1e-08],"0x22 0x002006c24420938f0fa3c1cb2707d867154220dca365cdbfa0dd2a83854730221460","HASH160 0x14 0x26282aad7c29369d15fed062a778b6100d31a340 EQUAL","P2SH,WITNESS,WITNESS_PUBKEYTYPE","OK","P2SH(P2WSH) CHECKMULTISIG with compressed keys"], @@ -24,4 +23,4 @@ [["","304402206c6d9f5daf85b54af2a93ec38b15ab27f205dbf5c735365ff12451e43613d1f40220736a44be63423ed5ebf53491618b7cc3d8a5093861908da853739c73717938b701","5141048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae",1e-08],"","0 0x20 0x230828ed48871f0f362ce9432aa52f620f442cc8d9ce7a8b5e798365595a38bb","P2SH,WITNESS,WITNESS_PUBKEYTYPE","WITNESS_PUBKEYTYPE","P2WSH CHECKMULTISIG with second key uncompressed and signing with the second key"], [["","30440220687871bc6144012d75baf585bb26ce13997f7d8c626f4d8825b069c3b2d064470220108936fe1c57327764782253e99090b09c203ec400ed35ce9e026ce2ecf842a001","5141048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae",1e-08],"0x22 0x0020230828ed48871f0f362ce9432aa52f620f442cc8d9ce7a8b5e798365595a38bb","HASH160 0x14 0x3478e7019ce61a68148f87549579b704cbe4c393 EQUAL","P2SH,WITNESS,WITNESS_PUBKEYTYPE","WITNESS_PUBKEYTYPE","P2SH(P2WSH) CHECKMULTISIG with second key uncompressed and signing with the second key"], ["0","CHECKSEQUENCEVERIFY","CHECKSEQUENCEVERIFY","UNSATISFIED_LOCKTIME","CSV fails if stack top bit 1 << 31 is set and the tx version < 2"], -["0x050000000001","CHECKSEQUENCEVERIFY","CHECKSEQUENCEVERIFY","UNSATISFIED_LOCKTIME","CSV fails if stack top bit 1 << 31 is not set, and tx version < 2"]] \ No newline at end of file +["0x050000000001","CHECKSEQUENCEVERIFY","CHECKSEQUENCEVERIFY","UNSATISFIED_LOCKTIME","CSV fails if stack top bit 1 << 31 is not set, and tx version < 2"]] diff --git a/tests/script_tests_passing.json b/tests/script_tests_passing.json index b2b1821..628db05 100644 --- a/tests/script_tests_passing.json +++ b/tests/script_tests_passing.json @@ -969,7 +969,6 @@ ["0 0x02 0x0000 0","CHECKMULTISIGVERIFY 1","MINIMALDATA","UNKNOWN_ERROR"], ["0 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501","2 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 0 2 CHECKMULTISIG NOT","STRICTENC","PUBKEYTYPE","2-of-2 CHECKMULTISIG NOT with the first pubkey invalid, and both signatures validly encoded."], ["0 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501 1","2 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 2 CHECKMULTISIG NOT","STRICTENC","SIG_DER","2-of-2 CHECKMULTISIG NOT with both pubkeys valid, but first signature invalid."], -["0 0x47 0x304402205451ce65ad844dbb978b8bdedf5082e33b43cae8279c30f2c74d9e9ee49a94f802203fe95a7ccf74da7a232ee523ef4a53cb4d14bdd16289680cdb97a63819b8f42f01 0x46 0x304402205451ce65ad844dbb978b8bdedf5082e33b43cae8279c30f2c74d9e9ee49a94f802203fe95a7ccf74da7a232ee523ef4a53cb4d14bdd16289680cdb97a63819b8f42f","2 0x21 0x02a673638cb9587cb68ea08dbef685c6f2d2a751a8b3c6f2a7e9a4999e6e4bfaf5 0x21 0x02a673638cb9587cb68ea08dbef685c6f2d2a751a8b3c6f2a7e9a4999e6e4bfaf5 0x21 0x02a673638cb9587cb68ea08dbef685c6f2d2a751a8b3c6f2a7e9a4999e6e4bfaf5 3 CHECKMULTISIG","P2SH,STRICTENC","SIG_DER","2-of-3 with one valid and one invalid signature due to parse error, nSigs > validSigs"], ["0x4a 0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","0 CHECKSIG NOT","DERSIG","SIG_DER","Overly long signature is incorrectly encoded for DERSIG"], ["0x25 0x30220220000000000000000000000000000000000000000000000000000000000000000000","0 CHECKSIG NOT","DERSIG","SIG_DER","Missing S is incorrectly encoded for DERSIG"], ["0x27 0x3024021077777777777777777777777777777777020a7777777777777777777777777777777701","0 CHECKSIG NOT","DERSIG","SIG_DER","S with invalid S length is incorrectly encoded for DERSIG"], @@ -1051,7 +1050,9 @@ ["0 0x47 0x304402202e79441ad1baf5a07fb86bae3753184f6717d9692680947ea8b6e8b777c69af1022079a262e13d868bb5a0964fefe3ba26942e1b0669af1afb55ef3344bc9d4fc4c401","1 0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 2 CHECKMULTISIG","STRICTENC","OK","1-of-2 with the second 1 hybrid pubkey"], ["0 0x47 0x3044022079c7824d6c868e0e1a273484e28c2654a27d043c8a27f49f52cb72efed0759090220452bbbf7089574fa082095a4fc1b3a16bafcf97a3a34d745fafc922cce66b27201","1 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 2 CHECKMULTISIG","STRICTENC","PUBKEYTYPE","1-of-2 with the first 1 hybrid pubkey"], ["0x47 0x304402206177d513ec2cda444c021a1f4f656fc4c72ba108ae063e157eb86dc3575784940220666fc66702815d0e5413bb9b1df22aed44f5f1efb8b99d41dd5dc9a5be6d205205","0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG","","OK","P2PK with undefined hashtype but no STRICTENC"], +["0x47 0x304402206177d513ec2cda444c021a1f4f656fc4c72ba108ae063e157eb86dc3575784940220666fc66702815d0e5413bb9b1df22aed44f5f1efb8b99d41dd5dc9a5be6d205205","0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG","STRICTENC","SIG_HASHTYPE","P2PK with undefined hashtype"], ["0x47 0x304402207409b5b320296e5e2136a7b281a7f803028ca4ca44e2b83eebd46932677725de02202d4eea1c8d3c98e6f42614f54764e6e5e6542e213eb4d079737e9a8b6e9812ec05","0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG NOT","","OK","P2PK NOT with invalid sig and undefined hashtype but no STRICTENC"], +["0x47 0x304402207409b5b320296e5e2136a7b281a7f803028ca4ca44e2b83eebd46932677725de02202d4eea1c8d3c98e6f42614f54764e6e5e6542e213eb4d079737e9a8b6e9812ec05","0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG NOT","STRICTENC","SIG_HASHTYPE","P2PK NOT with invalid sig and undefined hashtype"], ["1 0x47 0x3044022051254b9fb476a52d85530792b578f86fea70ec1ffb4393e661bcccb23d8d63d3022076505f94a403c86097841944e044c70c2045ce90e36de51f7e9d3828db98a07501 0x47 0x304402200a358f750934b3feb822f1966bfcd8bbec9eeaa3a8ca941e11ee5960e181fa01022050bf6b5a8e7750f70354ae041cb68a7bade67ec6c3ab19eb359638974410626e01 0x47 0x304402200955d031fff71d8653221e85e36c3c85533d2312fc3045314b19650b7ae2f81002202a6bb8505e36201909d0921f01abff390ae6b7ff97bbf959f98aedeb0a56730901","3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG","","OK","3-of-3 with nonzero dummy but no NULLDUMMY"], ["1 0x47 0x3044022051254b9fb476a52d85530792b578f86fea70ec1ffb4393e661bcccb23d8d63d3022076505f94a403c86097841944e044c70c2045ce90e36de51f7e9d3828db98a07501 0x47 0x304402200a358f750934b3feb822f1966bfcd8bbec9eeaa3a8ca941e11ee5960e181fa01022050bf6b5a8e7750f70354ae041cb68a7bade67ec6c3ab19eb359638974410626e01 0x47 0x304402200955d031fff71d8653221e85e36c3c85533d2312fc3045314b19650b7ae2f81002202a6bb8505e36201909d0921f01abff390ae6b7ff97bbf959f98aedeb0a56730901","3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG","NULLDUMMY","SIG_NULLDUMMY","3-of-3 with nonzero dummy"], ["1 0x47 0x304402201bb2edab700a5d020236df174fefed78087697143731f659bea59642c759c16d022061f42cdbae5bcd3e8790f20bf76687443436e94a634321c16a72aa54cbc7c2ea01 0x47 0x304402204bb4a64f2a6e5c7fb2f07fef85ee56fde5e6da234c6a984262307a20e99842d702206f8303aaba5e625d223897e2ffd3f88ef1bcffef55f38dc3768e5f2e94c923f901 0x47 0x3044022040c2809b71fffb155ec8b82fe7a27f666bd97f941207be4e14ade85a1249dd4d02204d56c85ec525dd18e29a0533d5ddf61b6b1bb32980c2f63edf951aebf7a27bfe01","3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG NOT","","OK","3-of-3 NOT with invalid sig and nonzero dummy but no NULLDUMMY"], @@ -1176,7 +1177,7 @@ ["0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0","0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT","DERSIG,NULLFAIL","OK","BIP66 and NULLFAIL-compliant"], ["1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0","0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT","DERSIG,NULLFAIL","OK","BIP66 and NULLFAIL-compliant, not NULLDUMMY-compliant"], ["1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0","0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT","DERSIG,NULLFAIL,NULLDUMMY","SIG_NULLDUMMY","BIP66 and NULLFAIL-compliant, not NULLDUMMY-compliant"], +["0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0x09 0x300602010102010101","0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT","DERSIG","OK","BIP66-compliant but not NULLFAIL-compliant"], ["0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0x09 0x300602010102010101","0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT","DERSIG,NULLFAIL","NULLFAIL","BIP66-compliant but not NULLFAIL-compliant"], ["0 0x09 0x300602010102010101 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0","0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT","DERSIG","OK","BIP66-compliant but not NULLFAIL-compliant"], -["0 0x09 0x300602010102010101 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0","0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT","DERSIG,NULLFAIL","NULLFAIL","BIP66-compliant but not NULLFAIL-compliant"], -["0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0x09 0x300602010102010101","0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT","DERSIG","OK","BIP66-compliant but not NULLFAIL-compliant"]] +["0 0x09 0x300602010102010101 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0","0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT","DERSIG,NULLFAIL","NULLFAIL","BIP66-compliant but not NULLFAIL-compliant"]] From 13cdf9c2ce96993ab4eba0ad9a39fb2ca3e71d64 Mon Sep 17 00:00:00 2001 From: Dao Nguyen Date: Tue, 22 Oct 2024 17:44:12 +0700 Subject: [PATCH 8/8] scarb fmt --- packages/engine/src/opcodes/crypto.cairo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/engine/src/opcodes/crypto.cairo b/packages/engine/src/opcodes/crypto.cairo index 98069a6..379e69a 100644 --- a/packages/engine/src/opcodes/crypto.cairo +++ b/packages/engine/src/opcodes/crypto.cairo @@ -75,7 +75,7 @@ pub fn opcode_checksig< let err = res.unwrap_err(); if err == Error::SCRIPT_ERR_SIG_DER || err == Error::PUBKEYTYPE - || err == Error::SIG_HASHTYPE + || err == Error::SIG_HASHTYPE || err == Error::SIG_HIGH_S { return Result::Err(err); }; @@ -256,7 +256,7 @@ pub fn opcode_checkmultisig< if err == 'invalid sig fmt: S padding' { return Result::Err(Error::SCRIPT_ERR_SIG_DER); } else if err != '' { - if err != Error::INVALID_PUBKEY_LEN{ + if err != Error::INVALID_PUBKEY_LEN { return Result::Err(err); } }