Hi! can you elaborate a bit more about the solution? why the OP_NOP is relevant?
I was hard coding test vectors and missed that particular one at the beginning so I was confused about how things should work, that is why it was relevant.
Now I understand the process of executing OP_CheckSig better which goes like this:
- Replace the SignatureScript of the transaction you are verifying with the
same script1 that contains that OP_CheckSig.
- Remove all signatures that are the same as the one this OP is verifying because a signature can not sign itself.
So when we want to evaluate Sig1+pub1 in the following script
OP_Foo OP_Bar <Push_Sig2> <Push_Sig1> <Push_Sig1> <Push_pub1> OP_CheckSig OP_FooBar
We replace the SignatureScript of the transaction with
OP_Foo OP_Bar <Push_Sig2> <Push_pub1> OP_CheckSig OP_FooBar
Foo Bar ops are any OP code except OP_CodeSeparator.
[1] A tiny little fact that makes a huge difference and is not found in any documentation or at least no clearly.