segregated witness – What is the difference between “native segwit” and “bech32”?

1 Mins read

TL;DR: Native segwit refers to segwit outputs without P2SH-wrapper. Bech32 is the address format used to represent native segwit-v0 locking scripts.

Wrapped segwit vs native segwit

When segwit activated, it introduced the zeroth generation of segwit, segwit-v0. The corresponding locking scripts came in two flavors:

  1. The forward-compatible “wrapped segwit” or “nested segwit” output types wrap the witness program in a Pay to Script Hash (P2SH) output. There are two variants, P2SH-P2WPKH for single-sig, and P2SH-P2WSH for arbitrary scripts including multisig.
    As all P2SH addresses, wrapped segwit outputs get encoded using Base58Check. The wrapping allows any P2SH-enabled wallets to send to wrapped segwit addresses.
  2. The compatibility-breaking “native segwit” output types which can only be paid to by segwit-enabled wallets. Native segwit outputs are more blockspace efficient because they avoid the additional data necessary for the P2SH-wrapper by resolving the witness program directly. Native segwit locking scripts get encoded using the newly introduced bech32 address format (BIP-173) (for v0 native segwit outputs).

Other uses of Bech32

Bech32 is also used for other purposes such as e.g. encoding Lightning invoices. Originally, it was planned to use Bech32 for later native segwit output versions as well. However, after a mutability weakness was discovered, and surveys found that many wallets did not properly handle sending to higher segwit versions, an amended version of Bech32 is in discussion. This amended version of Bech32 would use a different checksum constant to explicitly break forward-compatibility, i.e. require wallets to upgrade to create segwit-v1 outputs. Breaking forward-compatibility protects wallets from burning funds by incorrectly downgrading segwit-v1 addresses to segwit-v0 addresses, and allows the mutability weakness to be fixed.

Native segwit-v1 to use Bech32m

The proposed Taproot soft fork introduces the native segwit-v1 output type, Pay to Taproot (P2TR), which would be the first native segwit output type to use this amended Bech32 address format, called “Bech32m” proposed by BIP-350.

Source link

Related posts

Markets Slump In Wake of Fed Meeting

3 Mins read
Key Takeaways Crypto markets briefly rose today before taking a sharp dive in the wake of the Fed’s FOMC meeting today. Bitcoin…

Global Crypto Owners Predicted to Surpass 1 Billion This Year – Featured Bitcoin News

2 Mins read
The number of global crypto owners is expected to exceed one billion by the end of the year, according to a report…

Lack Of Liquidations Could Indicate Another Wave Of Selling

2 Mins read
Bitcoin finally broke below the $40K point this past weekend. This had sent the cryptocurrency back towards six-month lows. One thing though…

Leave a Reply

Your email address will not be published. Required fields are marked *