segregated witness – Are you able to break down what information is encoded right into a bech32 handle?

0
91


Bech32 addresses are outlined in BIP 173.

This slide is taken from Pieter Wuille’s presentation on bech32 at SF Bitcoin Devs in March 2017.

bech32 structure slide

Completely different prefixes

A listing of handle prefixes on the Bitcoin wiki is right here.

  • bc is representing Bitcoin (mainnet)
  • Testnet bech32 addresses begin tb
  • Signet (each default Signet and customized Signets) bech32 addresses additionally begin tb (though an earlier iteration of Signet used sb).
  • Regtest bech32 addresses begin with bcrt. That is outlined in chainparams.cpp right here. Dialogue on why regtest addresses haven’t got the identical prefix as testnet and signet is right here.

Remaining information

  • 1 is only a separator and does not symbolize any explicit information
  • q is the witness model. This represents zero as the primary SegWit witness model launched was SegWit v0. Taproot introduces SegWit v1 with p representing one (v1).
  • w508d6qejxtdg4y5r3zarvary0c5xw7k is the witness program.
  • v8f3t4 is the checksum

Because the slide says, mainnet P2WPKH addresses are 42 characters and mainnet P2WSH addresses are 62 characters beneath SegWit v0. Future witness variations could be as much as 74 characters though SegWit v1 addresses (Taproot) would be the similar size as v0 P2WSH addresses (62 characters). Witness packages as outlined beneath SegWit v1 are 32 bytes.

There’s a bech32 demo decoder web site right here.

Please be aware that SegWit v1 (Taproot) addresses will use bech32m encoding fairly than bech32.

LEAVE A REPLY

Please enter your comment!
Please enter your name here