<p>Those bytes (x03x03x00x02x03 or better shown as <code>0x0303000203</code>) are the expanded human readable part. You can find the code on <a href="https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki" rel="nofollow noreferrer">BIP-173</a>.</p>
<pre><code>def bech32_hrp_expand(s):
  return [ord(x) &gt;&gt; 5 for x in s] + [0] + [ord(x) &amp; 31 for x in s]
</code></pre>
<p>The problem however is that unlike Base58 encoding, those bytes are only used in calculation of checksum <em>not</em> as the starting bytes. Which makes the picture misleading in my opinion.</p>
<p>Bech32 encoding is very different from Base58 encoding as there is no &quot;version prefix&quot;. There is an Hrp, a witness version, a data (hash) and a checksum. <code>Witness version | hash</code> are the data being encoded and <code>expanded_hrp | data</code> is used in checksum calculation (<code>|</code> is concatination).</p>

CC BY-SA 4.0
2020-10-17T11:43:55.093Z
thanks for the response. I doubted the same. Upvoting and accepting the answer.
Andy_Jake
CC BY-SA 4.0
2020-10-17T11:20:03.670Z
2020-10-17T11:20:03.670Z
Coding Enthusiast
<p>I was compiling a table for <strong>Version prefix (hex)</strong>  and <strong>Base-58 result's prefix</strong> for different types of Bitcoin addresses.</p>
<p>I came across the content here: <a href="https://en.bitcoin.it/wiki/List_of_address_prefixes" rel="nofollow noreferrer">https://en.bitcoin.it/wiki/List_of_address_prefixes</a>, which does not contain information about <strong>Decimal</strong>, <strong>prefix Hex</strong> for Bech32 addresses (I guess they also called SegWit address, right?)</p>
<p>So, I checked this chart here:
<a href="https://en.bitcoin.it/w/images/en/4/48/Address_map.jpg" rel="nofollow noreferrer">https://en.bitcoin.it/w/images/en/4/48/Address_map.jpg</a> but, I don't understand the meaning of &quot;<strong>x03x03x00x02x03</strong>&quot;.</p>
<ol>
<li>If x00 equal 0x00 in hex and x80 equal 0x80 in hex, how should I interpret x03x03x00x02x03?</li>
<li>What is the <strong>version</strong> prefix for Bech32 addresses (bc1 addresses)?</li>
</ol>

<bitcoin-core><address><segregated-witness>
Version prefix used for Bech32 addresses
Andy_Jake
# Version prefix used for Bech32 addresses

(Asked by: username_0 on 2020-10-17)

I was compiling a table for **Version prefix (hex)** and **Base-58 result's prefix** for different types of Bitcoin addresses.

I came across the content here: <https://en.bitcoin.it/wiki/List_of_address_prefixes>, which does not contain information about **Decimal**, **prefix Hex** for Bech32 addresses (I guess they also called SegWit address, right?)

So, I checked this chart here:
<https://en.bitcoin.it/w/images/en/4/48/Address_map.jpg> but, I don't understand the meaning of "**x03x03x00x02x03**".

1. If x00 equal 0x00 in hex and x80 equal 0x80 in hex, how should I interpret x03x03x00x02x03?
2. What is the **version** prefix for Bech32 addresses (bc1 addresses)?

**Tags:** bitcoin-core, address, segregated-witness


---

## 1 answers

### Answer by username_1 on 2020-10-17. Score: 1 | Accepted answer

Those bytes (x03x03x00x02x03 or better shown as `0x0303000203`) are the expanded human readable part. You can find the code on [BIP-173](https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki).

```
def bech32_hrp_expand(s):
  return [ord(x) >> 5 for x in s] + [0] + [ord(x) & 31 for x in s]

```

The problem however is that unlike Base58 encoding, those bytes are only used in calculation of checksum *not* as the starting bytes. Which makes the picture misleading in my opinion.

Bech32 encoding is very different from Base58 encoding as there is no "version prefix". There is an Hrp, a witness version, a data (hash) and a checksum. `Witness version | hash` are the data being encoded and `expanded_hrp | data` is used in checksum calculation (`|` is concatination).

> **Comments:**
> **username_0**: thanks for the response. I doubted the same. Upvoting and accepting the answer.  

---

