<p>Keep in mind that both types of addresses, assuming we are comparing P2PKH with P2WPKH addresses, are just encoding the hash of a public key. The hash used in both address types is a <code>RIPEMD-160(SHA-256(public key))</code>, so regardless of the encoding, the number of possible valid addresses remains the same. Each address format is simply encoded with a different checksum system, different version system, and different characters. But neither address format is actually ever used within bitcoin transactions themselves, they both just get &quot;unwrapped&quot; when given to a wallet.</p>

CC BY-SA 3.0
2018-01-26T20:26:35.827Z
So, Bech32 just encodes a raw address.
Willtech
CC BY-SA 3.0
2018-01-27T18:14:39.920Z
There is no such thing as a "raw address". Every address is a shorthand notation for a particular scriptPubKey. SegWit scriptPubKeys still contain a 160-bit hash, so Bech32 addresses must do the same. Otherwise it would be impossible to construct a transaction using such an address.
Pieter Wuille
CC BY-SA 4.0
2018-01-26T11:31:01.837Z
2020-11-30T17:02:25.083Z
2020-11-30T17:02:25.083Z
meshcollider
<p>I have wondered how many Bitcoin addresses are possible. When looking around, I stumbled upon <a href="https://bitcointalk.org/index.php?topic=24268.0" rel="nofollow noreferrer">this thread</a> on BitcoinTalk:</p>
<blockquote>
<p>There are exactly 2^160 possible addresses as long as we keep using
RIPE-MD160.</p>
<p>2^160 is
1,461,501,637,330,902,918,203,684,832,716,283,019,655,932,542,976.</p>
</blockquote>
<p>Then I wondered if there are less possible addresses with the Bech32-format, specified by <a href="https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki" rel="nofollow noreferrer">BIP 0173</a>.</p>
<p>Besides, you cannot use uppercase format of characters in your computation, and some numbers as letters, such as i/1 and o/0 characters/numbers are excluded in Bech32 format.</p>
<p>Should that not decrease the possible amount of Bitcoin addresses dramatically, and decrease the security of Bitcoin?</p>
<p>So, I would like to know how many possible Bitcoin addresses there are with Bech32 format. How could I calculate it? What will the total number (plain long number, not the squared one, I'm not good in math) of possibilities be with the restrictions of Bech32 then?</p>

CC BY-SA 3.0
2018-01-26T09:10:09.087Z
Bech32 addresses are not shorter by any means (42 instead of 34 characters for typical ones).
Pieter Wuille
CC BY-SA 3.0
2018-01-26T11:03:13.707Z
Thanks for your explaination, Pieter. I have edited my post, regarding your comment. And I hope you don't mind my poor English (Ik ben overigens Nederlands). 
Should it be reasonable to assume there will be less possible addresses with Bech32 format, compared with the old Bitcoin addresses (2^160)?
ReneFroger
CC BY-SA 4.0
2020-11-30T17:41:51.610Z
No, there are far more Bech32 addresses than P2PKH addresses.
Pieter Wuille
<segregated-witness><bech32-address><key-collision>
Does the Bech32 address format decrease Bitcoin's possible address count?
ReneFroger
# Does the Bech32 address format decrease Bitcoin's possible address count?

(Asked by: username_0 on 2018-01-25)

I have wondered how many Bitcoin addresses are possible. When looking around, I stumbled upon [this thread](https://bitcointalk.org/index.php?topic=24268.0) on BitcoinTalk:

> There are exactly 2^160 possible addresses as long as we keep using
> RIPE-MD160.
>
> 2^160 is
> 1,461,501,637,330,902,918,203,684,832,716,283,019,655,932,542,976.

Then I wondered if there are less possible addresses with the Bech32-format, specified by [BIP 0173](https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki).

Besides, you cannot use uppercase format of characters in your computation, and some numbers as letters, such as i/1 and o/0 characters/numbers are excluded in Bech32 format.

Should that not decrease the possible amount of Bitcoin addresses dramatically, and decrease the security of Bitcoin?

So, I would like to know how many possible Bitcoin addresses there are with Bech32 format. How could I calculate it? What will the total number (plain long number, not the squared one, I'm not good in math) of possibilities be with the restrictions of Bech32 then?

**Tags:** segregated-witness, bech32-address, key-collision

> **Comments:**
> **username_1**: Bech32 addresses are not shorter by any means (42 instead of 34 characters for typical ones).  
> **username_0**: Thanks for your explaination, username_1. I have edited my post, regarding your comment. And I hope you don't mind my poor English (Ik ben overigens Nederlands).  Should it be reasonable to assume there will be less possible addresses with Bech32 format, compared with the old Bitcoin addresses (2^160)?  
> **username_1**: No, there are far more Bech32 addresses than P2PKH addresses.  

---

## 1 answers

### Answer by username_2 on 2018-01-26. Score: 5

Keep in mind that both types of addresses, assuming we are comparing P2PKH with P2WPKH addresses, are just encoding the hash of a public key. The hash used in both address types is a `RIPEMD-160(SHA-256(public key))`, so regardless of the encoding, the number of possible valid addresses remains the same. Each address format is simply encoded with a different checksum system, different version system, and different characters. But neither address format is actually ever used within bitcoin transactions themselves, they both just get "unwrapped" when given to a wallet.

> **Comments:**
> **username_3**: So, Bech32 just encodes a raw address.  
> **username_1**: There is no such thing as a "raw address". Every address is a shorthand notation for a particular scriptPubKey. SegWit scriptPubKeys still contain a 160-bit hash, so Bech32 addresses must do the same. Otherwise it would be impossible to construct a transaction using such an address.  

---

