<p>Bech32 addresses are defined in <a href="https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki" rel="nofollow noreferrer">BIP 173</a>.</p>
<p>This slide is taken from Pieter Wuille's <a href="https://diyhpl.us/wiki/transcripts/sf-bitcoin-meetup/2017-03-29-new-address-type-for-segwit-addresses/" rel="nofollow noreferrer">presentation</a> on bech32 at SF Bitcoin Devs in March 2017.</p>
<p><a href="https://i.sstatic.net/iVbkC.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/iVbkC.png" alt="bech32 structure slide" /></a></p>
<p><strong>Different prefixes</strong></p>
<p>A list of address prefixes on the Bitcoin wiki is <a href="https://en.bitcoin.it/wiki/List_of_address_prefixes" rel="nofollow noreferrer">here</a>.</p>
<ul>
<li><code>bc</code> is representing Bitcoin (mainnet)</li>
<li>Testnet bech32 addresses start <code>tb</code></li>
<li>Signet (both default Signet and custom Signets) bech32 addresses also start <code>tb</code> (although an <a href="https://github.com/bitcoin/bitcoin/pull/18267#discussion_r491150895" rel="nofollow noreferrer">earlier iteration</a> of Signet used <code>sb</code>).</li>
<li><a href="https://github.com/bitcoin/bitcoin/issues/12314" rel="nofollow noreferrer">Regtest</a> bech32 addresses start with <code>bcrt</code>. This is defined in chainparams.cpp <a href="https://github.com/bitcoin/bitcoin/blob/master/src/chainparams.cpp#L446" rel="nofollow noreferrer">here</a>. Discussion on why regtest addresses don't have the same prefix as testnet and signet is <a href="https://github.com/bitcoin/bitcoin/issues/12314" rel="nofollow noreferrer">here</a>.</li>
</ul>
<p><strong>Remaining data</strong></p>
<ul>
<li><code>1</code> is just a separator and doesn't represent any particular data</li>
<li><code>q</code> is the witness version. This <a href="https://bitcoin.stackexchange.com/questions/100518/why-did-bech32-define-a-new-base32-encoding-scheme-rather-than-use-an-existing-o">represents</a> zero as the first SegWit witness version introduced was SegWit v0. Taproot introduces SegWit v1 with <code>p</code> representing one (v1).</li>
<li><code>w508d6qejxtdg4y5r3zarvary0c5xw7k</code> is the witness program.</li>
<li><code>v8f3t4</code> is the checksum</li>
</ul>
<p>As the slide says, mainnet P2WPKH addresses are 42 characters and mainnet P2WSH addresses are 62 characters under SegWit v0. Future witness versions can be up to 74 characters although SegWit v1 addresses (Taproot) will be the same length as v0 P2WSH addresses (62 characters). Witness programs as defined under SegWit v1 are 32 bytes.</p>
<p>There is a bech32 demo decoder site <a href="http://bitcoin.sipa.be/bech32/demo/demo.html" rel="nofollow noreferrer">here</a>.</p>
<p><strong>Please note that SegWit v1 (Taproot) addresses will use <a href="https://bitcoin.stackexchange.com/questions/101117/what-problems-identified-with-bech32-addresses-have-been-resolved-with-the-updat">bech32m</a> encoding rather than bech32.</strong></p>

CC BY-SA 4.0
2020-12-11T11:40:34.630Z
2023-03-24T08:35:46.700Z
2023-03-24T08:35:46.700Z
Michael Folkson
<p>Can you break down what data is encoded into a bech32 address?</p>
<p>e.g. bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4</p>
<p>How do bech32 addresses on testnet, regtest, <a href="https://bitcoin.stackexchange.com/questions/89640/what-are-the-key-differences-between-regtest-and-the-proposed-signet">signet</a> compare?</p>

<segregated-witness><testnet><regtest><bech32-address><signet>
Can you break down what data is encoded into a bech32 address?
Michael Folkson
# Can you break down what data is encoded into a bech32 address?

(Asked by: username_0 on 2020-12-11)

Can you break down what data is encoded into a bech32 address?

e.g. bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4

How do bech32 addresses on testnet, regtest, [signet](https://bitcoin.stackexchange.com/questions/89640/what-are-the-key-differences-between-regtest-and-the-proposed-signet) compare?

**Tags:** segregated-witness, testnet, regtest, bech32-address, signet


---

## 1 answers

### Answer by username_0 on 2020-12-11. Score: 8 | Accepted answer

Bech32 addresses are defined in [BIP 173](https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki).

This slide is taken from Pieter Wuille's [presentation](https://diyhpl.us/wiki/transcripts/sf-bitcoin-meetup/2017-03-29-new-address-type-for-segwit-addresses/) on bech32 at SF Bitcoin Devs in March 2017.

[![bech32 structure slide](https://i.sstatic.net/iVbkC.png)](https://i.sstatic.net/iVbkC.png)

**Different prefixes**

A list of address prefixes on the Bitcoin wiki is [here](https://en.bitcoin.it/wiki/List_of_address_prefixes).

* `bc` is representing Bitcoin (mainnet)
* Testnet bech32 addresses start `tb`
* Signet (both default Signet and custom Signets) bech32 addresses also start `tb` (although an [earlier iteration](https://github.com/bitcoin/bitcoin/pull/18267#discussion_r491150895) of Signet used `sb`).
* [Regtest](https://github.com/bitcoin/bitcoin/issues/12314) bech32 addresses start with `bcrt`. This is defined in chainparams.cpp [here](https://github.com/bitcoin/bitcoin/blob/master/src/chainparams.cpp#L446). Discussion on why regtest addresses don't have the same prefix as testnet and signet is [here](https://github.com/bitcoin/bitcoin/issues/12314).

**Remaining data**

* `1` is just a separator and doesn't represent any particular data
* `q` is the witness version. This [represents](https://bitcoin.stackexchange.com/questions/100518/why-did-bech32-define-a-new-base32-encoding-scheme-rather-than-use-an-existing-o) zero as the first SegWit witness version introduced was SegWit v0. Taproot introduces SegWit v1 with `p` representing one (v1).
* `w508d6qejxtdg4y5r3zarvary0c5xw7k` is the witness program.
* `v8f3t4` is the checksum

As the slide says, mainnet P2WPKH addresses are 42 characters and mainnet P2WSH addresses are 62 characters under SegWit v0. Future witness versions can be up to 74 characters although SegWit v1 addresses (Taproot) will be the same length as v0 P2WSH addresses (62 characters). Witness programs as defined under SegWit v1 are 32 bytes.

There is a bech32 demo decoder site [here](http://bitcoin.sipa.be/bech32/demo/demo.html).

**Please note that SegWit v1 (Taproot) addresses will use [bech32m](https://bitcoin.stackexchange.com/questions/101117/what-problems-identified-with-bech32-addresses-have-been-resolved-with-the-updat) encoding rather than bech32.**


---

