SegWit

{{Short description|Soft fork change in the transaction format of Bitcoin}}

{{Technical|date=October 2024}}

{{Copy edit|date=October 2024}}

File:Segwit.svg

Segregated Witness, or SegWit, is the name used for an implemented soft fork change in the transaction format of bitcoin.

The formal title "Segregated Witness (Consensus layer)" had Bitcoin Improvement Proposal number BIP141.[https://github.com/bitcoin/bips/ All Bitcoin Improvement Proposals, including BIP141] The declared purpose was to prevent nonintentional bitcoin transaction malleability, allow optional data transmission, and to bypass certain protocol restrictions (such as the block size limit) with a soft fork.[https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki Segregated Witness proposal BIP 141] Segregated Witness was activated on 24 August 2017.

It was also intended to mitigate a blockchain size limitation problem that reduces bitcoin transaction speed. It does this by splitting the transaction into two segments, removing the unlocking signature ("witness" data) from the original portion and appending it as a separate structure at the end.[http://www.investopedia.com/terms/s/segwit-segregated-witness.asp Investopedia: SegWit (Segregated Witness)] The original section would continue to hold the sender and receiver data, and the new "witness" structure would contain scripts and signatures. The original data segment would be counted normally, but the "witness" segment would, in effect, be counted as a quarter of its real size.

History

=Block size limit=

Bitcoin is a cryptocurrency, a form of currency using cryptography to keep transactions secure.{{cite book |last1=Adrian |first1=Tobias |last2=Griffoli |first2=Tommaso Mancini |title=The Rise of Digital Money |date=15 July 2019 |publisher=International Monetary Fund |isbn=978-1-49832-490-8 |url=https://www.imf.org/en/Publications/fintech-notes/Issues/2019/07/12/The-Rise-of-Digital-Money-47097}} A collection of bitcoin transactions prefaced by a block header, protected by proof of work, and recorded on a network of computers is called a "block". All blocks are tied together sequentially by using a cryptographic hash on the previous block and storing its output in the next. This forms a blockchain.[https://developer.bitcoin.org/devguide/block_chain.html Block Chain]

Each block contains information about who sends and receives a given unit of bitcoin (a transaction), as well as the signature(s) that approves each transaction. Originally, there was no limit to the size of blocks. However, this allowed malicious actors to make up fake "block" data that was very long as a form of denial-of-service attack (DoS attack). These fake blocks would be detected, but doing so would take a very long time, slowing down the whole system.[https://developer.bitcoin.org/devguide/transactions.html Transactions] Therefore, a block size limit of 1 MB was introduced.

=Scalability and malleability=

{{unreferenced section|date=November 2019}}

The current bitcoin blockchain design is regarded as having two shortcomings.

== Scalability ==

{{main|Bitcoin scalability problem}}

A new block is added to the chain at random intervals averaging, by design, ten minutes (proof of work causes this delay). Together with the limit on block-size, this limits the number of transactions that can be processed in a given time. Some sites work around this problem using "off-chain payments" conducting transactions without writing them to the blockchain, which involves various trade offs regarding trust and transaction finality.[https://developer.bitcoin.org/devguide/contracts.html#micropayment-channel Micropayment Channel] Others have proposed changes to bitcoin that would reform the block format in a backward-incompatible way. For example, FlexTrans (Flexible Transactions) would make transactions smaller by changing how they are described to a "tag" system, allowing more transactions per block. This is not compatible with systems that do not upgrade.{{Citation needed|date=January 2023}}

== Malleability ==

{{main|Transaction malleability problem}}

A transaction uses unused outputs from a previous transaction(s) known as unspent transaction outputs (UTXO). This results in a chain of related transactions linked by their transaction identifier. However, it is possible for someone to change (mutate) unconfirmed bitcoin transactions without making them invalid, which changes the transaction's identifier, making child transactions invalid (i.e., link between transactions are broken).[https://developer.bitcoin.org/devguide/transactions.html#transaction-malleability Transaction Malleability]

=Segregated witnesses as a solution=

The signature data called the witness would be separated from the Merkle tree record of who is sending or receiving the bitcoins. The witness data is moved to the end, and each byte of it would only count as one quarter of a "unit".{{Citation needed|date=January 2023}} It also addresses signature malleability, by serializing signatures separately from the rest of the transaction data, so that the transaction ID is no longer malleable.

Activation

The activation window for the SegWit upgrade started at Midnight 15 November 2016 UTC, and would run until Midnight 15 November 2017 UTC.

SegWit would only be activated once at least 95% of miners signaled readiness for the upgrade across a target adjustment period of 2016 blocks.

On 9 August 2017 a milestone was reached when 100% of miners between blocks 477,792 to 479,807[https://learnmeabitcoin.com/beginners/guide/segwit/#activation-timeline SegWit Activation timeline] signaled support for SegWit, which meant the SegWit upgrade was "locked in" and would be fully activated roughly two weeks later at the start of the following target adjustment period.

Segregated Witness was then activated on 24 August 2017 at block height 481,824. The bitcoin price rose almost 50% in the week following SegWit's activation.{{cite news |last1=Vigna|first1=Paul|title=Bitcoin Rallies Sharply After Vote Resolves Bitter Scaling Debate|url=https://blogs.wsj.com/moneybeat/2017/07/21/bitcoin-rallies-sharply-after-vote-resolves-bitter-scaling-debate/ |access-date=26 January 2020 |publisher=WSJ |date=21 July 2017}} On 21 July 2017, bitcoin was trading at $2,748, up 52% from 14 July 2017's $1,835.

SegWit alleviates the scaling problem in two ways:

  • SegWit solves transaction malleability, thereby enabling the Lightning Network, an overlay network of micropayment channels, hypothetically resolving the scaling problem by enabling virtually unlimited numbers of instant, low-fee transactions to occur "off chain".{{cite web |last1 = Graham |first1 = Luke |title = As bitcoin comes off its record high, the next step is to avoid a 'lightning fork' |url = https://www.cnbc.com/2017/08/09/bitcoin-segwit-milestone-paves-way-for-lightning-network.html |website = CNBC |access-date = 23 November 2017 |date = 9 August 2017 |url-status = live |archive-url = https://web.archive.org/web/20171201031323/https://www.cnbc.com/2017/08/09/bitcoin-segwit-milestone-paves-way-for-lightning-network.html |archive-date = 1 December 2017 |df = dmy-all }}

Initially, most bitcoin transactions have not been able to use the upgrade.{{Citation needed|date=January 2023}}

In the first week of October, the proportion of network transactions using SegWit rose from 7% to 10%, indicating an increase in use rate.{{Citation needed|date=September 2022}}

A small group of mostly China-based bitcoin miners, that were unhappy with bitcoin's proposed SegWit improvement plans, pushed forward alternative plans for a split which created Bitcoin Cash.{{cite news |last1=Irrera |first1=Anna |last2=Chavez-Dreyfuss |first2=Gertrude |title=Bitcoin 'clone' sees a slow start following split|url=https://www.independent.co.uk/news/business/news/bitcoin-cash-latest-news-clone-digital-currency-encrypted-privacy-dark-web-a7872081.html |access-date=22 June 2018 |publisher=Independent |date=2 August 2017}}

As of February 2018, SegWit transactions exceed 30%.{{cite news |url=https://ftalphaville.ft.com/2019/06/12/1560351485000/SegWit-and-the-bitcoin-transaction-fee-conspiracy-theory/ |title=SegWit and the bitcoin transaction fee conspiracy theory |work=FT Alphaville |publisher=FT|date=2018-03-21 }}

=SegWit2x=

Segregated Witness (BIP141) should not be confused with SegWit2x (SegWit2Mb). In May 2017, Digital Currency Group (not to be confused with the Digital Currency Initiative of the MIT Media Lab) announced it had offered a proposal, referred to as SegWit2x ("the New York Agreement"), activating Segregated Witness at an 80% threshold of the total bitcoin hash rate, signaling at bit 4; and activating a 2 MB block size limit within six months with support in excess of 80% of the total bitcoin hash rate.{{Cite news |url=http://www.econotimes.com/Leading-bitcoin-ecosystem-participants-reach-consensus-on-scaling-issue-723854 |title=Leading bitcoin ecosystem participants reach consensus on scaling issue |access-date=23 June 2017 |date=25 May 2017 |work=Econo Times }}

As of mid-2017, the SegWit2x proposal had support from over 90% of the hash rate. However, the proposal has been controversial due to the limitation of project work to an invitation-only group of developers. In mid-July 2017, it became evident that miners favored implementing the Segwit part of the agreement before the 1st of August 2017 UASF, aiming to mitigate the risk of a hard fork in the bitcoin network.{{cite web | last = CNBC | author-link = CNBC | title = Dispute could mean financial panic in Bitcoin | publisher = Associated Press | date = 14 July 2017 | url = https://www.cnbc.com/2017/07/14/dispute-could-mean-financial-panic-in-bitcoin.html | access-date = 19 July 2017 | archive-date = 19 July 2017 | archive-url = https://web.archive.org/web/20170719135239/http://www.cnbc.com/2017/07/14/dispute-could-mean-financial-panic-in-bitcoin.html | url-status = dead }}

On 8 November 2017, the developers of SegWit2x announced that the hard fork planned for around 16 November 2017 was canceled due to a lack of consensus.{{cite web|url=https://www.wsj.com/articles/bitcoin-dodges-split-that-threatened-its-surging-price-1510172701/|title=Bitcoin Dodges Split That Threatened Its Surging Price|last=Vigna|first=Paul|date=8 November 2017|publisher=The Wall Street Journal|access-date=8 November 2017|archive-date=8 November 2017|archive-url=https://web.archive.org/web/20171108204840/https://www.wsj.com/articles/bitcoin-dodges-split-that-threatened-its-surging-price-1510172701|url-status=dead}}

References

{{Reflist}}

{{Bitcoin|state=expanded}}

Category:Bitcoin