DEV Community

๐Ÿ”‘ Multisig vs Normal Bitcoin Transactions โ€” Whatโ€™s the Difference?

๐Ÿš€ TL;DR

  • Normal: 1 input โ†’ 1 signature.
  • Multisig: 1 input โ†’ M signatures (from N possible cosigners).
  • SegWit moves signatures out of the txid calculation โ†’ cheaper & no txid malleability.
  • We collect partial signatures, sort them, and build the final script or witness per input.

1๏ธโƒฃ Normal Transactions (Single-Sig)

  • Keys: One private key โ†’ one public key.
  • Addresses:
    • Legacy (P2PKH): starts with 1...
    • SegWit (P2WPKH): starts with bc1q...
  • Signing:
    1. Create a sighash for each input.
    2. Sign it once.
    3. Attach the signature and public key.
  • Example (Legacy):
  [Signature, PubKey]
Enter fullscreen mode Exit fullscreen mode
  • Example (SegWit):
    • scriptSig empty, witness carries [Signature, PubKey].

2๏ธโƒฃ Multisig Transactions (M-of-N)

  • Keys: N people, each with their own private key.
  • Addresses:
    • Legacy P2SH: starts with 3...
    • SegWit P2WSH: starts with bc1q...
  • Rule: Any M of these N signatures can spend the coins.
  • Signing:

    1. Each cosigner signs separately.
    2. Collect M valid signatures for each input.
    3. Build the final unlocking data:
      • Legacy P2SH:
       OP_0 + Sig1 + Sig2 + ... + RedeemScript
    
    • SegWit P2WSH: Witness stack:
       OP_0 (empty) + Sig1 + Sig2 + ... + WitnessScript
    

๐Ÿ’ป Example: Our Walletโ€™s Finalization (P2SH & P2WSH)

// Group signatures by input index
for sig in partial_sigs {
    signatures[input_index].push(sig);
}

// Sort by pubkey (BIP67)
sorted_sigs.sort_by(pubkey_order);

// Build final unlocking data
if is_p2sh {
    // Legacy P2SH scriptSig
    OP_0 + all_sigs + redeem_script
} else {
    // SegWit P2WSH witness stack
    [OP_0] + all_sigs + witness_script
}
Enter fullscreen mode Exit fullscreen mode

SegWit version is cheaper in fees and immune to txid malleability.


โš– Side-by-Side: Normal vs Multisig (With SegWit)

Feature Normal Multisig (Legacy) Multisig (SegWit)
Keys 1 keypair N keypairs N keypairs
Signatures/input 1 M M
Unlocking data [sig, pubkey] OP_0 + sigs + redeem script Witness stack: OP_0 + sigs + witness script
Fee efficiency Medium High cost Lower cost
Txid malleable? Yes (legacy) Yes (legacy) No (SegWit)

๐ŸŒ Why SegWit Multisig Rocks

  • Lower fees: Witness data gets a weight discount.
  • No txid malleability: Safer for complex protocols like Lightning.
  • Future-ready: Works with Taproot for even more privacy.
  • Same multisig benefits: More security, shared control, auditability.

๐Ÿ›  When to Use

  • Single-sig SegWit: Everyday wallet, low fees.
  • Multisig SegWit: Treasury, cold storage, shared accounts โ€” but with cost savings and malleability protection.

๐Ÿ’ก Key takeaway:

SegWit doesnโ€™t change the rules of multisig โ€” it just makes them cheaper, faster, and safer.

If youโ€™re setting up a new multisig today, use SegWit (P2WSH) unless you need legacy compatibility.

Top comments (0)