What Is SegWit? Explaining Bitcoin's Protocol

dYdX
What Is SegWit? Explaining Bitcoin's Protocol What Is SegWit? Explaining Bitcoin's Protocol

For Bitcoin's (BTC) core developers, 2017 was a contentious time. As BTC gained mainstream attention following a massive rally, issues such as high transaction fees, network congestion, and slow confirmation speeds reared their ugly heads. More people than ever before were using BTC, but their experience of transferring their virtual coins wasn’t the smoothest.

These pain points highlighted the need for Bitcoin scalability for the development community, but everyone had a different solution to this crisis. Despite many arguments and rifts during this uncertain time, one protocol emerged as the leading solution: Segregated Witness (SegWit).

Although SegWit's implementation didn't solve Bitcoin scalability, it significantly altered the way BTC operated. Let’s discover what SegWit is, how it works, and how it laid the groundwork for Bitcoin's future development. 

What is SegWit?

Developer Pieter Wuille first introduced SegWit at 2015's Scaling Bitcoin conference, and supporters of this idea drew formal designs for SegWit in three Bitcoin Improvement Proposals (BIPs): 91, 141, and 148. After years of debate within the crypto community, Bitcoin developers implemented SegWit in August 2017, and SegWit is activated to this day.

SegWit is a soft fork upgrade to the Bitcoin Network that changed BTC transaction data stored on Bitcoin’s digital payment ledger. Unlike hard fork upgrades, a soft fork is backward-compatible, meaning nodes already on a cryptocurrency's protocol don't need to update their software to continue validating BTC transactions.  

What's the purpose of SegWit? 

SegWit's main goal was to improve Bitcoin's scalability efforts without creating a new blockchain through a hard fork. As Bitcoin's user base grew, issues such as long processing times and high network fees became major roadblocks to mass adoption. If BTC were to become a viable mainstream payment option, developers needed a way to increase its average throughput of seven transactions per second (TPS) to compete with altcoins and traditional payment options like Visa, Mastercard, and PayPal. 

One proposed solution was to increase Bitcoin's data capacity per block from the one megabyte (MB) standard, but this seemingly simple fix went against Bitcoin's core design. If developers increased the MB size per block, they'd force every node on the current BTC blockchain to shift to a new network (i.e., a hard fork). 

The SegWit protocol aimed to prevent splintering the Bitcoin community by respecting the 1 MB limit and rearranging data within each block for peak efficiency. SegWit's data storage update also allowed layer-2 protocols—particularly the Lightning Network—to build on top of Bitcon's blockchain and introduce innovative scalability initiatives. 

How does SegWit work? 

To improve Bitcoin's scalability without introducing a block size increase, developers turned their attention to a software bug called transaction malleability. Although it didn't threaten confirmed Bitcoin transaction data, the bug made it possible for users to alter the unique identifier associated with each BTC transaction (aka the transaction ID). This issue is more of a nuisance than a major security threat because there's still no way to rewrite confirmed BTC transfer data, but it hindered scalability initiatives. With this bug in BTC's system, projects and exchanges couldn't use transaction IDs from unconfirmed transactions as a basis to speed up payment processing. 

To reduce transaction malleability and increase total BTC transfers per block, SegWit developers introduced a concept called block weight to measure data capacity. Unlike the inflexible 1 MB pre-SegWit block size, block weight assigns different weight units using the following formula:

  • Block weight = base transaction size * 3 + total transaction size

SegWit segregates the witness data—or the cryptographic signatures BTC traders use to authenticate their private keys—from the base transaction information, such as the sender (input) and receiver (output). While this new system technically increases Bitcoin's block capacity to 4 MB, it maintains the essential 1 MB standard for the base data because the witness portion of each transaction is now off-chain. 

Today, only nodes that upgrade to SegWit's system see the witness confirmations, while those that remain on the legacy Bitcoin Network assume the validity of witness data and see the 1 MB of base transaction details. Splitting this information in each block allows more room to squeeze extra transfers into the base transaction data, easing network congestion. 

