Author

Topic: Why does OP_CheckMultiSig not fail on an invalid public key? (Read 152 times)

legendary
Activity: 1042
Merit: 2805
Bitcoin and C♯ Enthusiast
Why would you consider this a bug?  Yes, it could have been implemented differently, but the definition of CMS is that signature validation passes N of M times.
I guess because I usually expect certain things to be strict specially when it comes to evaluating scripts.
This is not the first time I'm surprised by such rules though.
staff
Activity: 4284
Merit: 8808
Is this another bug at protocol level?
Why would you consider this a bug?  Yes, it could have been implemented differently, but the definition of CMS is that signature validation passes N of M times.

Obvious ways of implementing it-- including the way it was originally implemented-- wouldn't provide for any way to determine exactly why a signature failed to validate only that it did.
legendary
Activity: 1042
Merit: 2805
Bitcoin and C♯ Enthusiast
Basically this test vector: https://github.com/bitcoin/bitcoin/blob/b6a5dc90bfd4640cf9f914e59bf8e21cd265b51e/src/test/data/tx_valid.json#L185-L188

It is spending a P2SH output with the redeem script of it being:
OP_2 <invalid_pub> OP_3 OP_CheckMultiSig
The first push which is supposed to be a public key is an invalid public key (it is a DER encoded signature) and despite that OP_CheckMultiSig passes successfully!
Is this another bug at protocol level? Also is it the same for SegWit scripts?
Jump to: