TeachMeBitcoin

P2MS Consensus Limits

From TeachMeBitcoin, the free encyclopedia Reading time: 2 min

P2MS Consensus Limits

While Bitcoin is theoretically very flexible, it has strict limits on how large a multisig script can be. These limits prevent attackers from creating "Nuke Transactions" that could crash a node by forcing it to verify thousands of signatures at once.

1. Standardness vs. Consensus

There are two layers of rules in Bitcoin:

2. The 3-Key Relay Limit

For "Bare" P2MS (where the keys are in the ScriptPubKey), most nodes will only relay transactions with N \u2264 3.

3. The 20-Key Consensus Limit

The absolute maximum for OP_CHECKMULTISIG is 20 keys.

4. SigOp Limits

Every signature verification is called a SigOp (Signature Operation).

Context Limit Rule Type
Bare P2MS Relay 3 Keys Standardness
Absolute Max Keys 20 Keys Consensus
Max Block SigOps 80,000 Consensus

In the final section, we will build a Python P2MS Auditor.

☕ Help support TeachMeBitcoin

TeachMeBitcoin is an ad-free, open-source educational repository curated by a passionate team of Bitcoin researchers and educators for public benefit. If you found our articles helpful, please consider supporting our hosting and ongoing content updates with a clean donation:

Ethereum: 0x578417C51783663D8A6A811B3544E1f779D39A85
Bitcoin: bc1q77k9e95rn669kpzyjr8ke9w95zhk7pa5s63qzz
Solana: 4ycT2ayqeMucixj3wS8Ay8Tq9NRDYRPKYbj3UGESyQ4J
Address copied to clipboard!