Segregated Witness (SegWit)
Segregated Witness (SegWit) is an upgraded protocol developed in 2015. This concept was introduced to solve the scalability issues facing blockchain networks today.
On average, the Bitcoin network verifies a new block every 10 minutes, and each block contains several transactions. In this way, the block size directly affects the number of transactions that can be confirmed in each block. Currently, the Bitcoin blockchain is capable of processing about 7 transactions per second.
The main idea of Segregated Witness is to reorganize block data so that signatures are no longer stored with transaction data. In other words, the SegWit upgrade consists of isolating validators (signatures) from transaction data. This enables more transactions to be stored in a single block, thereby increasing the transaction throughput of the network.
Since only about 7 transactions can be processed per second, Bitcoin transactions can sometimes take a long time to complete. Compared to traditional payment solutions and financial networks, which can process thousands of transactions per second, the speed is much slower.
Segregated Witness was developed and upgraded in 2015 by Bitcoin developer Pieter Wuille and other Bitcoin Core contributors. In August 2017, the Segwit upgrade was implemented as a soft fork on the Bitcoin network.
Today, there are several cryptocurrency projects using the Segregated Witness protocol, including Bitcoin and Litecoin. The protocol upgrade brings many advantages, such as increased transaction speed and block capacity. In addition, SegWit also solves the so-called transaction malleability problem (described below).
What are the main advantages of SegWit?
Increase capacity
One of the biggest advantages of SegWit is the increase in block size. By removing signature data from transaction inputs, more transactions can be stored in a block.
A transaction consists of two main parts: input and output. Essentially, the input contains the sender's public address, and the output contains the receiver's public address. However, the sender must prove that they have transferred the funds and must use a digital signature.
Without Segregated Witness, signed data can take up to 65% of a block. With Segregated Witness, the signed data is removed from the input of the transaction. This increases the effective block size from 1 MB to about 4 MB.
Note that SegWit is not just a block size increase. Rather, it is an engineering solution to increase the effective block size without increasing the block size limit (which would require a hard fork). More specifically, the actual block size is still 1 MB, but the effective block size is limited to 4 MB.
In addition, Segregated Witness introduces the concept of block weights. We can think of block weights as an alternative to the concept of block size. Essentially, block weight is a unit of measure that includes all block data: including transaction data (1 MB) and signature data (up to 3 MB), which are no longer part of the input field.
Transaction speed increased
In addition to storing blocks of more transactions, Segregated Witness can also increase transaction speed due to the large amount of transaction data that may be stored in the blockchain. Even though the block time is the same, more transactions can be accommodated in the block, so the TPS will be higher.
Increased transaction speeds can also help reduce transaction costs on the Bitcoin network. Before SegWit was implemented, fees per transaction were mostly above $30. However, with the implementation of SegWit, transaction costs have been drastically reduced to $1 per transaction.
Transaction malleability fixes
Another major problem Bitcoin faces is tampering with transaction signatures. If the signature is tampered with, it can lead to the destruction of the transaction between the two parties. Since the data stored on the blockchain is effectively immutable, invalid transactions are permanently stored on the blockchain.
With SegWit, the signature is no longer part of the transaction data, eliminating the possibility of changing this data. This fix supports further innovation within the blockchain community, including Layer 2 protocols and smart contracts.
Segregated Witness and Lightning Network
By fixing the transaction scalability issues, development of the second layer protocol is required. Simply put, a second layer protocol is a new platform or product built on top of a blockchain such as Bitcoin. One of the more popular second-layer protocols is the Lightning Network, an off-chain offline payment network.
The Lightning Network is a second layer protocol that runs on the Bitcoin network. The main purpose of the Lightning Network is to enable more transactions to be confirmed in a shorter period of time, resulting in faster transactions for users. Transactions are collected off-chain, effectively forming a buffer for final processing by the Bitcoin network.
The Lightning Network was originally developed for Bitcoin. However, several other cryptocurrency and blockchain projects are also working to implement the technology. Not only will this reduce confirmation time, but it will facilitate the development of solutions to scalability problems.
SegWit and SegWit2x
SegWit is a soft fork upgrade, which means it supports backward compatibility. In other words, Bitcoin nodes that have not updated SegWit are still able to process transactions. However, there is another implementable version of SegWit called SegWit2x (S2X), which requires a hard fork upgrade.
The main difference between SegWit and SegWit2x is that the latter will not only include changes to transaction batching, but also increase the block size (from 1MB to 2MB). Nonetheless, larger block sizes increase the burden on node operators and miners as they process more data.
Another notable difference is that the SegWit proposal is backed and executed by the Bitcoin community. It also gave birth to the concept of UASF, which stands for user-activated soft fork.
On the other hand, SegWit2x proposes substantial changes to the ground rules governing Bitcoin. But SegWit2x was eventually suspended due to the inability of developers to reach consensus on its adoption and implementation.
Difference between Nested SegWit and Native SegWit (bech32)
In short, native SegWit (also known as bech32) is an updated version of nested SegWit. bech32 addresses increase transaction speed, provide better error detection mechanisms, and even lower transaction fees. Also, bech32 addresses are in lowercase, making them easier to read. Note that transactions between non-Segwit (i.e. original Bitcoin addresses, aka Legacy), Nested SegWit and SegWit (bech32) addresses are fully compatible. But not all exchanges and crypto wallets support SegWit, so you can't send funds directly to a Segregated Witness address that doesn't support SegWit. Binance already supports BTC deposit and withdrawal for SegWit addresses. For more information, please refer to the SegWit FAQ.
Summarize
The implementation of SegWit marks a major upgrade to the Bitcoin protocol, which is also supported and implemented by the distributed community, making it even more attractive.
The launch of SegWit can effectively solve the problems related to Bitcoin and other blockchain networks, especially an important step in scalability. Through the combination of SegWit and the second layer protocol, the blockchain network can process a large number of transactions with higher efficiency and lower cost.
Although SegWit is a powerful and innovative solution, it is not yet fully rolled out. Currently, about 53% of Bitcoin addresses use the SegWit protocol.
Last updated