SegWit (Segregated Witness)
Segregated Witness (SegWit) is a Bitcoin protocol upgrade activated in August 2017 that separates transaction signature data from the transaction structure. It fixed transaction malleability, increased effective block capacity, and enabled second-layer protocols like the Lightning Network.
How It Works
Before SegWit, transaction signatures (witness data) were included in the transaction data used to calculate the transaction ID (txid). This meant anyone could slightly modify the signature without invalidating it, changing the txid before the transaction confirmed. This "transaction malleability" bug made it impossible to reliably chain unconfirmed transactions — a prerequisite for payment channels and the Lightning Network.
SegWit solved this by moving witness data to a separate structure excluded from the txid calculation. This eliminated the main source of third-party malleability, making txids reliable for chaining unconfirmed transactions. As a bonus, SegWit introduced a new block weight measurement system, effectively increasing block capacity from approximately 1 MB to around 1.5-2 MB of actual transaction data without increasing the raw block size limit.
SegWit was activated as a soft fork via BIP141, maintaining backward compatibility with older nodes. SegWit addresses use the bech32 format (starting with bc1q), which provides better error detection than legacy address formats. Using SegWit addresses is strongly recommended for all self-custody users — they reduce fees and improve security. Note that Taproot uses its own address format (bc1p, bech32m) distinct from SegWit v0 (bc1q, bech32), though both are part of the SegWit framework.
Key Points
- Fixed transaction malleability by separating witness data from the txid
- Increased effective block capacity through the weight-based measurement system
- Enabled the Lightning Network and other second-layer protocols
- Activated as a backward-compatible soft fork in August 2017
- Bech32 addresses (bc1q) provide lower fees and better error detection