How The Segwit Protocol Works For Bitcoin?

How The Segwit Protocol Works For Bitcoin?

How The Segwit Protocol Works For Bitcoin?

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.

  1. What is SegWit in simple words
  2. How the technology works
  3. SegWit vs. Legacy
  4. Main advantages of the protocol
  5. Technology Disadvantages
  6. The history of the creation of SegWit in the Bitcoin network
  7. Preparation
  8. Disagreements
  9. Consequences of activation
  10. SegWit and other cryptocurrencies
  11. Which wallets support the technology
  12. 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.

Technology Disadvantages

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).

Blockchain split

Preparation

The adoption of the new rules required the approval of 95% of the miners. However, not everyone supported the idea. Therefore, the protocol update was carried out in several stages.

DATE EVENT
January 2016 BIP141 testnet launched
March 2016 More developers, companies, and miners joined testing
June 2016 Conferences were held with the participation of persons influential in the crypto community. One of them approved the widespread introduction of technology
September 2016 Improved code. A new version of Bitcoin Core 0.13.1 has been released.
October 2016 The developers presented the protocol. The condition for activation is the participation of 95% of miners
November 2016 BTC users massively upgraded blockchains. Some continued to express dissatisfaction with the introduction of technology
January-April 2017 Most miners supported the soft fork
May 2017 At a conference in New York, an agreement was signed to increase the block size to 2 MB (SegWit2x). The new version has not yet been implemented. But thanks to the conference, most miners accepted the soft fork
August 2017 The protocol is activated in the Bitcoin network

Disagreements

Despite the advantages of the new technology, not everyone supported the proposal. Some developers believed that the soft fork would not solve the problems of scalability and plasticity or eliminate them for a while. Others have argued that the source code proposed by Satoshi Nakamoto does not need to be optimized and developed.

Opponents of the soft fork claimed that the update would centralize the system. Due to the increase in the number of transactions, the number of unconfirmed transfers in the block will increase. This will make the network vulnerable to hacker attacks.

The founders of Bitcoin Core (renamed Blockstream) advocated for the activation of the update. Opponents linked the company’s support to the development of the Lightning Network. For its implementation, it was necessary to eliminate the problem of plasticity. However, other projects supported SegWit:

  • BitGo.
  • Xapo.
  • Bitmain.
  • Blog.
  • Shapeshift.

Consequences of activation

The developers could create the Lightning Network layer 2 blockchains by eliminating the plasticity problem. The protocol’s primary goal is to increase network bandwidth and reduce fees. The add-on allows you to make transfers without recording transactions in blocks.

SegWit and other cryptocurrencies

Opponents of the introduction of technology began to carry out hard forks and create new coins. This is how the Bitcoin Cash cryptocurrency appeared with a block size of 8 MB. Due to the increased speed of transactions and low commissions, the developers suggested using BCH for daily payments and BTC for investments.

In 2022, SegWit will be popular. Many developers implement technology into projects. The most famous coins with update support:

  • Litecoin.
  • Groestlcoin.
  • Vertcoin.
  • Syscoin.
  • Digibyte.

Summary

Segregated Witness is an update to the Bitcoin protocol proposed in 2015 by Peter Wille to improve the security and speed of transactions. The activation was accompanied by controversy in the community. Not all users supported the innovation. This led to hard forks. New coins were created. However, the technology has gained acceptance. In 2022, major digital networks and platforms will support the new bitcoin address format.

Share this post

Leave a Reply

Your email address will not be published.