SegWit
Segregated Witness, or SegWit, is the name used for a proposed soft fork change in the transaction format of the cryptocurrency Bitcoin which has already been implemented on Litecoin . The formal title "Segregated Witness (Consensus layer)" has Bitcoin Improvement Proposals number BIP141.[1] It is intended to solve 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.[2] 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 its real size.
History
Why block size limit
Bitcoin is a "cryptocurrency", a form of "money" using encryption to keep transactions secure.[3] Each record of a unit of Bitcoins is called a "block", and all blocks are tied together sequentially, a mathematical signature of the previous block stored in the next, to form a chain of blocks, or "blockchain".[4]
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 DoS (Denial of Service attack). Their fake blocks would be detected, but doing so would take a very long time, slowing down the whole system.[5]
The solution implemented was to put a limit on block size. That limit was 1 MB. This way, attacks using huge blocks would be instantly detected and rejected, without significantly slowing the network.
The problem(s)
Unfortunately, as Bitcoin has become more popular, that limit is slowing down transactions. A block is added to the chain every ten minutes. With a limit on its size, only so many transactions can be added, as many as fit in a block. Globally, bitcoin cannot currently support transactions with anything like the speed of other currencies or credit cards. It sometimes takes hours to confirm a transaction.
Some sites work around this problem, by conducting "off-chain payments", conducting transactions without waiting for confirmation by the blockchain.[6] However, many people[who?] do not trust this solution, which obviously[how?] is open to exploitation.
Others have proposed changes to Bitcoin that would reform the way it's done, but that would not be backward-compatible.[6] 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.[7]
Likewise, there are a number of other, unrelated problems that have arisen with the bitcoin protocol.
The most important is "transaction malleability".[8] 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.[9]
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 bitcoin. 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.[10]
It also addresses signature malleability, by moving signatures out of the transaction data, making impossible to change it.[11] 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.[12]
Activation
Segregated Witness (BIP141) should not be confused with SegWit2x (SegWit2Mb). In SegWit2Mb it is agreed to first activate Segregated Witness and then a 2 MB hard fork within six months as of May 23, 2017. The proposal SegWit2x and the other proposal UASF BIP148 are both intended to activate Segregated Witness (BIP141).[13][14] Segregated Witness is estimated to be activated on August 22 2017.[15]
See also
External links
References
- ^ All Bitcoin Improvement Proposals, including BIP141
- ^ Investopedia: SegWit (Segregated Witness)
- ^ Bitcoin protocol documentation
- ^ How the Bitcoin protocol actually works
- ^ What is the Block Size Limit
- ^ a b Is there a better Scaling Solution than SegWit?
- ^ Tom's Blog: Flexible Transactions
- ^ What the 'Bitcoin Bug' Means: A Guide to Transaction Malleability
- ^ Bitcoin Wiki: Transaction Malleability
- ^ Segregated Witness, Part 1: How a Clever Hack Could Significantly Increase Bitcoin's Potential
- ^ Segregated Witness proposal BIP 141
- ^ What is SegWit?
- ^ The Road to Segwit Activation — UASF, Segwit2x and Segwit Signalling Explained on medium.com
- ^ SegWit2x and UASF BIP148 hard fork monitor
- ^ Segregated Witness activation monitor on xbt.eu