user119698: 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

user208: Native segwit addresses are not encoded using base58, but using a different encoding system called bech32. The details can be found in BIP 173. For the  segwit v1+ addresses that will be used for Taproot, see the amended bech32m encoding in BIP 350.
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.


119698: <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>
 208: <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>
