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.