<p>Performance. </p>

<p>If you have an m of n multisig scheme, ordering the keys and the signatures  ensures that a minimum of m and a maximum of n signatures will be verified.</p>

<p>If we didn't use this approach the number of signatures to be verified could be as high as  n! / (n-m)! ( this is the worst case scenario).</p>

<p>Keep in mind that, in terms of resources, it is trivial for a transacting node to order the signatures, but it is not trivial for a verifying node to validate 500k transactions per day. We need to use the resources of a verifying node as efficiently as possible.</p>

CC BY-SA 4.0
2018-05-18T11:37:37.330Z
2018-05-18T11:37:37.330Z
mustbemoney
<p>In <a href="https://bitcoin.org/en/developer-reference#term-op-checkmultisig" rel="nofollow noreferrer">https://bitcoin.org/en/developer-reference#term-op-checkmultisig</a></p>

<blockquote>
  <p>Because public keys are not checked again if they fail any signature comparison, signatures must be placed in the signature script using the same order as their corresponding public keys were placed in the pubkey script or redeem script. See the OP_CHECKMULTISIG warning below for more details.</p>
</blockquote>

<p>I wan't to Know, why public keys are not checked again? security or other？</p>

<bitcoin-core>
why OP_CHECKMULTISIG signatures must be placed in the signature script using the same order
AlphaTr
# why OP_CHECKMULTISIG signatures must be placed in the signature script using the same order

(Asked by: username_0 on 2018-05-18)

In <https://bitcoin.org/en/developer-reference#term-op-checkmultisig>

> Because public keys are not checked again if they fail any signature comparison, signatures must be placed in the signature script using the same order as their corresponding public keys were placed in the pubkey script or redeem script. See the OP\_CHECKMULTISIG warning below for more details.

I wan't to Know, why public keys are not checked again? security or other？

**Tags:** bitcoin-core


---

## 1 answers

### Answer by username_1 on 2018-05-18. Score: 4 | Accepted answer

Performance.

If you have an m of n multisig scheme, ordering the keys and the signatures ensures that a minimum of m and a maximum of n signatures will be verified.

If we didn't use this approach the number of signatures to be verified could be as high as n! / (n-m)! ( this is the worst case scenario).

Keep in mind that, in terms of resources, it is trivial for a transacting node to order the signatures, but it is not trivial for a verifying node to validate 500k transactions per day. We need to use the resources of a verifying node as efficiently as possible.


---

