Jump to content

SegWit

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Jtbobwaysf (talk | contribs) at 20:21, 2 January 2018 (move up an intended purpose). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Segregated Witness, or SegWit, is the name used for an implemented soft fork change in the transaction format of the cryptocurrency Bitcoin which has also been implemented on currencies such as Litecoin, DigiByte, Vertcoin and Groestlcoin.[1]

The formal title "Segregated Witness (Consensus layer)" had Bitcoin Improvement Proposal number BIP141.[2] The purpose was to solve malleability (cryptography)".[3] 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.[4] 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 money using cryptography to keep transactions secure.[5] Each record of a unit of bitcoins is called a "block", and all blocks are tied together sequentially by using a cryptographic hash on the previous block and storing in the next. This forms a chain of blocks, or a blockchain.[6]

Each block of bitcoins contains information about who sends and receives a given unit of bitcoin (a transaction), as well as the signature that approves each transaction. Originally, there was no limit to the size of these blocks. But this meant that malicious people could make up fake "block" data that was very long as a form of Denial of Service (DoS) attack. Their fake blocks would be detected, but doing so would take a very long time, slowing down the whole system.[7]

The solution Satoshi designed was to put a limit on block size, which was 1 MB. This way, attacks using huge blocks would be instantly detected and rejected, without significantly slowing down the network.

Scalability and malleability

The more popular Bitcoin has become, the slower transactions have become, due to the limit. A block is added to the chain every ten minutes (Proof-of-work causes this delay). The limit on block-size, limits the number of transactions fitting in it. Some sites work around this problem, by conducting "off-chain payments", conducting transactions without waiting for confirmation by the blockchain.[8]

Others have proposed changes to Bitcoin that would reform the way it's done, but that would not be backward-compatible.[8] For example, FlexTrans (Flexible Transactions) would make transactions smaller by changing how they are described to a "tag" system, allowing more in blocks of the current size. But it is not compatible with systems that do not upgrade.[9]

Likewise, there are a number of other, unrelated problems that have arisen with the Bitcoin protocol.

The most important is "transaction malleability".[10] While a transaction is signed, the signature doesn't include all transaction data, and at one time checking that the signature was correct was not even required. This means that several different ways of losing or stealing bitcoins are possible. While a number of different fixes have made this unlikely to happen, the flaw still exists.[11]

Segregated Witnesses as a solution

SegWit proposes significant backward compatibility. It hides its increased block size by changing the definition of a block to be measured as one million "units" instead of bytes. The "witness" signature data 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". The overall effect would be changing the average block size to about 1.8 MB instead of 1. This means the existing Bitcoin protocol doesn't change, allowing it to work without as much upgrading of software.[12]

It also addresses signature malleability, by moving signatures out of the transaction data, making them impossible to change.[13] The transaction ID is no longer malleable. This makes Bitcoin safer to use with Lightning Network, a way to speed up small payments by bundling them and only writing to the blockchain at the beginning and end of their execution, which would be (slightly) risky while the malleability problem still exists.[14]

Activation

Segregated Witness was activated on August 24, 2017.[15] Nonetheless, most Bitcoin network transactions have not begun to use the upgrade. In the first week of October, the proportion of network transactions using SegWit rose from 7% to 10%, indicating a greater increase in use rate.[16]

Segregated Witness (BIP141) should not be confused with SegWit2x (SegWit2Mb). SegWit2Mb proposed to first activate Segregated Witness and then a 2 MB hard fork within six months as of May 23, 2017.

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"),[17] activating Segregated Witness at an 80% threshold of the total Bitcoin hashrate, 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.[18] In June 2017 the Segregated Witness proposal was further complicated with claims that it might violate patents filed with the USIPO.[19] As of mid-2017 the SegWit2x proposal had support in excess of 90% of the hashrate, however the SegWit2x proposal has been controversial in that work on the project is limited to an invitation only group of developers.[17] In mid-July 2017 it became apparent that miners supported implementation of the Segwit part of the agreement before the 1 August 2017 UASF, thereby attempting to avoid the risk of a hard fork for the Bitcoin network.[20][21][22]

On November 8, 2017, the developers of SegWit2x announced that the hard fork planned for around November 16, 2017 was canceled due to a lack of consensus.[23][24]

