Home › Glossary › SegWit (Segregated Witness)

SegWit (Segregated Witness)

Also called: SegWit, Segregated Witness, SegWit v0, BIP 141, BIP141, native SegWit.

SegWit (Segregated Witness) is the 2017 soft fork that moved signatures into a separate witness, fixing malleability and introducing block weight.

SegWit, short for Segregated Witness, is a soft fork that separates signature data (the witness) from the rest of a transaction. It was specified mainly in BIP 141 by Eric Lombrozo, Johnson Lau and Pieter Wuille, and activated at block 481,824 on 24 August 2017.

What SegWit changed

  • Malleability fix. Signatures no longer affect the txid, ending third-party transaction malleability. That made chains of unconfirmed transactions safe, which the Lightning Network depends on.
  • Block weight. The 1 MB size limit became a limit of 4,000,000 weight units, with witness bytes counted at a quarter of the cost (block weight, vbytes).
  • New signature hashing. BIP 143 signs the input amount and avoids quadratic hashing (sighash).
  • Script versioning. Witness versions 1 to 16 were left for future upgrades; version 1 became Taproot.

SegWit output types and addresses

Native SegWit outputs are P2WPKH and P2WSH, with bech32 addresses starting bc1q (BIP 173). Nested SegWit wraps them in P2SH for older wallets (addresses starting with 3).

The SegWit BIPs

BIP Covers
141 Consensus rules
143 Signature hashing
144 Peer-to-peer serialization
145 getblocktemplate changes
147 NULLDUMMY malleability fix
173 Bech32 addresses

Activation in 2017 went through BIP 9 miner signaling, the BIP 148 user-activated soft fork proposal and BIP 91, which locked SegWit in. More in the SegWit guide and BIP 141 vs BIP 341.

BIPs that define SegWit (Segregated Witness)

Related terms

  • Witness: The witness is the part of a SegWit transaction that holds signatures and scripts, kept out of the txid so it can't be changed to alter the transaction ID.
  • Block weight: Block weight is the SegWit-era measure of block size: non-witness bytes count 4 units and witness bytes 1, with a limit of 4,000,000 weight units.
  • Transaction malleability: Transaction malleability is the ability to change a transaction's ID without changing what it does, for example by re-encoding its signatures.
  • P2WPKH: P2WPKH (Pay to Witness Public Key Hash) is the native SegWit single-key output type. Its bc1q addresses are always 42 characters long.
  • Bech32: Bech32 is the checksummed base32 address format from BIP 173, used for native SegWit version 0 addresses that start with bc1q.

Learn more

Guides