MSTR Cat

Blockchain/Level IV · Protocol depth/4.1 Script/Lesson 3

Multisignature

The quorum, the bug, and the key that never was

MaterialsA block explorer with script decoding capabilities (e.g., mempool.space or blockchain.com)The Bitcoin Core source code, specifically the script interpreter logic for OP_CHECKMULTISIGBIP147 and BIP327 specification documents

Wonder

  1. Why does a script requiring two signatures pop three items from the stack?
  2. How can an empty byte string be a consensus rule rather than just a convention?
  3. What changes when ten keys aggregate into one signature that looks indistinguishable from a single signer’s?

Explore

  1. Multisignature scripts mandate that at least m signatures validate against n listed public keys. The locking script lists m, the n public keys and n; OP_CHECKMULTISIG pops n, the n keys, m, and then m signatures, which must match keys in the listed order. If fewer than m valid signatures are supplied, the spend is invalid.
  2. A coding error in the original implementation causes OP_CHECKMULTISIG to pop one extra stack item beyond the required signatures. This ‘dummy’ element is ignored during cryptographic verification but must be present; if absent, the stack underflows and the transaction fails. Early spenders used OP_0 as this filler, a convention that persisted for years because nodes accepted any value in that slot.
  3. BIP147 (NULLDUMMY), activated with SegWit in August 2017, converted this malleability vector into a consensus rule. The dummy element must now be an empty byte array. Any non-empty value, even a single zero byte, makes the script fail. This eliminated the ability to alter transaction IDs by swapping the dummy’s content, stabilizing the transaction hash for all subsequent confirmations.
  4. Standardness rules govern which multisig scripts nodes relay. Bare multisignature outputs are limited to three keys under default Bitcoin Core policy. Wrapped in P2SH, multisig can use up to 15 keys (limited by the 520-byte redeem script); in P2WSH, up to 20. This distinction allows complex corporate treasury setups to function without bloating the base transaction layer.
  5. Two newer tools replace legacy multisig patterns. MuSig2 (BIP327, 2023), a separate protocol built on Taproot’s Schnorr signatures, aggregates multiple public keys into a single key and produces a standard Schnorr signature; on-chain, the spend is indistinguishable from an ordinary single-key Taproot spend. Tapscript, part of Taproot itself, adds OP_CHECKSIGADD, which allows incremental signature verification without the stack-pop bug or the 20-key limit of legacy opcodes.
  6. To inspect these mechanics, open a block explorer and locate a pre-SegWit bare multisig transaction. Observe the scriptSig: it begins with OP_0 followed by signatures. Compare it with a P2WSH multisig spend, where the witness holds an empty item, the signatures and the witness script listing the keys. Note how the byte counts differ, reflecting the cost of embedding the full key list in the output versus the input.

Key facts

  • OP_CHECKMULTISIG pops one extra stack item due to a historical off-by-one bug.
  • BIP147 (NULLDUMMY) mandates that this dummy element be an empty byte array at consensus level.
  • Bitcoin Core default policy limits bare multisig outputs to three public keys; P2SH allows up to 15 and P2WSH up to 20.
  • MuSig2 aggregates multiple keys into a single signature, making the spend look like an ordinary single-key Taproot spend.
  • OP_CHECKSIGADD in tapscript replaces OP_CHECKMULTISIG, allowing threshold checks without the extra-item bug.
  • SegWit activation (August 2017) included BIP147, converting the NULLDUMMY rule from relay policy to consensus.

Exercise nine, six, three, one

9CollectList 9 multisig arrangements you can find described (in wallets, exchanges, Lightning, inheritance plans), noting m-of-n and the script type used.
6ClusterGroup the 9 into 6 by on-chain form: bare multisig, P2SH, P2SH-wrapped SegWit, P2WSH, Taproot script path, or Taproot key path with aggregated keys.
3DistillReduce the six groups to three trade-offs regarding privacy, byte cost, and recovery flexibility inherent in each multisig implementation style.
1CrystallizeWrite one sentence explaining why an empty byte string became a permanent consensus rule rather than a mutable policy parameter.

Fact check

Dates, figures and claims checked against the published sources listed below.

Open in the interactive academy →

PT ES ZH JA KO RU DE FR MS