Why is SegWit controversial? 

SegWit aimed at scaling the Bitcoin blockchain while preserving a close-knit network, but it inadvertently created sharp divisions within the BTC community. One primary issue among many miners and developers was SegWit’s insistence on maintaining the 1 MB limit for transaction data rather than expanding Bitcon's block size with a hard fork upgrade. According to this argument, the Bitcoin Network can't scale efficiently if it doesn't adopt larger block sizes to handle higher transaction volumes from a global audience. Bitcoin developers in support of bigger blocks eventually left the Bitcoin blockchain to launch the hard fork Bitcoin Cash (BCH) with 8 MB block sizes (now 32 MB per block) and later Bitcoin SV (BSV).

Beyond the block size debate, some critics raised questions over new security concerns SegWit brought to the Bitcoin Network. For example, SegWit introduced a new script versioning system, making it easier for developers to introduce soft fork upgrades to Bitcoin's code, which some argued introduced unforeseen code vulnerabilities to the blockchain. Some critics also argued fixing transaction malleability by removing witness data opened the door for threats or manipulation from external scaling solutions and third-party services.   

Are all Bitcoin wallets SegWit wallets?

Despite SegWit's successful implementation, not all Bitcoin nodes or crypto wallets integrate with this updated network. If traders want to take advantage of SegWit's efficiency enhancements, they must carefully consider the opening phrase in their Bitcoin wallet's public address

A Bitcoin SegWit address either starts with a bc1 or 3, but non-SegWit (aka Legacy) Bitcoin addresses start with a 1. The bc1 format is also called the native SegWit or bech32 address and offers users maximum space efficiency and the most human-readable addresses. Bitcoin wallets with a 3, however, are Pay-to-Script-Hash (P2SH) addresses and tend to be easier for Legacy wallets to interpret because they wrap SegWit's new script in P2SH script. 

There have been instances where older Legacy wallets didn't understand the script in bc1 addresses, but many of today's hardware and software wallets offer SegWit compatibility. The biggest difference between using Legacy and SegWit wallets is the latter typically has higher transaction fees and slower confirmation speeds. But to be extra safe, crypto traders often double-check whether their sending and receiving BTC addresses work with bech32 (if they use native SegWit to send crypto). 

Expand your Bitcoin knowledge with dYdX Academy 

Brush up on the basics of Bitcoin with the resources on dYdX Academy. On our education hub, crypto-curious readers can access articles explaining essential elements of Bitcoin's blockchain, including crypto mining and proof-of-work algorithms. dYdX also offers eligible traders a straightforward way to access Bitcoin perpetuals—and dozens of altcoin perps—through a secure decentralized trading platform. Check out our official blog for up-to-date news on dYdX's derivatives trading suite, and eligible traders can start trading on dYdX today. 

Disclosures

The content of this article (the “Article”) is provided for general informational purposes only. Reference to any specific strategy, technique, product, service, or entity does not constitute an endorsement or recommendation by dYdX Trading Inc., or any affiliate, agent, or representative thereof (“dYdX”). Use of strategies, techniques, products or services referenced in this Article may involve material risks, including the risk of financial losses arising from the volatility, operational loss, or nonconsensual liquidation of digital assets.  The content of this Article does not constitute, and should not be considered, construed, or relied upon as, financial advice, legal advice, tax advice, investment advice, or advice of any other nature; and the content of this Article is not an offer, solicitation or call to action to make any investment, or purchase any crypto asset, of any kind.  dYdX makes no representation, assurance or guarantee as to the accuracy, completeness, timeliness, suitability, or validity of any information in this Article or any third-party website that may be linked to it.  You are solely responsible for conducting independent research, performing due diligence, and/or seeking advice from a professional advisor prior to taking any financial, tax, legal, or investment action.

