Hi dev, I didn't get my answer elsewhere.
So I deleted my post on another topic and reposting it here.
Does anyone know how many of 2^160 addresses are uncompressed? How many compressed. Is it correct to assume that there are 2^128(compressed)×2^32(uncompressed) addresses? Whatever the correct answer is. Could we just search in 160 bit range for both un/compressed addresses with only half the performance while searching in 256 bit range is exponentially harder?
Not sure what you are really asking/maybe I am misunderstanding your question but here goes:
We will just stick with legacy public addresses, or those that start with a "1".
You can generate just under 2^256 private keys, multiplied by the gen point, that translate to a public key, an x and y coordinate.
For uncompressed, it takes both the x and y coords, adds a "04" to the beginning, and does a sha256.
For compressed, it takes the x coord and if y is even, then public key starts with 02, if odd, starts with 03; and then does a sha256.
Now, for both uncompressed and compressed, it takes the resulting public key, a sha256, and performs a ripemd-160 of the resulting sha256.
Private key(gen)
Public key(whether uncompressed "04..." or compressed "02..." or "03..."
SHA256(Public key)
RIPEMD-160(SHA256)
For the purpose of this convo, this is all we will look at.
In theory, you can have 2^160 uncompressed addresses and/or 2^160 compressed addresses. Which again, in theory, many of those will overlap, meaning you could derive an uncompressed public address from private key 14ed2324 that also is the same public address as a compressed address from private key ed83ad448367.
Again, in theory, if you generated 2^160 uncompressed public keys (generated from x and y coords, starting with 04), or if you generated 2^160 compressed public keys (using only the x coord and the y parity (odd/even), you would in theory, have created all available public bitcoin addresses starting with "1".
So I would say there are 2^160 uncompressed public addresses and 2^160 compressed addresses lol.
1-Private ECDSA Key
12 (in hex)
2-Public ECDSA Key
045601570CB47F238D2B0286DB4A990FA0F3BA28D1A319F5E7CF55C2A2444DA7CCC136C1DC0CBEB930E9E298043589351D81D8E0BC736AE2A1F5192E5E8B061D58 (uncompressed)
3-SHA-256 hash of 2
0DA4D8594DA0D4A518922AF0E96D54857A1BBB7FA895C936BE434A43F3C304CF
4-RIPEMD-160 Hash of 3
6FC2F6488DCE92411D2498CB969B739BEFCC7988
5-Adding network bytes to 4
006FC2F6488DCE92411D2498CB969B739BEFCC7988
6-SHA-256 hash of 5
89C6CC88C80563B115A6F29060B0480729299E7EF40879047D0A340DC0E5F5C4
7-SHA-256 hash of 6
69BD5949E7E0D9F8E06258C6E2A59736726C311E13C8AF416E2D9355F7DE6839
8-First four bytes of 7
69BD5949
9-Adding 8 to the end of 5
006FC2F6488DCE92411D2498CB969B739BEFCC798869BD5949
10-Base58 encoding of 9
1BBwZVdBjoPxotHfrKLpHJBSy7vmc2pjex (public address)