<p>Native segwit addresses are not encoded using base58, but using a different encoding system called bech32. The details can be found in <a href="https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki" rel="nofollow noreferrer">BIP 173</a>. For the  segwit v1+ addresses that will be used for Taproot, see the amended bech32m encoding in <a href="https://github.com/bitcoin/bips/blob/master/bip-0350.mediawiki" rel="nofollow noreferrer">BIP 350</a>.</p>
<p>In short, the addresses consist of:</p>
<ul>
<li>A <em>human readable part</em>, which is <code>bc</code> for Bitcoin mainnet segwit addresses.</li>
<li>A separator (<code>1</code>)</li>
<li>A payload (storing the actual script data), consisting of:
<ul>
<li>A character for the witness version (<code>q</code> for witness v0, <code>p</code> for witness v1, ...). See the BIPs for details on the character set.</li>
<li>A variable number of characters storing the witness program (32 characters for 20-byte witness programs like P2WPKH has; 52 characters for 32-byte witness programs like P2WSH or P2TR have). The 8-bit data is converted to 5-bit groups, and encoded using the bech32 character set.</li>
</ul>
</li>
<li>6 characters checksum, using the checksum algorithm specified in BIP173 or BIP350.</li>
</ul>

CC BY-SA 4.0
2021-07-24T15:05:24.577Z
2021-07-24T15:05:24.577Z
Pieter Wuille
<p>I've seen lots of tables on which bytes to use as the prefix for types of addresses. For example 0x00 for legacy addresses starting with a 1. But what's the prefix for native segwit 'bc1q'? I've tried using the base58 table with no success.
Thanks</p>

<segregated-witness><bech32-address><base58><bip350-bech32m>
What is the prefix number, in bytes, of a native segwit address?
Chiru
# What is the prefix number, in bytes, of a native segwit address?

(Asked by: username_0 on 2021-07-24)

I've seen lots of tables on which bytes to use as the prefix for types of addresses. For example 0x00 for legacy addresses starting with a 1. But what's the prefix for native segwit 'bc1q'? I've tried using the base58 table with no success.
Thanks

**Tags:** segregated-witness, bech32-address, base58, bip350-bech32m


---

## 1 answers

### Answer by username_1 on 2021-07-24. Score: 4

Native segwit addresses are not encoded using base58, but using a different encoding system called bech32. The details can be found in [BIP 173](https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki). For the segwit v1+ addresses that will be used for Taproot, see the amended bech32m encoding in [BIP 350](https://github.com/bitcoin/bips/blob/master/bip-0350.mediawiki).

In short, the addresses consist of:

* A *human readable part*, which is `bc` for Bitcoin mainnet segwit addresses.
* A separator (`1`)
* A payload (storing the actual script data), consisting of:
  + A character for the witness version (`q` for witness v0, `p` for witness v1, ...). See the BIPs for details on the character set.
  + A variable number of characters storing the witness program (32 characters for 20-byte witness programs like P2WPKH has; 52 characters for 32-byte witness programs like P2WSH or P2TR have). The 8-bit data is converted to 5-bit groups, and encoded using the bech32 character set.
* 6 characters checksum, using the checksum algorithm specified in BIP173 or BIP350.


---

