How The Segwit Protocol Works For Bitcoin?Admin
The reliability of blockchain technology is due to decentralized data storage, cryptographic encryption, and consensus algorithm. The complex interaction of these characteristics protects against external and internal threats. However, experts have found that some parts of the code can be changed in non-cryptographic ways (without cracking private keys). This compromises the data stored in the system. The second issue is related to scalability. It arose due to the limited block size. It can accommodate a relatively small amount of information. To solve these problems, the developers proposed to update the protocol and activate Bitcoin SegWit (Segwit). Thanks to the soft fork, it was possible to speed up transactions and reduce fees without significant changes to the program code. The security of transfers has also increased.
- What is SegWit in simple words
- How the technology works
- SegWit vs. Legacy
- Main advantages of the protocol
- Technology Disadvantages
- The history of the creation of SegWit in the Bitcoin network
- Consequences of activation
- SegWit and other cryptocurrencies
- Which wallets support the technology
- Development prospects
What is SegWit in simple words
Segregated Witness is an update to the Bitcoin network designed to address the following issues:
- Scalability. In the BTC blockchain, one block is generated approximately every 10 minutes. The network’s throughput depends on the number of transactions the cell can accommodate. The block size is limited to 1 MB – this condition is hardcoded in the cryptocurrency code. With an increase in the number of requests, miners first confirm transactions with a larger commission. Therefore, costs increase. Before the update, some transactions took several days to complete.
- Plastic. Cryptocurrency transactions are encrypted lines of program code, one of the parts of which is a transaction identifier (Transaction ID, TXID). The indicator is formed from the sender’s electronic signature (calculated when decrypting the private key), the number of coins, and data about the participants in the transaction. Knowing the TXID, any user can get information about the status of the operation. Transaction confirmation takes time, and attackers could change the identifier without canceling the transaction. You do not need to have access to private keys for this. The transfer recipient can change the TXID after the assets are credited and request a re-payment from the sender. This was used by scammers, forcing crypto exchanges to make multiple transactions. Security experts suggest 64,564 BTC were stolen from the popular MtGox exchange in 2014.
- The main idea of SegWit Bitcoin is to separate signatures (proof of ownership of the cryptocurrency) from transfer data (number of coins and participants in the transaction). This increases the system’s throughput by saving space in the block and solves the plasticity problem.
BTC SegWit reorganizes data to eliminate double-spending. The activation of the update was carried out in several stages due to the difficulties encountered. Some developers never adopted SegWit. This led to the creation of bitcoin hard forks. One of the most popular is Bitcoin Cash .
How the technology works
There is no list of wallets with account balances on the Bitcoin blockchain. Instead, the system is a set of incoming and outgoing transactions for a single address. Before the soft fork, the operation record included a mandatory part – an identifier. If the slightest adjustments were made to the cryptographic signature (for example, they changed the format or added optional service characters), the TXID changed.
The modified transaction was in the same wallet as the original one. These transactions could compete for confirmation. The original one was rejected if the miners processed the copy before the primary record.
The scriptSig field is now left blank. The signature information is in a separate Witness data structure. This innovation solves the problem of plasticity and saves space in the block. The fact is that a digital signature takes up to 65% of the transaction volume.
Having eliminated the plasticity of transactions, the developers began to create layer 2 blockchains built on top of the leading network. For bitcoin, this protocol is the Lightning Network (an off-chain micropayments network). The algorithm collects and stores many small identical transfers outside the main chain. After the payment gateway is closed, they are combined into one transaction and enter the base protocol. This increases the speed of transaction processing.
After activating SegWit, the node must load an additional structure to verify operations. The signature block is linked to the main blockchain via a hash tree in the header.
SegWit vs. Legacy
Several types of addresses work in the BTC protocol:
- Legacy (P2pKH). Satoshi Nakamoto proposed this format in 2010. The public key starts with the number 1. It consists of 25-34 characters. There are exceptions. The capital letters O, I, lowercase l, and the number 0 are not used to prevent visual ambiguity. Disadvantages of the address – case sensitivity, high commissions, more weight in QR codes, inconvenience to record.
- P2SH. The format was created in 2012 to solve blockchain problems and introduce more complex features. The fundamental public structure is identical to Legacy but starts with the number 3. To receive a payment, you need a hash-compatible script. Technology lowers network fees. It transfers payment for transactions to the recipient and allows you to generate multi-signature public keys. P2SH wallets support the soft fork but are not native to it. From P2SH storage, you can transfer BTC to P2PKH and Bench32. The address in the form of a QR code takes up less space than Legacy.
- Bench32 (SegWit, P2WPKH). The solution was proposed by Peter Wille and Greg Maxwell in an update to BIP-0173 at a conference in 2016. The protocol is designed to increase the efficiency of the blockchain. The solution allows you to reduce commissions further. The format uses only lowercase letters. The address starts with bc1 and can contain up to 90 characters (usually 42). In 2022, not all services support sending coins to wallets of this type. To avoid errors, it is recommended to use P2SH storage. The checksum will be incorrect if up to 4 inaccuracies are allowed when writing the address. Thanks to the applied Bowes-Chowdhury-Hockwingham (BCH) code, the system will automatically correct errors.
Main advantages of the protocol
SegWit technology has dramatically improved the Bitcoin network. The main advantages of a soft fork:
- Solving the problem of plasticity. According to statistics, it affected more than 50% of transactions in the BTC blockchain.
- Scalability. Thanks to the removal of signatures from the block and separate storage, it was possible to increase network throughput from 3 to 7 operations per second and reduce fees from $20-30 to $5-10.
- Backward compatibility. Transfers can be made to old and new addresses. Members who supported the update work with lower commissions.
- Implementation of innovations. Thanks to the soft fork, developers started building layer 2 blockchains.
- Support by most nodes. In 2022, over 90% of transfers in the BTC network go through a SegWit address.
- High reliability of multi-signature wallets. If at least 1 P2SH transaction key becomes known to attackers, then the number of solutions can be reduced to 280. For SegWit addresses, this value is 2126.
One of the main arguments of the opponents of the soft fork is the impossibility of canceling it. You need to roll back the program code to the latest version when activating the update. But this will lead to the fact that all SegWit codes will be freely available.
The update has disadvantages:
- A short-term solution to the scalability problem. The number of transactions in the blockchain is constantly growing. More significant changes are needed in the block size and processing transfers.
- Disagreements in the community. Due to the inability to reach a compromise, there were several hard forks in the Bitcoin network (BCH, BTG, BCD).
Detailed verification of operations. Due to the loading of additional structures, the nodes require more resources.
The history of the creation of SegWit in the Bitcoin network
Since 2012, participants in specialized forums and conferences have raised the issue of plasticity. The solution was proposed in 2015 by Blockstream co-founder Peter Wille. Unlike other ways to upgrade Bitcoin, SegWit did not require a hard fork, so the community received it positively.
Hardfork is an update of the software code incompatible with the old software. So there are 2 or more cryptocurrencies with a similar name (Bitcoin and Bitcoin Cash).
Leave a Reply