What Is SegWit?

Beginner1/24/2023, 11:14:41 AM
Segregated Witness (SegWit) is an update in the Bitcoin blockchain that separates the witness data from the base block. It is aimed at scaling the network.

On the Bitcoin network, miners are tasked with the responsibility of verifying transactions and adding new blocks. In return, they are rewarded with newly minted bitcoins. These tasks require sophisticated computer hardware to carry out. The computers act as validators and are referred to as nodes.

As the number of users on the network keeps growing, more transactions need to be verified and more blocks added. The Bitcoin block size is limited to 1MB and new blocks are created every 10 minutes. Each block on the network contains on average 2,700 transactions, with a processing speed of 7-8 transactions per second. This limits the number of transactions that could be processed as well as the number of transactions added to a block. All these led to a slowdown in the Bitcoin network.

To solve this issue, developer Pieter Wuille proposed the Idea of Segregated Witness (SegWit) at the scaling Bitcoin conference held in December 2015. Initially, this idea was to fix a bug on the network known as a malleability bug. The bug allows anyone on the network to tamper with transaction data. Separating the witness data from the base block provided a solution to this bug as well as scaling the blockchain. So in this article, we will explore how SegWit helped to handle these issues on the Bitcoin network.

What Is SegWit?

Segregated Witness (SegWit) is an update in the Bitcoin blockchain that separates the witness data from the base block. It is an improvement aimed at solving the issue of malleability bugs and scaling the network. By segregating the witness data from the base block, more space is created in the block and more transactions could be accommodated without altering the original block size of 1MB.

The idea of SegWit was proposed by developer Pieter Wuille in 2015. SegWit divides the transaction into two parts. The witness data is separated from the base block but remains part of the blockchain. The original part contains the wallet address of the sender and receiver and the other part contains scripts and signatures. This segregation gives room for more transactions in a block. Also by removing the witness data from the base block, no one will be able to alter an unconfirmed transaction in the network. Bitcoin is not the first blockchain to activate this idea. SegWit was activated on Litecoin (LTC) in May 2017, followed by Bitcoin on 23rd August 2017.

Issues Addressed by SegWit

SegWit helped to address two major problems faced by the blockchain. One is scalability issues followed by transaction malleability. Let’s dive deeper into these problems and see how they were handled with the introduction of SegWit.

Scalability

Sending and receiving Bitcoin requires 2 vital pieces of information. A public address and a private key. The receiver provides his public address used to receive funds and this address is visible to the whole network. On the other hand, the sender uses his private key to sign the transactions as proof he is the owner of the wallet containing the funds.

The user who wants to send the Bitcoin sends a request to the network. This request contains the receiver’s public address, the amount to be sent and the miner’s fee. The request is then turned into a line of code known as transaction ID. The transaction is processed and queued on the network. When the block limit is reached, the block is broadcasted to the entire nodes. If the block is accepted as a valid block by more than half of the nodes, it will be added to the blockchain. At this point, we say a transaction is successful.

As the network grew larger with more users and more transactions, processing transactions became very slow. This issue was traced back to the size limit of blocks within the blockchain. With the witness data included in the block, there is limited space for transactions. This leads to congestion and corresponding high transaction costs. With these issues, the idea of Bitcoin being used as a fast and inexpensive method of transaction is eluded.

Transaction Malleability

This is another major issue addressed with the introduction of SegWit. Transaction malleability is a form of denial service attack (DoS) that allows someone to make changes to the transaction code before the transaction is confirmed. This act can hardly be spotted since it is done in a way that when you check the transaction, it remains valid but when hashed, produces something entirely different. But by placing the witness data away from the base block, no one will be able to alter the transaction. Even if such happens, it will be invalid and will not affect the initial transaction.

Let’s use an example to understand this better. James wants to send 20 BTC to Jane. He broadcast this request to the network. The request will contain Jane’s public address, the 20 BTC, transaction fees and his private key as proof he has the funds to send. This is known as the witness data. The information is converted into a single line of code known as transaction ID. Now in the process of waiting for the transaction to be confirmed, the code allows Jane to alter the witness data while the transaction ID remains the same. In so doing, no one will suspect any harm has taken place. This alteration overwrites the original transaction and Jane receives the 20 BTC.

For her selfish reasons, Jane calls James complaining that she hasn’t received the 20 BTC. After checking, he discovers that the transaction did not go through and goes ahead to send another 20 BTC to Jane. In this case, no one would be able to detect Jane’s evil plan. Moreover, any record added to the blockchain is immutable and can’t be erased. So in this scenario, nothing can be done about it. By removing the witness data and placing it outside the base block, no one can overwrite a transaction.

Other Benefits of SegWit

SegWit had a great impact on the Bitcoin network. Apart from addressing the issue of scalability and transaction malleability, other advantages came with the development, some of which include:

Faster and Cheaper Transactions

