Segregated Witness, commonly known as SegWit, is an update to the Bitcoin protocol that has brought significant improvements to the network. This update, which was implemented through a soft fork, notably made it possible to increase the capacity of the blocks and improve the security of transactions.
This article aims to explore in depth what SegWit is, how it works and what impacts it has had on the Bitcoin network.
What is Segregated Witness (SegWit)?
SegWit is an update to the Bitcoin protocol that was first proposed in 2015 by Bitcoin developer Pieter Wuille. This was proposed to the community in the BIP (Bitcoin Improvement Proposal) will 141 . However, the update was activated by developers on the Bitcoin network in August 2017 through a process called a "soft fork". This is a technical solution developed to address several issues encountered by the Bitcoin network at the time, including and above all the scalability issues and the malleability of transactions.
The proposal was widely accepted by the Bitcoin community and was successfully deployed on the network. It also paved the way for other improvements to the protocol, such as the ability to implement smart contracts via technologies such as sidechains and layer 2 solutions such as the Lightning Network.
Definition of SegWit
The term “Segregated Witness” literally means “separate witness.” It refers to a change in the structure of transactions in the Bitcoin blockchain. Specifically, SegWit separates digital signatures (the “witnesses”) from other transaction data.
The main goal of the Segregated Witness update is to separate the signature from the transaction data, allowing for increased block capacity without increasing the total block size. Before SegWit, the maximum block size in the Bitcoin blockchain was 1 megabyte. With SegWit, the theoretical capacity has been increased to around 4MB, because the transaction signature (transaction witness, hence the name Segregated Witness) is no longer included in the block size, but is stored separately.
How do you recognize a SegWit address?
SegWit addresses in Bitcoin typically start with the number "3" or "bc1". There are two main SegWit address formats, and each has its own prefix to identify them.
- Addresses starting with “3”: SegWit addresses in the “P2SH” (Pay to Script Hash) format start with the number “3”. These addresses often start with “3” and are compatible with regular Bitcoin addresses (P2PKH format). Using the P2SH format allows for a smoother transition to SegWit, as they can be used by non-SegWit wallets without issue. Example of a SegWit address in P2SH format: 3JvL6Ymt8MVWiCNHC7oWU6nLeHNJKLZGLN
- Addresses starting with "bc1": SegWit addresses in native format (bech32) start with "bc1". These addresses offer better space efficiency and are designed to further reduce transaction sizes. This is typically the type of address used to limit sending fees. They are found in wallets such as Wallet Of Satoshi ou BlueWallet For example. However, they are not compatible with all Bitcoin wallets, although their adoption is gradually increasing. Example of SegWit address in native format (bech32): bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq
It is important to note that recognition of a SegWit address depends on how it is displayed in your wallet or transaction details. Most modern wallets that support SegWit will clearly indicate whether an address is of type SegWit and what format is used. If you are unsure, it is recommended to check with the service or wallet you are using.
Why was SegWit implemented?
SegWit was introduced to solve two major problems of the Bitcoin network: the malleability of transactions and scalability problems.
➡️ The problem of transaction malleability
Transaction malleability is a bug that allowed a person to change the ID of a transaction before it was confirmed and added to the blockchain. This bug made malicious attacks possible and complicated the development of new features.
More specifically, transaction malleability can allow an attacker to modify the transaction ID (hash) of a transaction before it is confirmed in a block. This could potentially create complications for services that rely on the transaction ID to track payments or to ensure transaction integrity.
The introduction of Segregated Witness (SegWit) into the Bitcoin protocol helped alleviate transaction malleability issues by separating transaction data from signatures, making it more difficult to change the transaction ID without invalidating the signature. This has strengthened the security and reliability of the Bitcoin network.
➡️ The scalability problem
The scalability problem is linked to the limited block capacity of the Bitcoin blockchain. Before the implementation of SegWit, each block could only hold a certain number of transactions, which limited the number of transactions the network could process per second. This limitation created delays in processing transactions and increased transaction fees.
How does SegWit work?
SegWit works by separating digital signatures from other transaction data. This separation makes it possible to increase the capacity of the blocks and make transactions more secure.
Separation of signatures
In a non-SegWit transaction, signatures are included in the same data structure as the other information in the transaction. With SegWit, signatures are moved into a separate data structure called a "witness." This separation creates more space for transactions in each block.
Increasing block capacity
By separating signatures, each block can contain more transactions. This helps increase the number of transactions the network can process per second.
What are the advantages of SegWit?
SegWit has brought several major benefits to the Bitcoin network.
✅ Solving transaction malleability
Thanks to SegWit, the malleability of transactions has been resolved. By separating signatures from other transaction data, it is no longer possible to modify the identifier of a transaction before it is confirmed.
✅ Increasing block capacity
One of the main advantages of SegWit is the increase in block capacity. With this update, each block can hold more transactions, increasing the number of transactions the network can process per second.
✅ Improving transaction security
By separating signatures from other transaction data, SegWit makes transactions more secure. Because the signatures are separate, it is more difficult for an attacker to modify a transaction.
Conclusion
Segregated Witness is a major update to the Bitcoin protocol that has greatly improved the scalability and security of the network. By separating signatures from other transaction data, SegWit made it possible to increase the capacity of blocks and solve the problem of transaction malleability.
Despite its controversial implementation, SegWit played an essential role in the development and evolution of the Bitcoin network.