The Bitcoin Core development team introduced SegWit to fix the issue of malleability bug and scalability. But what is SegWit?
Bitcoin transactions compose of two parts primarily, one is “base transaction data”, that covers which bitcoins are moved and where are they are moved to, along with some other crucial data. The other part is called the “witness”, that contains a code with cryptographic signature data establishing the validity of the transaction. SegWit stands for Segregated Witness, which means separating the signature data. It’s this signature data that can be slightly altered by anyone without invalidating the signatures, the process is referred to as “malleability bug”. This signifies that the whole transaction appearance and identifier can be altered by relaying transactions over the network. SegWit helps solve for this by separating the transaction and the witness data. Its malleability fix also provides a better platform for second-layer solutions like Lightning which are capable of executing transactions with substantially lower fees or micropayments on the Bitcoin Blockchain network.
SegWit has helped the evolution of several hardware bitcoin wallets by separating the data as it also improves the processing speed due to the reduced size of transactions. The primary difference with SegWit is that there is no longer a need for witness data while calculating a transaction ID, which is later used for spending the funds in the upcoming transactions. Whereas in the non SegWit infrastructure while composing a new transaction the wallet streams the previous transaction from blockchain and asks for specific output along with its value. After receiving the value, the wallet starts hashing the entire transaction, only if the hash matches exactly with the hash published the transaction is executed. This process becomes time-consuming and unproductive when the number of inputs is large. As hardware wallets do not hold much computing powers like a computer, it becomes challenging for hardware devices to execute the transaction. The adoption of SegWit eliminates the inefficient procedure. Instead of separating outputs, SegWit incorporates the value of previous outputs in the signature itself. Thus hardware wallets can fetch outputs of past transactions in a short span of time. Hardware wallets like Trezor and Ledger have adopted SegWit and have witnessed a significant reduction in transaction verification time and process. SegWit also serves a crucial role in enhancing security measures and the efficiency of hardware bitcoin wallets.
Reduction in the verification and discovery period of outputs can eliminate or prevent the possibility of several attacks like Fee Attack vendor, wherein users can lose a significant amount of funds due to an attack targeted towards an input within a transaction.
The upgrade to SegWit improves the user experience as well, as there is less need for them to wait for earlier slow confirmations. But how? If signature changes from one valid signature to another valid signature, the transaction ID does not change. It becomes reasonably safe for transaction 2 to be created and broadcasted to the network before transaction 1 has been verified in the blockchain network.
For Bitcoin, a vital question has always been hovering around regarding how to increase the network’s scalability to achieve faster transactions and greater use. SegWit solves for the scalability issue as well, as the digital signatures occupy approximately 65% of the space in a given transaction. SegWit attempts to ignore the data attached to a signature by separating the signature from within the input and placing it to a structure towards the end of a transaction. This process increases the 1 MB limit for block sizes to a little under 4 MB. Along with slightly increasing the capacity size of blocks, SegWit also solves for a situation where a receiver could intercept and modify the sender’s transaction ID in an attempt to get more coins from the sender. Since the digital signature is separated from the input, the unscrupulous party has no means of altering the transaction ID without also nullifying the digital signature.
Another positive aspect of SegWit is the reduction in the transaction cost by approximately 35 percent. With the reduced fees the users can easily send Bitcoin transactions with fees below $1.
Along with numerous benefits and future opportunities, some risks are also attached to SegWit. SegWit opens the pathway for the formation of mining cartels and methods of collusion which could undermine the bitcoin network. With the Non- SegWit infrastructure there are quantitative restrictions with regards miners, but with SegWit mining cartels can be formed and may harm the network as a whole. Also, there are notions that it might not actually reduce the burden on the network.
When examined using the legal lens another potent risk is authentication. Once the witness is separated, establishing legal proof and authenticity of electronic contracts and transactions would be difficult. This legal issue could create some major practical problems in the business world globally.
The upgrade to SegWit is optional and must be decided after properly analyzing the business use case of the network. The wallets that have adopted SegWit share a positive outlook towards it.