Segregated Witness: Difference between revisions

From Bitcoin Wiki
Jump to navigation Jump to search
Taras (talk | contribs)
No edit summary
Diegorodriguezv (talk | contribs)
m →‎History and Activation: Changed the link to archived version because the original was deleted
 
(8 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{infobox miner activated fork|title=SegWit|image=[[File:Segwit.png|256px]]
{{infobox |title=SegWit|image=<hr style="background-color: #f9f9f9;"/>[[File:Segwit.png|256px]]<hr style="background-color: #f9f9f9;"/>
|fulltitle=Segregated Witness (Consensus layer)
|fulltitle=Segregated Witness (Consensus layer)
|bipnumber=[[BIP_0141|BIP 141]]
|bipnumber=[[BIP_0141|BIP 141]]
Line 9: Line 9:
|lockin=Block #479708<br/>2017-08-08 19:05:58
|lockin=Block #479708<br/>2017-08-08 19:05:58
|activated=Block #481824<br/>2017-08-24 01:57:37
|activated=Block #481824<br/>2017-08-24 01:57:37
}}'''Segregated Witness''' (abbreviated as '''SegWit''') is an implemented protocol upgrade intended to provide protection from [[transaction malleability]] and [[Block size limit controversy|increase block capacity]]. SegWit defines a new structure called a ''witness'' that is committed to blocks separately from the transaction merkle tree. This structure contains data required to check transaction validity but is not required to determine transaction effects. In particular, signatures and redeem scripts are moved into this new structure, which does not count towards the traditional [[Block size limit controversy|1 MB block size limit]]. Instead, a new ''weight'' parameter is defined, and blocks are allowed to have at most 4 million weight units (WU). A byte in the original 1 MB zone of the block weighs 4 WU, but a byte in a witness structure only weighs 1 WU, allowing blocks that are technically larger than 1 MB without a hardforking change.
}}'''Segregated Witness''' (abbreviated as '''SegWit''') is an implemented protocol upgrade intended to provide protection from [[transaction malleability]] and [[Block size limit controversy|increase block capacity]]. SegWit separates the ''witness'' from the list of inputs. The witness contains data required to check transaction validity but is not required to determine transaction effects.
Additionally, a new ''weight'' parameter is defined, and blocks are allowed to have at most 4 million [[weight units]] (WU). Non-witness and pre-segwit witness bytes weigh 4 WU, but each byte of Segwit witness data only weighs 1 WU, allowing blocks that are larger than 1 MB without a hardforking change.


After the successful activations of [[pay to script hash|P2SH]], OP_CLTV, and OP_CSV, SegWit was the last protocol change needed to make the [[Lightning Network]] safe to deploy on the Bitcoin network.
After the successful activations of OP_CLTV and OP_CSV, SegWit was the last protocol change needed to make the [[Lightning Network]] safe to deploy on the Bitcoin network.
 
Because the new witness field contains [[Script]] versioning, it is also possible to make changes to or introduce new opcodes to SegWit scripts that would have originally required additional complexity to function without SegWit.
 
=== History and Activation ===
 
During 2016 and 2017 activation of segregated witness was blocked by miners for political reasons by exploiting a flaw in the [[BIP 9]] activation mechanism.
On a technical level, the consensus rules of bitcoin are controlled by the [[economic majority]] not the [[Bitcoin is not ruled by miners|miners]], so the deadlock was possible to solve by creating a [[user activated soft fork]] [[BIP 148]] where the [[economic majority]] would bypass the blocking miners and activate segregated witness on their own.
This required some coordination amongst the economic majority, but was ultimately successful, activating Segwit on Bitcoin soon after 1st August 2017.<ref>[https://web.archive.org/web/20210224032019/https://bitcoinmagazine.com/articles/long-road-segwit-how-bitcoins-biggest-protocol-upgrade-became-reality// BitcoinMagazine: The Long Road to SegWit: How Bitcoin’s Biggest Protocol Upgrade Became Reality (Archived February 2021)]</ref>


==See Also==
==See Also==
Line 23: Line 32:
* [https://bitcoincore.org/en/2016/01/26/segwit-benefits/ Segregated Witness Benefits]
* [https://bitcoincore.org/en/2016/01/26/segwit-benefits/ Segregated Witness Benefits]
* [https://bitcoincore.org/en/segwit_wallet_dev/ Segregated Witness Wallet Developer Guide]
* [https://bitcoincore.org/en/segwit_wallet_dev/ Segregated Witness Wallet Developer Guide]
* [[Wikipedia:SegWit|Wikipedia: SegWit]]
{{stub}}
{{stub}}

Latest revision as of 06:16, 14 March 2021

SegWit


Segregated Witness (abbreviated as SegWit) is an implemented protocol upgrade intended to provide protection from transaction malleability and increase block capacity. SegWit separates the witness from the list of inputs. The witness contains data required to check transaction validity but is not required to determine transaction effects. Additionally, a new weight parameter is defined, and blocks are allowed to have at most 4 million weight units (WU). Non-witness and pre-segwit witness bytes weigh 4 WU, but each byte of Segwit witness data only weighs 1 WU, allowing blocks that are larger than 1 MB without a hardforking change.

After the successful activations of OP_CLTV and OP_CSV, SegWit was the last protocol change needed to make the Lightning Network safe to deploy on the Bitcoin network.

Because the new witness field contains Script versioning, it is also possible to make changes to or introduce new opcodes to SegWit scripts that would have originally required additional complexity to function without SegWit.

History and Activation

During 2016 and 2017 activation of segregated witness was blocked by miners for political reasons by exploiting a flaw in the BIP 9 activation mechanism. On a technical level, the consensus rules of bitcoin are controlled by the economic majority not the miners, so the deadlock was possible to solve by creating a user activated soft fork BIP 148 where the economic majority would bypass the blocking miners and activate segregated witness on their own. This required some coordination amongst the economic majority, but was ultimately successful, activating Segwit on Bitcoin soon after 1st August 2017.[1]

See Also

This page is a stub. Help by expanding it.