We heard a lot about Segregated Witness or SegWit a few years back. What is Segregated Witness? It is a soft fork method that removes signature data from transactions to increase the blocks’ capacity (size). Simply put, a soft fork is simply a backward-compatible method of upgrading the blockchain.
en.bitcoinwiki.org describes Segregated Witness this way: (a bit techie I agree:)
“Segregated Witness (abbreviated as SegWit) is an implemented protocol upgrade intended to provide protection from transaction malleability and increase block capacity. SegWit defines a new structure called a witness that is committed to blocks separately from the transaction Merkle tree. This structure contains data required to check transaction validity but is not required to determine transaction effects. In particular, signatures and redeem scripts are moved into this new structure, which does not count towards the traditional 1 MB block size limit.“
“Instead, a new weight parameter is defined, and blocks are allowed to have at most 4 million weight units (WU). A byte in the original 1 MB zone of the block weighs 4 WU, but a byte in a witness structure only weighs 1 WU, allowing blocks that are technically larger than 1 MB without a hard forking change. After the successful activations of OP_CLTV and OP_CSV, SegWit was the last protocol change needed to make the Lightning Network safe to deploy on the Bitcoin network.“
“Because the witness structure contains script versioning, it is also possible to make changes to or introduce new opcodes to SegWit scripts that would have originally required a hard fork to function without SegWit.“
learnmeabitcoin.com/faq/segregated-witness explains Segregated Witness in simpler language:
“BIP 141: Segregated Witness (21 December 2015). What is Segregated Witness? Segregated Witness is a proposal to change the structure of bitcoin transaction data. The main reason for doing this is to fix the problem of transaction malleability. However, this change also allows for other benefits, such as increasing the number of transactions on a blockchain”
Unsure what a soft fork is? Read my Blog titled “What is Forking?” on the Compumatrix WordPress Site.
To first understand how Segregated Witness is used to increase the capacity of the blockchain, it is essential to know how a transaction works.
How a transaction works
Transactions consist of inputs and outputs. Inputs are the culmination of previous transactions. These previous transactions give the existing account a balance used to begin new transactions. For example, in the transaction, “Alice sends 10 Bitcoins to Bob”; for this to happen, the 10 Bitcoins she is sending to Bob is the input. On the other hand, the output is the number of Bitcoins Bob would have once the transaction has completed.
Transactions made of signature data and used by senders serves to prove that the senders are the rightful owners of the account they are sending funds from in the first place. Signature data make up about 65% of Bitcoin transactions.
Bitcoin’s scaling issue
More and more people now use Bitcoin regularly. Therefore a more significant number of transactions need to be processed to be added first to blocks, then to the blockchain. This processing is known as the mining process. If you’re unsure about the mining process, check out my Blog titled “Bitcoin Mining in Simple Terms,” on the Compumatrix WordPress site.
Transactions are added to the blockchain in blocks; each block has a maximum size limit of 1 MB. This 1 MB limit created a scaling issue (scaling means room to grow basically). As more people used Bitcoin and the number of transactions increased, the size limit of a block at 1 MB is shown to be unable to handle increased volume in transactions. This caused some users to wait hours and even days to have their transactions validated and added to the blockchain.
This bottleneck (slowdown) is known as a scalability issue. The issue is that the Bitcoin network was unable to scale (grow) with the increasing number of users. And this is what Segregated Witness brought about as a solution to this scaling problem.
Remember, signature data accounts for 65% of a transaction, and a block is simply a bundle of transactions. So, by moving signature data into an extended block, freed up space is created in the original block. Extended blocks run parallel to the original blocks and are known as “side-blocks.” In this way, space is freed up in the original blocks allowing for more transactions added. This free space results in increasing the block size from 1 MB to 4 MB.