Bitcoin’s Woes

Blocks are largely comprised of transaction data, which in turn mostly consist of signature information and are used to create transaction IDs.

One persistent issue in Bitcoin’s original protocol has been malleability, as these transaction IDs can be rewritten before a miner includes them in a block. Fraudsters can trick users into sending their coins twice if the other side only has the original transaction ID and can’t verify if there is another pending transaction with the same data.

Although this has been fixed by the majority nodes and wallet services, it nevertheless makes interdependent transactions very unreliable. For instance, if someone is waiting for an incoming transaction to be confirmed, they could theoretically use this information as proof of balance. But merchants are not inclined to accept it, as malleability exposes this transaction information to changes by a third party.

The Long and Winding Road

Segregated Witness, or SegWit, was first put forward by Pieter Wuille in 2015. Seeing the enormous impact Bitcoin’s malleability had on the network as a whole, he suggested a patch that would provide a permanent fix and open new possibilities for Bitcoin. Regardless of how relevant his proposal was, it was not implemented right away.

Overall, it took the community the better part of the two years after the initial proposal to come to terms with the idea and release it on the mainnet. There were many ideas floating around on how to activate SegWit with minimal damage. One that probably attracted the most public attention was SegWit2x, a hard fork proposed by miners and other businesses in May 2017 and aimed to double the block size in addition to SegWit.

However, it failed to gain traction, and a user activated soft fork (UASF) eventually took over as the main driver of SegWit adoption. Known as Bitcoin Improvement Proposal (BIP) 148, it was activated on August 1st, 2017, which is often referred to as the Bitcoin Independence Day. BIP 148 revealed the power that users and nodes hold in the network.

Introduction of SegWit caused the split in the community leading to the creation of Bitcoin Cash. This fork was created by a group of Bitcoin activists and promoted by Roger Ver with a goal to expand the block size limit and achieve a higher throughput within the same block times. Unlike Bitcoin and Litecoin, this cryptocurrency does not see malleability as a real issue and thus does not plan to deal with it in the near future.

And yet even now, as of March 2019, SegWit accounts for barely half of all transactions in Bitcoin. Many nodes and wallets in particular are reluctant to part with higher fees, and they refuse to store what can be described as a sidechain without due compensation.

It is worth mentioning that Litecoin, a brainchild of Charlie Lee and a fork of Bitcoin, had implemented SegWit on its blockchain over 3 months before Bitcoin. Furthermore, it has a larger share of transactions being done with Segwit.

The Nitty Gritty

To understand just how SegWit works, we first need to briefly go over how Bitcoin transactions are handled:

First, a user signs and submits a transaction to the network. After some time the transaction is included in a block by a miner. Other nodes verify and accept the transaction thereby cementing it in the ledger.

Each block produced without SegWit is limited to 1MB and, as mentioned above, contains the transaction data, two-thirds of which is taken up by digital signatures.