The
Bitcoin network faced several difficulties as it gained more traction. Adding more blocks to the chain was necessary, but they were created every 10 minutes and limited to a maximum size of one megabyte (MB). This limitation resulted in transaction delays; it took a long time to process and validate transactions. - sometimes, hours.
Pieter Wuille introduced a scaling solution called segregated witness (SegWit). The process involves separating/segregating the signature data (witness) from the transaction data to enable more space for transactions to be stored on the block.
Without SegWit's implementation,
Bitcoin transaction validation would have become nearly impossible as
Bitcoin grew in popularity and the number of transactions increased.
In addition, SegWit also fixed a flaw in
Bitcoin’s protocol; The transaction malleability bug. The malleability bug allows nodes to tamper with TXIDs of transactions on the network. The bug was resolved by removing what is known as ‘the ‘signature data’ from the input field of a block.
In summary,
· Segregated Witness strives to prevent non-intentional transaction malleability while allowing for more transactions within a block to be stored.
· SegWit was also intended to solve the problem of blockchain size limitations which slowed
Bitcoin transactions.
Segregated Witness is an engineering solution designed to increase the storage size of a block to allow more transactions without increasing the block's size limit (discussed below). SegWit operates by separating the signature contained in the block from the transaction records and storing the signature in a different location.
Usually, data is stored in megabytes, but SegWit introduced the concept of block weight (i.e., a measurement of all the data contained in the block, including the signature and transaction data.). Because Non-SegWit blocks have a limit of 1 MB, some believe that 1 MB equals 1million weight units (WU), but weight units and megabytes are not exactly the same.
For example, a block was mined on Jan. 25, 2022. It had a size of 1.558 MB but was 3.993 million WU. Another block was mined a couple of minutes later and was 1.457 MB with a weight of 3.993 million WU. On the same day, a block of 1.188 MB was mined, with 3.993 WU. Showing that there is not necessarily a size limit in megabytes, but a limit based on the weight units, taking the block's base size and total size into account.
Source:buybitcoinworldwide.com
Each block on the
Bitcoin network contains a limited number of transactions, and only about seven blocks are processed per second. Thus, each block must carry as many transactions as possible without increasing the size of the block. Mainly for the sake of the block miners.
SegWit's primary function is to rearrange block data to store the digital signatures separately from the transaction data. In standard terms, SegWit is the segregation of witness (signature data) from transaction data. This allows more transactions to be stored in a single block. Now, how does Segregated witness process valid transactions without the signature data? SegWit assumes the signature data is only required when a block is being validated, after which it can be discarded. It provides a solution by creating two hashes, one for the transaction data called 'regular hash' and the second for the signature data and transaction data called the 'witness hash.'. Segregated witness proposes that a separate Merkle tree is created to store the witness hashes while the digital signature can be discarded.
When dealing with conventional payment methods, more than a thousand transactions are processed per minute, an amount that is incomparably more than the
Bitcoin network, which processes only about 7 blocks of transactions per second and requires a lot of time for a transaction to be processed and validated. The
Bitcoin network would have been greatly impaired or even slowed to a halt with increasing popularity if the segregated witness had not been developed. SegWit came as a solution to transaction problems and as a platform for development in the blockchain. It was developed by Pieter Wuille in 2015 and later implemented on the
Bitcoin blockchain and other networks in subsequent years.
WHY IS SEGREGATED WITNESS IMPORTANT?
The segregated witness provided solutions to the many problems blockchain networks faced, such as; limited capacity, low transaction speed, and security loopholes.
LIMITED CAPACITY
The problem of limited capacity has been explained extensively above. Still, before SegWit was introduced, the signature data could take about 60% (3million WU) of the capacity, while 40% (1million WU) is left for the transaction data. By separating the witness from the transaction data a block can store more transactions, increasing the number of transactions processed per second.
The signature contains proof that the sender truly has the funds they intend to transfer and makes it possible to prove that the transaction was not tampered with from sender to receiver. SegWit creates a block size limit of 4 WU.
LOW TRANSACTION SPEED
By increasing the size of a block to accommodate more transactions, segregated witness increases the speed of transactions since more will be processed and validated per second. Although the time required to mine blocks remains the same. The number of transactions being processed is higher.
SECURITY LOOPHOLES
The signature carried by each block is unique to that block, such that if a clause was altered, the entire output would be different. This can be seen as a security loophole of sorts. A segregated witness protects the signature from being tampered with and prevents malleability of the transaction data.
LIMITATIONS OF SEGREGATED WITNESS
INVALIDATION: Segregated witness is a scheme that assumes the signature must not be stored actually but as a hash. This becomes a problem if, later on, there is a need to validate whether such a transaction was truly signed or not, and all that is left is a hash because the original digital signature will have been discarded. This makes the information provided by blocks unreliable. See here. If a transaction is disputed, it will be impossible to prove its authenticity.
LEGAL LIMITATIONS: The solution Segregated witness provides is at risk of putting out records that can't be trusted and can be denied legal validity. Legally, if an electronic record is not stored in a form that can be reproduced/recollected accurately for reference purposes, it can be denied. Like Jerry Brito, director of coin center, some argue that the issues that could arise from an absence of data are being overestimated. If only one person held the data, it would be enough to prove the validity of the transaction. See here.
NETWORKS THAT HAVE IMPLEMENTED SEGREGATED WITNESS
Bitcoin: SegWit reached the threshold to be implemented in a block. The
Bitcoin mining pools signaled 100% support for the proposal. A period of grace was given for all miners and mining pools to upgrade their mining software to activate segregated witness, after which any block not supporting the change was rejected.
LITECOIN: LITECOIN implemented segregated witness and experienced a boost in the capacity of transactions validated.
LITECOIN's price also rose rapidly after the implementation of SegWit.
SegWit2x
Unlike SegWit, Segwit2x (S2x) was a proposal that would require a hard fork implementation. The focus of the solution was simply to double the size of the block from 1MB to 2MB. Unfortunately, the proposal was not implemented due to a lack of consensus within the
Bitcoin community and core developers. The disagreement was led due to the nature of the proposal; it was a hard fork.
A hard fork implementation results in a complete change in the blockchain codes, making the old blocks incompatible with the new chain that is created.
Source: buybitcoinworldwide.com
CLOSING THOUGHTS
SegWit poses solutions to great cryptocurrency problems but at significant risks. The speed it offers cryptocurrency transactions makes it an indispensable concept/innovation. It is constantly developing to ensure that blockchain networks remain secure and records valid when implemented.
Author: Gate.io Observer:
M. Olatunji
Disclaimer:
* This article represents only the views of the observers and does not constitute any investment suggestions.
*Gate.io reserves all rights to this article. Reposting of the article will be permitted provided Gate.io is referenced. In all other cases, legal action will be taken due to copyright infringement.