<p>We don't have a one-to-one mapping in the sense that you are talking about. But, for practical purposes, we have a one-to-one mapping. Yes, if someone tried to map every single key, after a few million centuries, they'd have a problem. But we won't have to worry about that until long after the stars burn out.</p>

<p>To find two keys that hash to the same ID, you'd have to try on average 2^80 keys. If you had a million computers, each capable of trying 1,000 keys a second, it would take 380,000 centuries to find a single match. And all you could do with those two keys was claim money sent to the same ID with either one, which would cause no harm at all.</p>

<p>Now, if you want to find a key that matches a key that actually has Bitcoins already, that's a much harder task. Say there are 10,000,000 IDs that have coins. The odds of a single key matching one of these 10,000,000 is 2^160/10,000,000 -- even with 1,000,000 computers each trying 1,000 keys a second, it would take billions of billions of centuries.</p>

<p>So for practical purposes, it's one-to-one.</p>

CC BY-SA 3.0
2011-11-29T18:04:18.300Z
In the first part of the answer you say 2^80 keys and in the second part you say 2^160, but you don't explain how to get from one to the other.  Also, I calculated 10^89 and you have 2^80.  My 10^89 is from 58 character possibilities (a-z|A-Z|0-9) X 61 digits.
shoeless joe
CC BY-SA 3.0
2011-11-29T19:44:26.420Z
How many people do you need to have a 50/50 chance of finding a person with a birthday on May 11? How many people do you need to have a 50/50 chance of finding two people with the same birthday? That's the reason for the difference. Your math is wrong because some of the information is redundant. The [account ID is derived from a 160-bit hash](https://en.bitcoin.it/wiki/Protocol_specification#Addresses) so there are only 2^160 possible, valid addresses.
David Schwartz
CC BY-SA 3.0
2011-11-29T04:13:19.387Z
2011-11-29T04:53:50.740Z
2011-11-29T04:53:50.740Z
David Schwartz
<p>If public keys are 34 characters long, and private keys are 61 characters long, then the combinations of 34 characters is not sufficient to give each combination of 61 characters a unique pair.</p>

<p>My calculations show 8.6 * 10^89 combinations for a private key.  </p>

<p>And 9.0 * 10^59 combinations for a public key.</p>

<p>So how do we have one-to-one mapping?</p>

<p>(Please correct me if I am wrong).</p>

CC BY-SA 3.0
2012-12-13T17:38:53.190Z
Do your calculations take into account that Base58 won't allow certain characters in the hash?
makerofthings7
CC BY-SA 3.0
2011-11-29T01:24:33.507Z
You should review your older questions and mark correct answers.
Serith
<encryption><cryptography>
How do we have one-to-one mapping given the key size differences?
shoeless joe
# How do we have one-to-one mapping given the key size differences?

(Asked by: username_0 on 2011-11-29)

If public keys are 34 characters long, and private keys are 61 characters long, then the combinations of 34 characters is not sufficient to give each combination of 61 characters a unique pair.

My calculations show 8.6 \* 10^89 combinations for a private key.

And 9.0 \* 10^59 combinations for a public key.

So how do we have one-to-one mapping?

(Please correct me if I am wrong).

**Tags:** encryption, cryptography

> **Comments:**
> **username_2**: You should review your older questions and mark correct answers.  
> **username_1**: Do your calculations take into account that Base58 won't allow certain characters in the hash?  

---

## 1 answers

### Answer by username_3 on 2011-11-29. Score: 2

We don't have a one-to-one mapping in the sense that you are talking about. But, for practical purposes, we have a one-to-one mapping. Yes, if someone tried to map every single key, after a few million centuries, they'd have a problem. But we won't have to worry about that until long after the stars burn out.

To find two keys that hash to the same ID, you'd have to try on average 2^80 keys. If you had a million computers, each capable of trying 1,000 keys a second, it would take 380,000 centuries to find a single match. And all you could do with those two keys was claim money sent to the same ID with either one, which would cause no harm at all.

Now, if you want to find a key that matches a key that actually has Bitcoins already, that's a much harder task. Say there are 10,000,000 IDs that have coins. The odds of a single key matching one of these 10,000,000 is 2^160/10,000,000 -- even with 1,000,000 computers each trying 1,000 keys a second, it would take billions of billions of centuries.

So for practical purposes, it's one-to-one.

> **Comments:**
> **username_0**: In the first part of the answer you say 2^80 keys and in the second part you say 2^160, but you don't explain how to get from one to the other.  Also, I calculated 10^89 and you have 2^80.  My 10^89 is from 58 character possibilities (a-z|A-Z|0-9) X 61 digits.  
> **username_3**: How many people do you need to have a 50/50 chance of finding a person with a birthday on May 11? How many people do you need to have a 50/50 chance of finding two people with the same birthday? That's the reason for the difference. Your math is wrong because some of the information is redundant. The [account ID is derived from a 160-bit hash](https://en.bitcoin.it/wiki/Protocol_specification#Addresses) so there are only 2^160 possible, valid addresses.  

---