On 21 July, BIP 91 locked-in, meaning that Segregated Witness upgrade would activate at block 477,120.[25] By 8 August another milestone was reached when 100% of the Bitcoin mining pools signaled support for SegWit, although SegWit would not be fully activated until 21 August at the earliest, after which miners would begin rejecting blocks that do not support SegWit.[26] Initially, most bitcoin transactions have not been able to use the upgrade. In the first week of October the proportion of bitcoin transactions using SegWit rose from 7% to 10%.[27]

Related BIPs

  • BIP141 Segregated Witness (Consensus layer) – activated on August 24, 2017
  • BIP142 Address Format for Segregated Witness – withdrawn, superseded by BIP 173
  • BIP143 Transaction Signature Verification for Version 0 Witness Program[1] – activated on August 24, 2017
  • BIP144 Segregated Witness (Peer Services) – activated on August 24, 2017
  • BIP148 Mandatory activation of segwit deployment – activated (mandated the activation of BIP141, 143, 144)
  • BIP173 Bech32 addresses – activated, not yet in wide usage

References

  1. ^ "SegWit, Explained". Cointelegraph. 20 April 2017. Retrieved 20 December 2017.
  2. ^ All Bitcoin Improvement Proposals, including BIP141
  3. ^ What the 'Bitcoin Bug' Means: A Guide to Transaction Malleability
  4. ^ Investopedia: SegWit (Segregated Witness)
  5. ^ Bitcoin protocol documentation
  6. ^ How the Bitcoin protocol actually works
  7. ^ What is the Block Size Limit
  8. ^ a b Is there a better Scaling Solution than SegWit?
  9. ^ Tom's Blog: Flexible Transactions
  10. ^ What the 'Bitcoin Bug' Means: A Guide to Transaction Malleability
  11. ^ Bitcoin Wiki: Transaction Malleability
  12. ^ Segregated Witness, Part 1: How a Clever Hack Could Significantly Increase Bitcoin's Potential
  13. ^ Segregated Witness proposal BIP 141
  14. ^ What is SegWit?
  15. ^ Segregated Witness activation monitor on xbt.eu
  16. ^ Suberg, William (9 October 2017). "Bitcoin: $4600, 50% Dominance, Forks Leave Altcoins No Room For Moon". CoinTelegraph. Retrieved 9 October 2017.
  17. ^ a b Alyssa Hertig (23 June 2017). "Top Secret? Bitcoin Scaling Plan Segwit2x Leaves More Questions Than Answers". CoinDesk. Retrieved 29 June 2017.
  18. ^ "Leading bitcoin ecosystem participants reach consensus on scaling issue". Econo Times. Econo Times. 25 May 2017. Retrieved 23 June 2017.
  19. ^ "Segregated Witness and the Possibility of Patent Infringement". Nigeria Times. Nigeria Times. 3 June 2017. Retrieved 23 June 2017.
  20. ^ CNBC (14 July 2017). "Dispute could mean financial panic in Bitcoin". Associated Press. Retrieved 19 July 2017.
  21. ^ Suberg, William (18 July 2017). "Suddenly, Bitcoin Hard Fork Looks Unlikely As Chinese Exchange Readies For SegWit". COINTELEGRAPH. Retrieved 18 July 2017.
  22. ^ Castor, Amy (18 July 2017). "CoinDesk Explainer: How BIP 91 Enacts SegWit While Avoiding a Bitcoin Split". CoinDesk. Retrieved 18 July 2017.
  23. ^ Hertig, Alyssa (8 November 2017). "2x Called Off: Bitcoin Hard Fork Suspended for Lack of Consensus". CoinDesk. Retrieved 8 November 2017.
  24. ^ Vigna, Paul (8 November 2017). "Bitcoin Dodges Split That Threatened Its Surging Price". The Wall Street Journal. Retrieved 8 November 2017.
  25. ^ Hertig, Alyssa (21 July 2017). "BIP 91 Locks In: What This Means for Bitcoin and Why It's Not Scaled Yet". CoinDesk. Retrieved 21 July 2017.
  26. ^ Hertig, Alyssa (8 August 2017). "It's Official: Segregated Witness Will Activate on Bitcoin". CoinDesk. Retrieved 9 August 2017.
  27. ^ Suberg, William (9 October 2017). "Bitcoin: $4600, 50% Dominance, Forks Leave Altcoins No Room For Moon". CoinTelegraph. Retrieved 9 October 2017.

External links