From the LBank blog.
The Segregated Witness protocol, otherwise known as SegWit, emerged as a promising scalability solution as transaction volumes continuously increased.
SegWit stands for “Segregated Witness,” where Segregated is to separate, and Witness refers to the transaction signatures involved with a particular transaction.
The Bitcoin core development team proposed the Segregated Witness protocol upgrade in 2015 to improve the scalability of the blockchain network. It was first activated as a soft fork on the Bitcoin network in August 2017.
The protocol upgrade has been beneficial to many cryptocurrency projects, including Litecoin and Bitcoin.
What is Segregated Witness (SegWit)?
SegWit is a protocol upgrade (soft fork) to a network such as Bitcoin that makes BTC transaction sizes smaller and enables Bitcoin to process more transactions at once (scalability). It accomplishes this by separating Bitcoin signature from transaction data.
How it all started
When Bitcoin was in its infancy, scalability improvements were not needed since transactions were cheap and fast, and there were so few users. In recent years, however, there have been hundreds of thousands of transactions per day, which made the need for network upgrades more pressing.
On August 24th, 2017, the Bitcoin network underwent a hard fork, splitting the blockchain into two separate networks: Bitcoin (BTC) and Bitcoin Cash (BCH). This hard fork was the result of a long-standing debate within the Bitcoin community over how to best scale the Bitcoin network to accommodate more users.
BTC, the original Bitcoin network, implemented a software upgrade called SegWit, which helped to increase the efficiency of the Bitcoin network by reducing the size of transaction data.
By implementing SegWit, Bitcoin blocks now have more room for transaction data.
SegWit aids the network in enhancing its processing power without affecting the size of the Bitcoin blockchain as a whole. In other words, SegWit makes the blockchain network more efficient.
Furthermore, the percentage of SegWit transactions has been growing rapidly over the years. The graph below shows the Bitcoin Segwit adoption from 2017 to date.
SegWit and the Lightning Network
Upon SegWit’s activation, the Lightning Network launched as a secondary layer on top of Bitcoin. Lightning Network was doomed to fail until SegWit.
The Lightning Network was first proposed in 2015 as a way to help the Bitcoin network scale. However, the network struggled to gain adoption and was often criticised for being too complex.
SegWit, which was activated in August 2017, helped to address some of the issues with the Lightning Network. SegWit increased the block size limit and made it easier to send transactions off-chain. This helped to make the Lightning Network more user-friendly and increased its adoption.
Today, the Lightning Network is one of the most popular scaling solutions for the Bitcoin network. It has helped to improve the network’s scalability and has made it possible for users to send transactions faster and at a lower cost.
What does SegWit solve?
SegWit supports the reduction of the weight of transactions in a block by separating a transaction into two sections. The first part contains the wallet addresses of the sender and receiver, while the second part is the transaction signature or witness data. As a result, the witness data is removed from the main blockchain, consuming less space and facilitating faster transaction processing in each block.
SegWit fixes the malleability bug, which had previously allowed attackers to modify transaction data. The Segregated Witness protocol upgrade develops a sidechain for storing witness data instead of on the main blockchain, making it unavailable for modifications.
You could isolate signatures from transaction data by using SegWit. The segregation of witnesses or signatures from the transaction data aids in recording more transactions in a single block.
In addition, the Bitcoin network validates every new block in an average time of about ten minutes. Therefore, the number of transactions each block can confirm depends critically on the block size. The Bitcoin blockchain network is currently capable of processing nearly 7 transactions per second. With SegWit, Bitcoin is now able to handle more transactions than ever before, and the network has become more robust and secure.
SegWit Bitcoin wallet addresses
Currently, there are three types of Bitcoin wallet addresses: Legacy wallet, SegWit wallets and Native SegWit wallet addresses.
Legacy address (P2PKH)
A legacy address uses a distinct script hash function called P2PKH (Pay-to-Pubkey Hash), which starts with the number 1, which consists of upper and lowercase characters.
Legacy SegWit, also known as the Pay-to-PubKey Hash (P2PKH), is the oldest and the original Bitcoin address. It is still in use today and is fully compatible with the SegWit protocol. However, some newer wallets and exchanges do not support it.
P2PKH addresses are used to send and receive payments. They are also used to store Bitcoins in a wallet. P2PKH addresses are generated from a public key and a private key. The public key is used to generate the address, and the private key is used to sign transactions.
P2PKH addresses are not as secure as other address types, such as P2SH or P2WPKH. This is because they do not use SegWit, which is a protocol that improves security.
SegWit wallet addresses (P2SH)
SegWit addresses start with the number 3 and offer more advanced capabilities than conventional addresses. It employs a P2SH “pay to script hash” script function, which is frequently used for multisig addresses and could mean that several digital signatures are needed to verify a transaction.
Native SegWit (P2WPKH or Bech32 address)
SegWit address is the newer format with lower fees. It is an upgraded version of the Bitcoin protocol that allows for faster and more efficient transactions. This upgrade splits the transaction data into two parts: the witness and the rest of the transaction. This change enables more transactions to be stored in each block, leading to faster and more efficient transactions.
Native SegWit launched in 2019 and its addresses start with bc1q.
To date, SegWit has been the most significant update to the Bitcoin protocol. It is even more intriguing due to the fact that it has the advantage of improving scalability in a way that witness data is recorded on a sidechain while the root code is stored on the main blockchain.
Thanks to SegWit and the second-layer protocols, blockchain networks can process a larger number of transactions while reducing costs.
Disclaimer: The opinions expressed in this blog are solely those of the writer and not of this platform.
This article came directly from the LBank blog, found on https://medium.com/lbank/what-is-segregated-witness-segwit-what-does-it-solve-11a45473f59c?source=rss-87c24ae35186——2