SegWit

Last updated
SegWit logo Segwit.svg
SegWit logo

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

Contents

The formal title "Segregated Witness (Consensus layer)" had Bitcoin Improvement Proposal number BIP141. [1] 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. [2]

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. [3] 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. [4] 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. [5]

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. [6] Therefore, a block size limit of 1 MB was introduced. [5]

Scalability and malleability

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

Scalability

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. [7] 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 ]

Malleability

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). [8]

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 ]

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. [2]

Activation

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

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 [9] 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. [10] On 21 July 2017, bitcoin was trading at $2,748, up 52% from 14 July 2017's $1,835. [10]

SegWit alleviates the scaling problem in two ways:

Initially, most bitcoin transactions have not been able to use the upgrade.[ citation needed ]

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 ]

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. [12]

As of February 2018, SegWit transactions exceed 30%. [13]

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. [14]

As of mid-2017, although 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. 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. [15]

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. [16]

Related Research Articles

Proof of work (PoW) is a form of cryptographic proof in which one party proves to others that a certain amount of a specific computational effort has been expended. Verifiers can subsequently confirm this expenditure with minimal effort on their part. The concept was invented by Moni Naor and Cynthia Dwork in 1993 as a way to deter denial-of-service attacks and other service abuses such as spam on a network by requiring some work from a service requester, usually meaning processing time by a computer. The term "proof of work" was first coined and formalized in a 1999 paper by Markus Jakobsson and Ari Juels. The concept was adapted to digital tokens by Hal Finney in 2004 through the idea of "reusable proof of work" using the 160-bit secure hash algorithm 1 (SHA-1).

Double-spending is a fundamental flaw in a digital cash protocol in which the same single digital token can be spent more than once. Due to the nature of information space, in comparison to physical space, a digital token is inherently almost infinitely duplicable or falsifiable, leading to ownership of said token itself being undefinable unless declared so by a chosen authority. As with counterfeit money, such double-spending leads to inflation by creating a new amount of copied currency that did not previously exist. Like all increasingly abundant resources, this devalues the currency relative to other monetary units or goods and diminishes user trust as well as the circulation and retention of the currency.

<span class="mw-page-title-main">Bitcoin</span> Decentralized digital currency

Bitcoin is the first decentralized cryptocurrency. Nodes in the peer-to-peer bitcoin network verify transactions through cryptography and record them in a public distributed ledger, called a blockchain, without central oversight. Consensus between nodes is achieved using a computationally intensive process based on proof of work, called mining, that requires increasing quantities of electricity and guarantees the security of the bitcoin blockchain.

Litecoin is a decentralized peer-to-peer cryptocurrency and open-source software project released under the MIT/X11 license. Inspired by Bitcoin, Litecoin was among the earliest altcoins, starting in October 2011. In technical details, the Litecoin main chain shares a slightly modified Bitcoin codebase. The practical effects of those codebase differences are lower transaction fees, faster transaction confirmations, and faster mining difficulty retargeting. Due to its underlying similarities to Bitcoin, Litecoin has historically been referred to as the "silver to Bitcoin's gold." In 2022, Litecoin added optional privacy features via soft fork through the MWEB upgrade.

<span class="mw-page-title-main">Bitcoin protocol</span> Rules that govern the functioning of Bitcoin

The Bitcoin protocol is the set of rules that govern the functioning of Bitcoin. Its key components and principles are: a peer-to-peer decentralized network with no central oversight; the blockchain technology, a public ledger that records all Bitcoin transactions; mining and proof of work, the process to create new bitcoins and verify transactions; and cryptographic security.

<span class="mw-page-title-main">History of bitcoin</span> Cryptocurrency

Bitcoin is a cryptocurrency, a digital asset that uses cryptography to control its creation and management rather than relying on central authorities. Originally designed as a medium of exchange, Bitcoin is now primarily regarded as a store of value. The history of bitcoin started with its invention and implementation by Satoshi Nakamoto, who integrated many existing ideas from the cryptography community. Over the course of bitcoin's history, it has undergone rapid growth to become a significant store of value both on- and offline. From the mid-2010s, some businesses began accepting bitcoin in addition to traditional currencies.

<span class="mw-page-title-main">Ethereum</span> Open-source blockchain computing platform

Ethereum is a decentralized blockchain with smart contract functionality. Ether is the native cryptocurrency of the platform. Among cryptocurrencies, ether is second only to bitcoin in market capitalization. It is open-source software.

<span class="mw-page-title-main">Dash (cryptocurrency)</span> Cryptocurrency

Dash is an open source cryptocurrency. It is an altcoin that was forked from the Bitcoin protocol. It is also a decentralized autonomous organization (DAO) run by a subset of its users, which are called "masternodes".

A blockchain is a distributed ledger with growing lists of records (blocks) that are securely linked together via cryptographic hashes. Each block contains a cryptographic hash of the previous block, a timestamp, and transaction data. Since each block contains information about the previous block, they effectively form a chain, with each additional block linking to the ones before it. Consequently, blockchain transactions are irreversible in that, once they are recorded, the data in any given block cannot be altered retroactively without altering all subsequent blocks.

