In 2017, Litecoin activated a brand new protocol called ‘Segregated Witness’ (‘SegWit’ for short). Its primary purpose was to change the common ways of data storage. This article will serve as a comprehensive explanation of what it is and its overarching appeal.
What is it?
Segregated Witness is a protocol upgrade whose intention is to provide protection from ‘transaction malleability.’ In addition, it aims to increase block capacity. It is a process where the block size limit on a blockchain increases by removing signature data from Bitcoin transactions. By removing parts of a transaction, this makes enough space/capacity to add more transactions to the chain.
‘Segregate’ (obviously) means to separate, and ‘Witnesses’ are the transaction signatures. So, by putting these terms together, it means to separate transaction signatures. The ‘witness’ contains data that’s a requirement for checking the validity of transactions. However, it is not a requirement for determining transaction effects.
Following the successful activations of OP_CLTV and OP_CSV, SegWit was the final protocol change that made the Lightning Network safe to deploy on the Bitcoin network. The new witness field consists of Script versioning. Because of this, changes can be made to SegWit scripts. Not only that, but it’s also possible to introduce new opcodes to those scripts.
Before we get too technical, let’s instead break down the concept behind SegWit. To do this, we will need to bring up the subject of the Bitcoin blockchain.
A brief blockchain overview
The Bitcoin blockchain contains multiple systems from across a peer-to-peer network. These systems are ‘nodes’ and they serve as the administrators of Bitcoin transactions. All transactions that carry out in Bitcoin are duplicated across these nodes. Therefore, it becomes next to impossible to hack into and corrupt a transaction.
The transaction data that the array of nodes will share consists of two components: the inputs and the outputs. There can usually be the involvement of one or multiple inputs and outputs in a transaction. The output is the public address of the recipient, and the input is the public address of the sender.
The sender needs the recipient’s public address if they want to send funds to him/her. The bulk of the space within a transaction contains a signature which is a part of the input. It confirms that the sender has the funds they need to have in order to make a payment. Bitcoin will move from inputs to outputs for each transaction that transfers. As soon as the nodes validate the transaction, the transaction goes to the block. Following this addition, the block goes to the chain or the general ledger for public access.
The Bitcoin issue
There is a persistent problem that the Bitcoin platform is actively facing. That being the execution of more and more transactions leading to the addition of more blocks to the chain. The generation of blocks occurs every 10 minutes and the maximum size is 1 megabyte (MB). Due to this constraint, the number of transaction additions to the block is very specific.
The general bulk of the transactions is weighing down the network and creating delays in transaction processing and verification. In some cases, it can take hours to confirm a transaction as being valid. Look at it this way: all Bitcoin transactions dating back to the platform’s 2009 inception are piling up on the blockchain. In the long run, the system would cease to be sustainable if a change isn’t made.
Aaron van Wirdum, a Bitcoin Magazine writer, explains that:
“Transactions are still valid and will move the bitcoins from the same place to the same place, under all the same conditions. However, it does complicate creating newer transactions depending on unconfirmed transactions: New transactions need to know the transaction identifier they rely on. This, in turn, makes it significantly harder to build certain second-layer protocols on top of Bitcoin, like bi-directional payment channels.”
This is where Dr. Pieter Wuille, a bitcoin developer, comes in. He suggested that the digital signature needs to be subject to segregation from the transaction data. This process is what would go on to become SegWit.
Digital signatures take up roughly 65% of the space in any given transaction. SegWit sets out to ignore the data of a signature. To do this, it strips the signature from within the input and moves it to a structure towards a transaction’s conclusion. This increases the 1 MB limit for block sizes to about a little under 4 MB.
Additionally, SegWit solves the issue in which a receiver may interrupt and modify the sender’s transaction ID. This suspicious act is done in a bid to obtain more coins from the sender. Due to the digital signature’s detachment from the input, the corrupt party cannot change the ID without abolishing the signature.
If you recall, Segregated Witness has a role in the development of the Lightning Network, as well as other second layer protocols. The malleability fix makes any feature relying on questionable transactions less risky and much easier to design. The Lightning Network further boosts Bitcoin’s transaction capacity by partitioning small, frequent transactions off-chain.
SegWit’s activation increases the development of various other features. One of these is MAST, which allows for more complex Bitcoin smart contracts. Another is Schnorr signatures, which later led to another transaction capacity boost. A third feature is TumbleBit, which is an anonymous top-layer network.
Backlash to Segregated Witness
With all the good elements pertaining to SegWit, that doesn’t mean it’s not susceptible to criticisms. Like with other seemingly perfect systems, there are a few drawbacks that keep it from being truly impeccable. For instance, a prominent critique from many people is that SegWit is not entirely the solution for Bitcoin’s own shortcomings. Many believe it to be, at best, a temporary fix; a case of “kicking the can down the road”, so to speak.
Resistance against Segregated Witness was one of the primary factors behind the development of Bitcoin Cash. This is basically a fork of the Bitcoin network. It chooses to implement a larger block size limit rather than be dependant on a new transaction structure.
It’s difficult to predict what will become of Segregated Witness in the future, however, there’s no denying its overall impact has been monumental so far.