@@ -664,7 +664,30 @@ nSequences are max.
664
664
[" 0 0 0x02 0x0000" , " CHECKMULTISIGVERIFY 1" , " " ],
665
665
[" 0 0x02 0x0000 0" , " CHECKMULTISIGVERIFY 1" , " " ],
666
666
667
+ ["
668
+ CHECKMULTISIG evaluation order tests. CHECKMULTISIG evaluates signatures and
669
+ pubkeys in a specific order, and will exit early if the number of signatures
670
+ left to check is greater than the number of keys left. As STRICTENC fails the
671
+ script when it reaches an invalidly encoded signature or pubkey, we can use it
672
+ to test the exact order in which signatures and pubkeys are evaluated by
673
+ distinguishing CHECKMULTISIG returning false on the stack and the script as a
674
+ whole failing.
675
+ See also the corresponding inverted versions of these tests in script_invalid.json
676
+ " ],
677
+ [
678
+ " 0 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501" ,
679
+ " 2 0 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 2 CHECKMULTISIG NOT" ,
680
+ " STRICTENC" ,
681
+ " 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."
682
+ ],
683
+ [
684
+ " 0 0 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501" ,
685
+ " 2 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 2 CHECKMULTISIG NOT" ,
686
+ " STRICTENC" ,
687
+ " 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."
688
+ ],
667
689
690
+ [" Automatically generated test cases" ],
668
691
[
669
692
" 0x47 0x3044022053205076a7bb13d2db3162a2d97d8197631f829b065948b7019b15482af819a902204328dcc02c994ca086b1226d0d5f1674d23cfae0d846143df812b81cab3391e801" ,
670
693
" 0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG" ,
@@ -761,30 +784,6 @@ nSequences are max.
761
784
" STRICTENC" ,
762
785
" 1-of-2 with the second 1 hybrid pubkey"
763
786
],
764
-
765
- ["
766
- CHECKMULTISIG evaluation order tests. CHECKMULTISIG evaluates signatures and
767
- pubkeys in a specific order, and will exit early if the number of signatures
768
- left to check is greater than the number of keys left. As STRICTENC fails the
769
- script when it reaches an invalidly encoded signature or pubkey, we can use it
770
- to test the exact order in which signatures and pubkeys are evaluated by
771
- distinguishing CHECKMULTISIG returning false on the stack and the script as a
772
- whole failing.
773
- See also the corresponding inverted versions of these tests in script_invalid.json
774
- " ],
775
- [
776
- " 0 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501" ,
777
- " 2 0 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 2 CHECKMULTISIG NOT" ,
778
- " STRICTENC" ,
779
- " 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."
780
- ],
781
- [
782
- " 0 0 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501" ,
783
- " 2 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 2 CHECKMULTISIG NOT" ,
784
- " STRICTENC" ,
785
- " 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."
786
- ],
787
-
788
787
[
789
788
" 0x47 0x304402201c215cb13e4954e60ce4f6de74941904c771f998de7b1d9627e82a1949fde517022031c2197455f3dbecbb78321201308d7b039424e38d480772d7cd4eb465a083f405" ,
790
789
" 0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG" ,
0 commit comments