You may only use the dYdX Services in compliance with the dYdX Terms of Use available here, including the geographic restrictions therein.

Any applicable sponsorship in connection with this Article will be disclosed, and any reference to a sponsor in this Article is for disclosure purposes, or informational in nature, and in any event is not a call to action to make an investment, acquire a service or product, or purchase crypto assets.  This Article does not offer the purchase or sale of any financial instruments or related services.

By accessing this Article and taking any action in connection with the information contained in this Article, you agree that dYdX is not responsible, directly or indirectly, for any errors, omissions, or delays related to this Article, or any damage, injury, or loss incurred in connection with use of or reliance on the content of this Article, including any specific strategy, technique, product, service, or entity that may be referenced in the Article

Legitimacy and Disclaimer

Crypto-assets can be highly volatile and trading crypto-assets involves risk of loss, particularly when using leverage. Investment into crypto-assets may not be regulated and may not be adequate for retail investors. Do your own research and due diligence before engaging in any activity involving crypto-assets.

dYdX is a decentralised, disintermediated and permissionless protocol, and is not available in the U.S. or to U.S. persons as well as in other restricted jurisdictions. The dYdX Foundation does not operate or participate in the operation of any component of the dYdX Chain’s infrastructure.

The dYdX Foundation’s purpose is to support the current implementation and any future implementations of the dYdX protocol and to foster community-driven growth in the dYdX ecosystem.

The dYdX Chain software is open-source software to be used or implemented by any party in accordance with the applicable license. At no time should the dYdX Chain and/or its software or related components be deemed to be a product or service provided or made available in any way by the dYdX Foundation. Interactions with the dYdX Chain software or any implementation thereof are permissionless and disintermediated, subject to the terms of the applicable licenses and code. Users who interact with the dYdX Chain software (or any implementations thereof) will not be interacting with the dYdX Foundation in any way whatsoever. The dYdX Foundation does not make any representations, warranties or covenants in connection with the dYdX Chain software (or any implementations and/or components thereof), including (without limitation) with regard to their technical properties or performance, as well as their actual or potential usefulness or suitability for any particular purpose, and users agree to rely on the dYdX Chain software (or any implementations and/or components thereof) “AS IS, WHERE IS”.

Nothing in this post should be used or considered as legal, financial, tax, or any other advice, nor as an instruction or invitation to act by anyone.  Users should conduct their own research and due diligence before making any decisions. The dYdX Foundation may alter or update any information in this post in the future at its sole discretion and assumes no obligation to publicly disclose any such change. This post is solely based on the information available to the dYdX Foundation at the time it was published and should only be read and taken into consideration at the time it was published and on the basis of the circumstances that surrounded it. The dYdX Foundation makes no guarantees of future performance and is under no obligation to undertake any of the activities contemplated herein.

dYdX is a decentralised, disintermediated and permissionless protocol, and is not available in the U.S. or to U.S. persons as well as in other restricted jurisdictions. The dYdX Foundation does not operate or participate in the operation of any component of the dYdX Chain's infrastructure.

Nothing in this website should be used or considered as legal, financial, tax, or any other advice, nor as an instruction or invitation to act in any way by anyone. You should perform your own research and due diligence before engaging in any activity involving crypto-assets due to high volatility and risks of loss.

Depositing into the MegaVault carries risks. Do your own research and make sure to understand the risks before depositing funds. MegaVault returns are not guaranteed and may fluctuate over time depending on multiple factors. MegaVault returns may be negative and you may lose your entire investment.

The dYdX Foundation does not operate or has control over the MegaVault and has not been involved in the development, deployment and operation of  any component of the dYdX Unlimited software (including the MegaVault).

Crypto-assets can be highly volatile and trading crypto-assets involves risk of loss, particularly when using leverage. Investment into crypto-assets may not be regulated and may not be adequate for retail investors. Do your own research and due diligence before engaging in any activity involving crypto-assets.