1

For this CHECKSIGADD script for a 2-of-3 multisig:

<pk1> OP_CHECKSIG <pk2> OP_CHECKSIGADD <pk3> OP_CHECKSIGADD OP_2 OP_EQUAL

What happens if you provide more than the 2 required signatures, in this case 3 valid signatures for the 3 associated public keys? 3 is not equal to the required 2 so the OP_EQUAL would cause the unlocking script to fail? Would you need to use a greater than or equal opcode instead of OP_EQUAL if you are going to provide more valid signatures than required?

1 Answer 1

2

Yes, if you provide too many signatures, it will fail on the OP_EQUAL. Luckily, you can easily fix it by just dropping one of the signatures and replacing it with the empty byte vector instead.

You could permit additional signatures by replacing OP_2 OP_EQUAL with OP_1 OP_GREATER_THAN, or with OP_2 OP_GREATERTHANOREQUAL, however additional signatures would increase your input’s weight, so it seems preferable to just drop superfluous signatures.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.