Table of contents
Lesson 13
What is SegWit?
What is SegWit?

6 min reading time

Updated

What is SegWit?

SegWit stands for Segregated Witness and is a protocol upgrade that changes the way data is stored in a blockchain. It does this by increasing the overall block size and separating the digital signature data from the transaction data. 

As the digital signature data is removed from the original block, more space is freed up to add transactions to the block. 

What is a Segregated Witness

To understand what exactly Segregated Witness means, it is important to understand how transactions on the blockchain work, and what a digital signature is.

How is a transaction recorded?

A blockchain consists of multiple systems distributed across a network of nodes. The nodes serve as the custodians of transactions on the blockchain. All transactions performed within the network are stored as copies in each node.

The transaction data stored in all nodes consists of two components: inputs and outputs. A transaction can have one or more inputs and outputs. The output is the recipient’s wallet address. The input is the sender’s wallet address. 

For the most part, a transaction consists of a signature. A signature is the part of the input which verifies that the sender owns the wallet from which the transaction is performed. Once the nodes have validated the transaction, the transaction is recorded in a block and added to the blockchain.  

The problem of too many transactions

As more and more Bitcoin transactions were made, the Bitcoin platform experienced blockage on the blockchain. The Bitcoin protocol was designed to add a new block to the blockchain every 10 minutes. These blocks were originally limited to a maximum size of one megabyte (MB). Because of this limitation, only a certain number of transactions could be recorded per block. 

In addition, 65% of this block was filled with the signature data, leaving very little space for the actual transactions.

The low number of transactions per block, combined with the fact that only one block is processed every 10 minutes, meant that the Bitcoin network could become very congested when it was busy. This is called congestion in jargon.

To avoid this problem, a radical change was made to the blockchain: SegWit. 

SegWit as solution

Bitcoin developer Pieter Wuille came up with a solution to this problem in 2015. 

He proposed to separate the digital signature, also called the witness data, from the transaction data. This process is now known as SegWit, also known as Segregated Witness. 

In a SegWit transaction, the digital signature data is extracted from the basic block and processed separately. In this way, the capacity of the blocks is better utilized, as they can now be completely filled with transactions.

The basic block together with the witness data amounts to about four MB (instead of one MB).

In addition to making better use of block capacity, SegWit also solves the problem whereby a recipient could intercept and change the sender’s transaction ID to get more coins from the sender. Given that the digital signature is decoupled from the input, the fraudulent recipient cannot change the transaction ID without also changing the digital signature. 

Where is SegWit applied?

SegWit is obviously applied to a blockchain, but not every cryptocurrency needs SegWit. Bitcoin and Litecoin (a hard fork of Bitcoin) are two cryptocurrencies that use SegWit in their blockchain. Bitcoin used a soft fork in 2017 to apply SegWit to its blockchain.

What are the advantages of SegWit?

Capacity increase

SegWit creates double the capacity of the Bitcoin network. Because the digital signature is now separate from the transaction itself, more transactions can be processed in the same block. The basic block itself does not increase in size, but because the witness data is stored separately, significantly more transactions can be placed in a single block. 

Faster transactions

Now that more transactions can be processed per block, all transactions as a whole are processed more quickly. The number of transactions per block is limited, and miners first choose the transactions that generate the most profit. Namely those with the highest transaction fees. Transactions that generate less profit therefore by default were moved to the back of the queue. However, when more transactions can be processed per block, the less profitable transactions are also processed more quickly.

Lower transaction fees

With a higher transaction speed, comes lower transaction costs. Before SegWit was implemented, you sometimes had to pay up to 100 Euros, depending on how big the transaction was and how fast it had to be done. Now, transaction fees of just a few Euros are more common.

Better security (H3)

Thanks to SegWit, it has become practically impossible to intercept and change transactions. Before the implementation of SegWit, recipients would sometimes intercept and change a sender’s transaction ID in order to allot more coins to themselves. Since the digital signature is now separated from the input, the fraudulent recipient is unable to change the transaction ID without also changing the digital signature.

What are the downsides of SegWit?

Not every node uses SegWit

Miners don’t really like SegWit. While SegWit has a bunch of upsides for users, those same upsides are downsides for nodes. Lower transaction fees translate into less profit. Six months after the implementation of SegWit, only 14% of all Bitcoin transactions were performed using SegWit. By now, more and more transactions are happening with SegWit, but still not every node has been updated.

A short-term solution for a long-term problem

Some developers believe that SegWit is not sufficient to solve the capacity problem of the Bitcoin network in the long run. With Bitcoin’s growing popularity, it is quite possible that more and more transactions will be performed and the network may still become overloaded. They argue that only far-reaching changes to the block size and the way transactions are performed can fix this.

SegWit didn’t receive an entirely warm reception in the Bitcoin community

The implementation of SegWit on the Bitcoin blockchain in 2017 resulted in several hard forks due to disagreements within the community. A hard fork is also a far-reaching intervention on the operation of a particular blockchain. The most well-known hard fork resulting from SegWit is Bitcoin Cash (BCH).

Summary

SegWit means Segregated Witness, and ensures that data can be stored differently in the blockchain. It separates the digital signature from the input of the transaction details. In this way, the block size limit increases from 1 MB to just under 4 MB. A digital signature accounts for approximately 65% of a transaction’s space. By separating the digital signature from the input of the transaction data, more transactions can be registered per block. Thanks to SegWit, the capacity of the Bitcoin network has approximately doubled.

SegWit does not just increase network capacity, it also underpins faster transactions, lower transaction fees, and a more secure network. Opponents however believe that SegWit is no more than a short-term solution to a long-term problem of the Bitcoin network. The implementation of SegWit on the Bitcoin network in 2017 also caused disagreement within the community, resulting in a number of hard forks.