When a large number of people are making use of the network at the same time, this causes so much delay in transactions. In addition to this, there will also be a corresponding increase in the cost of transactions since lots of people are in the queue. Moving the witness data from the base blockchain did not just create more space in the block but it also helped to increase throughput and lowered transaction costs.

Paves the Way for Layer 2 Scaling Solutions

The idea of layer 2 scaling solutions such as Lightning network will not be birthed without SegWit. Layer 2 scaling solutions strongly rely on the main blockchain for security. In a situation where anyone can alter the data on the main network and the security of the blockchain is compromised, what will be the fate of its derivatives? SegWit helped address this security issue giving room for new improvement and development.

Setback of SegWit

Despite scaling the Bitcoin blockchain and providing a solution to transaction malleability, not everyone supports this development. This has led to several hard forks of the network.

Prominent among them is the hard fork that birthed Bitcoin Cash (BCH) in 2017. Most miners are not in support of this development as lower fees affect their profit. Moreover, the idea of supporting the witness data sidechain doesn’t give them any benefit. This has been a challenge to the wide adoption of SegWit.

SegWit is also seen by many as a short-term solution to a long-term problem. They claim that SegWit doesn’t do much in scaling the network, but rather it is a stepping stone that will aid more development in the future.

Is SegWit a Soft Fork?

Soft forks are improvements to a blockchain that doesn’t give rise to a new blockchain. So from all indications, SegWit is a soft fork of the Bitcoin network that has contributed greatly to the advancement of the network.

Conclusion

SegWit has been a great improvement to the Bitcoin network, scaling as well as improving the security of the entire network. It was one of the earliest advancements made to scale the network and it has paved the way for bigger developments.

Despite all these, not everyone in the Bitcoin community embraced the idea as a permanent solution to scaling and security. This has led to different hard forks of the blockchain, having in mind that these new blockchains will incorporate larger block sizes than Bitcoin.

With everything we have seen so far, what is your take on this development? Do you consider it a temporary solution? Think about it and see you next time!

Autore: Unique
Traduttore: Binyu
Recensore/i: Matheus, Edward, Joyce, Ashley
* Le informazioni non sono da intendersi e non costituiscono consulenza finanziaria o qualsiasi altro tipo di raccomandazione offerta da Gate.io.
* Questo articolo non può essere riprodotto, trasmesso o copiato senza menzionare Gate.io. La violazione è un'infrazione della Legge sul Copyright e può essere soggetta ad azioni legali.

What Is SegWit?

Beginner1/24/2023, 11:14:41 AM
Segregated Witness (SegWit) is an update in the Bitcoin blockchain that separates the witness data from the base block. It is aimed at scaling the network.

On the Bitcoin network, miners are tasked with the responsibility of verifying transactions and adding new blocks. In return, they are rewarded with newly minted bitcoins. These tasks require sophisticated computer hardware to carry out. The computers act as validators and are referred to as nodes.

As the number of users on the network keeps growing, more transactions need to be verified and more blocks added. The Bitcoin block size is limited to 1MB and new blocks are created every 10 minutes. Each block on the network contains on average 2,700 transactions, with a processing speed of 7-8 transactions per second. This limits the number of transactions that could be processed as well as the number of transactions added to a block. All these led to a slowdown in the Bitcoin network.

To solve this issue, developer Pieter Wuille proposed the Idea of Segregated Witness (SegWit) at the scaling Bitcoin conference held in December 2015. Initially, this idea was to fix a bug on the network known as a malleability bug. The bug allows anyone on the network to tamper with transaction data. Separating the witness data from the base block provided a solution to this bug as well as scaling the blockchain. So in this article, we will explore how SegWit helped to handle these issues on the Bitcoin network.

What Is SegWit?

Segregated Witness (SegWit) is an update in the Bitcoin blockchain that separates the witness data from the base block. It is an improvement aimed at solving the issue of malleability bugs and scaling the network. By segregating the witness data from the base block, more space is created in the block and more transactions could be accommodated without altering the original block size of 1MB.

The idea of SegWit was proposed by developer Pieter Wuille in 2015. SegWit divides the transaction into two parts. The witness data is separated from the base block but remains part of the blockchain. The original part contains the wallet address of the sender and receiver and the other part contains scripts and signatures. This segregation gives room for more transactions in a block. Also by removing the witness data from the base block, no one will be able to alter an unconfirmed transaction in the network. Bitcoin is not the first blockchain to activate this idea. SegWit was activated on Litecoin (LTC) in May 2017, followed by Bitcoin on 23rd August 2017.

Issues Addressed by SegWit

SegWit helped to address two major problems faced by the blockchain. One is scalability issues followed by transaction malleability. Let’s dive deeper into these problems and see how they were handled with the introduction of SegWit.

Scalability

Sending and receiving Bitcoin requires 2 vital pieces of information. A public address and a private key. The receiver provides his public address used to receive funds and this address is visible to the whole network. On the other hand, the sender uses his private key to sign the transactions as proof he is the owner of the wallet containing the funds.

