Everything You Need to Know About SegWit
Welcome to the next guide from Superorder educational series. In this section, we study basic and advanced topics related to cryptocurrencies, blockchains, and everything related to them. Today, our hero is Segregated Witness or SegWit — a Bitcoin soft fork that boosted its scalability drastically. Let’s try to reveal what is SegWit, how it works, what are its advantages and downsides. Let’s go!
Understanding Segregated Witness
As you know, BTC blocks include information about transactions. Before SegWit, all blocks also included signatures leaving only around 1 MB of free space for transaction data in each block. Thus, the average speed of the Bitcoin network was near 7 TPS. This also led to high fees — over $30 per one deal.
Technically, SegWit was a successful soft fork (backward-compatible change) of Bitcoin protocol that was introduced in 2015 and activated in 2017. It separated transaction info and signatures placing the latter on sidechains. Thus, SegWit blocks now have 4 MB of space for transactions instead of 1 MB in legacy blocks.
In a nutshell, SegWit targeted two core goals:
- Fix the transaction malleability. The structure of blocks allows users to change transaction IDs before their confirmation. Thus, frauds can pretend that transactions never happened. Segregated Witness removes the essential part — signatures — from transaction data so malleability attack becomes impossible.
- Boost Bitcoin scalability. Because SegWit blocks don’t include up to 65% of data booked for signatures, they can contain more transaction information itself. This speeds up the network, reduces fees, and improves scalability. Although processing time remains the same, each block holds more data so TPS rises.
It’s worth mentioning that the initial ideologist of SegWit, Pieter Wuille, introduced the upgrade as a fix for malleability. Only during the next dev stages, he found that this fork can increase the effective size of BTC blocks. Today, the update is valid both for Bitcoin and Litecoin but it’s not obligatory — you can use both SegWit and legacy addresses.
SegWit Pros & Cons
Pros
- Better network scalability.
- Cool Bitcoin developments possible.
- Increased block capacity.
- Increased transaction speed.
- Reduced transaction fees.
- The end of transaction malleability.
Cons
- A temporary solution to scalability issues.
- Disagreements that led to hard forks.
- The relatively slow rise of adoption.
SegWit2x and BCH
Continuing the story, we should mention a not as successful upgrade of Bitcoin blockchain. Known as SegWit2x, it was presented to the community at the same period as SegWit. The second version provided for not only signature separation but for increasing the \block size to 2 MB. However, instead of a soft fork, developers offered to run a hard fork — an inevitable change that would require all participants to switch to new blocks.
The result: SegWit2x failed. There was never an official upgrade based on its ideas. But authors run hard fork — just to create Bitcoin Cash with 8 MB block size.
The Lightning Network
Finally, we want to take a look at the on-chain solution that also focused on scalability improvements. Called the Lightning Network, it allows people to open private payment channels between two crypto addresses. The final confirmation occurs only when a channel is closed so the network faces way lower burden. Here’s an example of how it works:
- Alice makes websites for Bob and gets 0.5 BTC per one page.
- Bob pays for each project done just after its finish.
- In a month, Alice created three pages and received 1.5 BTC in total.
- In a traditional network, there would be three transactions per 0.5 BTC.
- In the Lightning Network, there’s one transaction of 1.5 BTC at the month’s end.
As you can see, it’s convenient and beneficial for participants. The catch is that this upgrade became possible thanks to SegWit. Without it, malicious actors could easily alter IDs of microtransactions wreaking havoc.
Final Words
SegWit was a major milestone in the history of Bitcoin. It helped the community to realize its power, to move towards better cooperation. Today, we can discuss the advantages and drawbacks of the decision. And even if strengths are more convincing, critics continue blaming SegWit. But we should understand that it was a great improvement. Thanks to SegWit, many crypto developers can continue working.
If you liked the article, clap and share it! Also, subscribe to Superorder channels on Facebook, Twitter, and Telegram. See you!