<span class="mw-page-title-main">Blockstream</span> Blockchain technology company

Blockstream is a blockchain technology company led by co-founder Adam Back, headquartered in Victoria, Canada, with offices and staff worldwide. The company develops a range of products and services for the storage and transfer of Bitcoin and other digital assets.

A distributed ledger is the consensus of replicated, shared, and synchronized digital data that is geographically spread (distributed) across many sites, countries, or institutions. In contrast to a centralized database, a distributed ledger does not require a central administrator, and consequently does not have a single (central) point-of-failure.

<span class="mw-page-title-main">Ethereum Classic</span> Blockchain computing platform

Ethereum Classic is a blockchain-based distributed computing platform that offers smart contract (scripting) functionality. It is open source and supports a modified version of Nakamoto consensus via transaction-based state transitions executed on a public Ethereum Virtual Machine (EVM).

Bitcoin Unlimited (BU) is a full node implementation for the bitcoin and Bitcoin Cash networks. The Bitcoin Core client, from which Bitcoin Unlimited is forked, has a hard coded one megabyte block limit; Bitcoin Unlimited differs by allowing users to signal which block size limit they prefer, find the limit having a majority consensus and automatically track the largest proof-of-work, regardless of block size. However, if a block greater than one megabyte in size is accepted by Bitcoin Unlimited and rejected by nodes with a block size limit, a fork of the network will occur, resulting in two separate blockchains with Bitcoin Unlimited nodes following the chain with the largest proof-of-work.

<span class="mw-page-title-main">Lightning Network</span> Payment protocol for Bitcoin

The Lightning Network (LN) is a "layer 2" payment protocol built on the Bitcoin blockchain and those of other cryptocurrencies. It is intended to enable fast transactions among participating nodes and has been proposed as a solution to the bitcoin scalability problem. It is a peer-to-peer system for making micropayments of cryptocurrency through a network of bidirectional payment channels, without delegating custody of funds.

<span class="mw-page-title-main">Bitcoin scalability problem</span> Scaling problem in bitcoin processing

The Bitcoin scalability problem refers to the limited capability of the Bitcoin network to handle large amounts of transaction data on its platform in a short span of time. It is related to the fact that records in the Bitcoin blockchain are limited in size and frequency.

<span class="mw-page-title-main">Bitcoin Cash</span> Cryptocurrency that is a fork of Bitcoin

Bitcoin Cash is a cryptocurrency that is a fork of Bitcoin. Bitcoin Cash is a spin-off or altcoin that was created in 2017.

In blockchain, a fork is defined variously as:

The transaction malleability problem is a vulnerability in blockchain which can be exploited by altering a cryptographic hash, such as the digital signature used to identify a cryptocurrency transaction. Transaction malleability is considered to be one of the largest ongoing threats to blockchain technology, as it can compromise financial transactions such as Bitcoin and other cryptocurrency transactions, and cause other issues in the network.

Nervos Network is a blockchain platform which consists of multiple blockchain layers that are designed for different functions. The foundational layer is known as the Common Knowledge Base, whilst the native cryptocurrency of this layer is called CKB. This foundational layer uses a proof-of-work consensus model. Smart contracts and decentralized applications can be deployed on any layer.

References

  1. All Bitcoin Improvement Proposals, including BIP141
  2. 1 2 3 Segregated Witness proposal BIP 141
  3. Investopedia: SegWit (Segregated Witness)
  4. Adrian, Tobias; Griffoli, Tommaso Mancini (15 July 2019). The Rise of Digital Money. International Monetary Fund. ISBN   978-1-49832-490-8.
  5. 1 2 Block Chain
  6. Transactions
  7. Micropayment Channel
  8. Transaction Malleability
  9. SegWit Activation timeline
  10. 1 2 Vigna, Paul (21 July 2017). "Bitcoin Rallies Sharply After Vote Resolves Bitter Scaling Debate". WSJ. Retrieved 26 January 2020.
  11. Graham, Luke (9 August 2017). "As bitcoin comes off its record high, the next step is to avoid a 'lightning fork'". CNBC. Archived from the original on 1 December 2017. Retrieved 23 November 2017.
  12. Irrera, Anna; Chavez-Dreyfuss, Gertrude (2 August 2017). "Bitcoin 'clone' sees a slow start following split". Independent. Retrieved 22 June 2018.
  13. "SegWit and the bitcoin transaction fee conspiracy theory". FT Alphaville. FT. 2018-03-21.
  14. "Leading bitcoin ecosystem participants reach consensus on scaling issue". Econo Times. 25 May 2017. Retrieved 23 June 2017.
  15. CNBC (14 July 2017). "Dispute could mean financial panic in Bitcoin". Associated Press. Archived from the original on 19 July 2017. Retrieved 19 July 2017.
  16. Vigna, Paul (8 November 2017). "Bitcoin Dodges Split That Threatened Its Surging Price". The Wall Street Journal. Archived from the original on 8 November 2017. Retrieved 8 November 2017.