The user who wants to send the Bitcoin sends a request to the network. This request contains the receiver’s public address, the amount to be sent and the miner’s fee. The request is then turned into a line of code known as transaction ID. The transaction is processed and queued on the network. When the block limit is reached, the block is broadcasted to the entire nodes. If the block is accepted as a valid block by more than half of the nodes, it will be added to the blockchain. At this point, we say a transaction is successful.

As the network grew larger with more users and more transactions, processing transactions became very slow. This issue was traced back to the size limit of blocks within the blockchain. With the witness data included in the block, there is limited space for transactions. This leads to congestion and corresponding high transaction costs. With these issues, the idea of Bitcoin being used as a fast and inexpensive method of transaction is eluded.

Transaction Malleability

This is another major issue addressed with the introduction of SegWit. Transaction malleability is a form of denial service attack (DoS) that allows someone to make changes to the transaction code before the transaction is confirmed. This act can hardly be spotted since it is done in a way that when you check the transaction, it remains valid but when hashed, produces something entirely different. But by placing the witness data away from the base block, no one will be able to alter the transaction. Even if such happens, it will be invalid and will not affect the initial transaction.

Let’s use an example to understand this better. James wants to send 20 BTC to Jane. He broadcast this request to the network. The request will contain Jane’s public address, the 20 BTC, transaction fees and his private key as proof he has the funds to send. This is known as the witness data. The information is converted into a single line of code known as transaction ID. Now in the process of waiting for the transaction to be confirmed, the code allows Jane to alter the witness data while the transaction ID remains the same. In so doing, no one will suspect any harm has taken place. This alteration overwrites the original transaction and Jane receives the 20 BTC.

For her selfish reasons, Jane calls James complaining that she hasn’t received the 20 BTC. After checking, he discovers that the transaction did not go through and goes ahead to send another 20 BTC to Jane. In this case, no one would be able to detect Jane’s evil plan. Moreover, any record added to the blockchain is immutable and can’t be erased. So in this scenario, nothing can be done about it. By removing the witness data and placing it outside the base block, no one can overwrite a transaction.

Other Benefits of SegWit

SegWit had a great impact on the Bitcoin network. Apart from addressing the issue of scalability and transaction malleability, other advantages came with the development, some of which include:

Faster and Cheaper Transactions

When a large number of people are making use of the network at the same time, this causes so much delay in transactions. In addition to this, there will also be a corresponding increase in the cost of transactions since lots of people are in the queue. Moving the witness data from the base blockchain did not just create more space in the block but it also helped to increase throughput and lowered transaction costs.

Paves the Way for Layer 2 Scaling Solutions

The idea of layer 2 scaling solutions such as Lightning network will not be birthed without SegWit. Layer 2 scaling solutions strongly rely on the main blockchain for security. In a situation where anyone can alter the data on the main network and the security of the blockchain is compromised, what will be the fate of its derivatives? SegWit helped address this security issue giving room for new improvement and development.

Setback of SegWit

Despite scaling the Bitcoin blockchain and providing a solution to transaction malleability, not everyone supports this development. This has led to several hard forks of the network.

Prominent among them is the hard fork that birthed Bitcoin Cash (BCH) in 2017. Most miners are not in support of this development as lower fees affect their profit. Moreover, the idea of supporting the witness data sidechain doesn’t give them any benefit. This has been a challenge to the wide adoption of SegWit.

SegWit is also seen by many as a short-term solution to a long-term problem. They claim that SegWit doesn’t do much in scaling the network, but rather it is a stepping stone that will aid more development in the future.

Is SegWit a Soft Fork?

Soft forks are improvements to a blockchain that doesn’t give rise to a new blockchain. So from all indications, SegWit is a soft fork of the Bitcoin network that has contributed greatly to the advancement of the network.

Conclusion

SegWit has been a great improvement to the Bitcoin network, scaling as well as improving the security of the entire network. It was one of the earliest advancements made to scale the network and it has paved the way for bigger developments.

Despite all these, not everyone in the Bitcoin community embraced the idea as a permanent solution to scaling and security. This has led to different hard forks of the blockchain, having in mind that these new blockchains will incorporate larger block sizes than Bitcoin.

With everything we have seen so far, what is your take on this development? Do you consider it a temporary solution? Think about it and see you next time!

Autore: Unique
Traduttore: Binyu
Recensore/i: Matheus, Edward, Joyce, Ashley
* Le informazioni non sono da intendersi e non costituiscono consulenza finanziaria o qualsiasi altro tipo di raccomandazione offerta da Gate.io.
* Questo articolo non può essere riprodotto, trasmesso o copiato senza menzionare Gate.io. La violazione è un'infrazione della Legge sul Copyright e può essere soggetta ad azioni legali.
Inizia Ora
Registrati e ricevi un buono da
100$
!