SegWit

Segregated Witness, or SegWit, is an upgrade to the Bitcoin protocol that was rolled out in 2017 through a soft fork. Its main purpose was to solve transaction malleability—a flaw where the transaction ID (txid) could be altered, making certain advanced improvements difficult. By restructuring how signature data is stored, SegWit helped enable technologies like the Lightning Network and made it easier to introduce later upgrades such as Taproot.

SegWit also improved Bitcoin’s efficiency. By shifting signature information (ScriptSig) outside the main part of transactions into a new section called the “witness,” more transactions can fit into each block. This helped reduce transaction fees and allowed Bitcoin to handle more transactions per block.

Another visible change was the introduction of a new address format called Bech32, moving away from the older Base58 format.

With SegWit, the part of the transaction that could previously be modified—the witness data—is no longer included in the calculation of the original txid, solving malleability. Instead, SegWit calculates a separate witness transaction ID (wtxid), which includes this data. Each block includes a Merkle tree of these wtxids, and the information is fully recorded on the blockchain but only required for newer, SegWit-enabled nodes to read.