Segwit: Understanding The Innovation Behind Bitcoin's Improvement
Victim of its success, the Bitcoin network is experiencing congestion issues: cryptocurrency transactions take longer to be validated and fees are higher. It is in this context that Segwit comes to light, carrying the improvement proposal number BIP141. It is a soft fork of Bitcoin that allows to address the scalability of the network. In addition to improving the performance of the ecosystem, this upgrade also provided better security to transactions. But how does Segwit exactly improve the BTC blockchain? We explain everything in this comprehensive guide.
What is Segwit?
This word is a contraction of the term Segregated Witness, which means “separate witness.” It represents a significant improvement to the Bitcoin protocol implemented in 2017. As the name suggests, BIP141 allows for a separation of the data from the digital signature of the cryptocurrency transaction witness.
A soft fork of the Bitcoin protocol
Segwit was deployed via a soft fork, meaning a backward-compatible update of the consensus rules. This means that the change remains minor, as compatibility with the previous version of the ecosystem is maintained. When improvements are not backward-compatible, it is called a hard fork.
BIP141 modifies the structure of transactions by moving the signature data (witness) into a separate database (segregated).
The origin of Segwit
SegWit originated in 2015 when a team from the Bitcoin Core client was seeking to resolve congestion issues within the ecosystem. Pieter Wuille, a developer and co-founder of Blockstream, first introduced this idea. It mainly aimed to correct transaction malleability and increase the transactional capacity of the ecosystem.
BIP141 also aims to improve signature verification and facilitate future modifications to the ecosystem. Several different cryptocurrency networks are currently using this optimization. Notable examples include Litecoin, Bitcoin Gold, VertCoin, and Decred.
Operation of Segwit
Although conceived in 2015, this improvement was only activated in 2017 due to a major debate within the community. But how does it actually work? To understand, we will explain the modifications it brings.
How does Segwit solve Bitcoin’s scalability issues?
One of the biggest limitations of using Bitcoin is its scalability problem. Scalability denotes the ability of the ecosystem to be used on a larger scale. Regarding Bitcoin, the network takes a long time to process cryptocurrency transactions, and the fees are high depending on the number of transactions on the blockchain.
This is, therefore, the first issue that BIP141 seeks to address.
To achieve this, the concept of separating witnesses will separate the signature data from the transaction data. This helps to reduce the size or dimension of the transaction, thereby increasing the number of cryptocurrency transfers per block and the ecosystem’s capacity. Since this improvement, fees are measured based on the weight of the transaction rather than its size, resulting in a significant reduction in fees.
Segwit and block size
The other major modification brought by BIP141 is the weight of the blocks. Previously, the dimension of a transaction was based on size expressed in bytes. The size limit of the ecosystem’s blocks was 1 MB. Since the application of BIP141, it is now expressed in weight units (WU) which is a weighted average of the transaction dimension without the witness and the size of the witness.
A SegWit block has a weight of 4 million WU (MWU), which corresponds to 4 MB of data. This increase in the maximum size allows for an increase in the transaction capacity of the ecosystem.
How does SegWit correct transaction malleability?
Before understanding malleability, note that each cryptocurrency transfer has an identifier represented as a string of hexadecimal characters. The identifier is a fingerprint of the transaction that depends on the elements present in the cryptocurrency transfer, such as inputs and outputs. A modification of one of these elements thus causes a change in the identifier.
In Bitcoin, it is possible to modify the identifiers of traditional transactions without invalidating them. It is said that traditional transactions are malleable. This is made possible due to signatures, which poses a danger when malicious third parties modify identifiers with the intent to harm.
The concept of separating witnesses thus corrects malleability by moving the unlocking scripts containing the signatures into a separate data structure accompanying the transaction called the witness. The calculation of the identifier then becomes immutable, as it no longer considers this separate witness. A second identifier created allows for the full coverage of the transaction.
Other improvements of Segwit
The improvement of the signature algorithm for Segwit transfers has allowed for:
- Avoiding redundant hashes during signature verification,
- Improving security in offline signing used by hardware wallets, by taking transaction input amounts into account.
It also brings other improvements such as:
- Script versioning,
- Improved flexibility and confidentiality of stand-alone contracts,
- New address types: P2WPKH, P2WSH, etc.
What is a soft fork?
Before understanding the impact of improvement BIP141 on the Bitcoin ecosystem, one must first comprehend what a soft fork is. This will allow you to understand the debates surrounding the creation of the witness separation concept. It is a type of backward-compatible improvement to a blockchain protocol. This means that older nodes that are not updated can continue to function.
In a soft fork, new rules are added to the ecosystem without making significant changes to the consensus rules. This improvement therefore seeks to bring enhancements or minor modifications to the blockchain. However, the community has pointed out that BIP141 has still brought about profound changes, thus contributing to the debates and divergences that led to Bitcoin forks.
Impact of Segwit on the Bitcoin Blockchain
It provides a solution to various issues encountered by the ecosystem. However, it has been the subject of intense debates within the community, delaying its implementation.
The advantages of Segwit on the blockchain
BIP141 offers two main advantages for the ecosystem.
- Security: correction of malleability
Previously, a third party could alter a code or series of codes, including a transaction identifier (TXID). This system allowed an attacker to modify the identifier at will as long as the transaction was not yet confirmed. In such a situation, it would then be impossible to trace a certain TXID in the ecosystem, as it has been altered.
Such a problem could fuel user distrust and break the network’s trust. The implementation of BIP141 has made malleability attacks impossible.
- Performance: network scalability
The BTC ecosystem has long been criticized for its lack of scalability. A transaction can take hours to be confirmed, which also increases the cost of the transaction.
Thanks to the increase in block size, the network can raise the number of transactions processed per second. SegWit has thus enabled a reduction of commission fees and an increase in transaction validation speed.
Criticisms of Segwit
Although BIP141 has brought its share of improvements, it is not without weaknesses that opponents have pointed out.
- The debates raised within the Bitcoin community
Miners and major market players, namely proponents of on-chain scalability, opposed the adoption of this concept.
Here are the main criticisms leveled against this improvement:
- Complexity of implementation: the concept brings a profound change that should have been implemented as a hard fork ;
- Network effect coercion: forces the more liberal party to follow the more restrictive party;
- Absence of a real increase in block size: older nodes maintain their limit at 1 MB.
These criticisms are not always founded, but the controversy surrounding this concept remains very real. This has led to the creation of the Bitcoin Cash hard fork.
- The deep changes brought by Segwit
The second main flaw of BIP141 is related to the criticisms made by opponents. The update leads to deep restructurings of transactions. All miners who do not comply with the new rules may find their blocks rejected by the network.
This improvement also brings a significant technical debt. For example, the complexity of the underlying code leads to a new interpretation of scripts related to new addresses.
Segwit and the Future of Bitcoin
The BIP141 is seen as one of the most important improvements to the BTC ecosystem. It has indeed laid the groundwork for network scalability protocols.
The Role of Segwit in the Evolution of Bitcoin
The fixing of malleability constitutes a major technological evolution. It has allowed for new solutions for scalability. This is the case of the Lightning Network, which is a layer 2 solution. It is a decentralized ecosystem allowing for instant, peer-to-peer, and nearly free payments.
It is a network of bidirectional payment channels, as it allows repeated payments between two people without incurring transaction fees. After BIP141, there were other improvement proposals such as Taproot, Liquid Network, or FediMint.
Segwit and Future Updates of Bitcoin
The known future improvements include:
- Bitcoin Core 24: modification of how nodes download blocks and the replace-by-fee option;
- Update for Bitcoin Cash to support CashTokens.
Many forks are under development and information about them remains limited, but we can still mention:
- Anonymous Bitcoin: combination of proof of work and proof of stake,
- BitcoinZeroX: combination of BTC and Hexxcoin to create a more anonymous blockchain.
What are the Advantages and Disadvantages?
Segwit offers the following advantages:
- Increased speed of the ecosystem due to the reduction in block size,
- Faster transactions,
- Correction of transaction malleability,
- Feature utilized by many services using BTC,
- Compatibility with older versions,
- Facilitates new developments such as the Lightning Network.
This improvement, however, presents many limitations:
- A slow and limited adoption,
- Complications arising from the profound changes of Segwit,
- Low increase in the ecosystem capacity: average block size around 1.2 MB during usage peaks,
- The reduction of transaction privacy, worsening the user experience due to new addresses,
- Incomplete signature verification optimization, not completely solving the hashing problem,
- Complexification of the technique: new interpretation of scripts related to new addresses.
Conclusion
You will have understood that Segwit has brought many improvements to Bitcoin. It has also opened the way for other improvements that address scalability issues in a more elaborate manner. Unfortunately, it still suffers from many limitations that have not fully resolved the scalability problem. Bitcoin Diamond, a variant of Bitcoin, was created to try to remedy some of these limitations, offering potential advantages in terms of transaction speed and capacity. However, this technological innovation has also brought its share of complexities. Although used by many people, the adoption of this concept remains slow and limited.
FAQs
This is an ecosystem update deployed by a Bitcoin soft fork. It addresses the issues of transaction malleability and network scalability. By increasing block size, this feature aims to increase the ecosystem’s capacity to process transactions.
Yes, it was created to improve network security and eliminate the malleability of unconfirmed transactions. Its use has never posed any major security problems. It has been widely tested and used since its creation in 2017.
Also known as bech32, Native Segwit is a new format for the original. It is more weight-efficient and detects errors more easily. Using Native Segwit means lower fees and faster transactions.
Maximize your Cointribune experience with our "Read to Earn" program! For every article you read, earn points and access exclusive rewards. Sign up now and start earning benefits.
L'équipe éditoriale de Cointribune unit ses voix pour s’exprimer sur des thématiques propres aux cryptomonnaies, à l'investissement, au métaverse et aux NFT, tout en s’efforçant de répondre au mieux à vos interrogations.
The views, thoughts, and opinions expressed in this article belong solely to the author, and should not be taken as investment advice. Do your own research before taking any investment decisions.