Bitcoin Forum

Other => Beginners & Help => Topic started by: unlimited_020 on August 24, 2014, 07:49:51 PM



Title: What if someone generates the same address/key as you?
Post by: unlimited_020 on August 24, 2014, 07:49:51 PM
First of all, does every public key have a corresponding private key or can more than one public key correspond to just one private key?

Could you not generate the same key as someone else by fluke? What happens if someone sends bitcoins to this key?


Title: Re: What if someone generates the same address/key as you?
Post by: BurtW on August 24, 2014, 08:54:56 PM
These have all been answered a million times before but I am in a good mood.  Next time try the search function please.
First of all, does every public key have a corresponding private key or can more than one public key correspond to just one private key?
Every public key is calculated directly from its corresponding private key.  There are slightly less than 2256 possible public/private key pairs.

Could you not generate the same key as someone else by fluke?
There are so many possible key pairs that it is, for all practical purposes, impossible to randomly generate any one of the key pairs that has been generated before.  Your next thought is "well is it possible, right?"  the next answer is "it is impossible for the human brain to begin to comprehend how large the number 2256 is, yes it may be mathematically possible but it is practically impossible given the lifetime of the universe, etc."

BTW there is a difference between a public key and a Bitcoin addresss.

There are only 2160 possible Bitcoin addresses so for every Bitcoin address there are, on average, 296 matching key pairs.  But have no fear.  It is still, for all practical purposes, given good random number generation, impossible to generate the same Bitcoin address twice even though there are "only" 2160 possible Bitcoin addresses.

What happens if someone sends bitcoins to this key?
I am not going to answer that because it is not going to happen.


Title: Re: What if someone generates the same address/key as you?
Post by: shorena on August 24, 2014, 09:18:11 PM
I remember a calculation of the likelyhood of that happening. IIRC a collision (2 identical private keys generated) is as likely as winning the lottery jackpot after getting struck by lighning 17 days in a row and surviving.

Another is: chance to find a hidden buckyball within the earth when randomly selecting a buckyballsize piece of it.

Or finding a specific water molecule in all watersources on earth (which actually is several times more likely)

Then there was this calculation that even counting to 2^256 with the most energy efficient machine possible according to thermodynamics would require more energy than our sun has left to give, if even you had a dysonsphere around it absorbing all of its energy.

Its the realm of likehood where all air molecules spontainiously go into a corner of the room and you suffocate


Title: Re: What if someone generates the same address/key as you?
Post by: BitCoinDream on August 24, 2014, 09:36:51 PM
First of all, does every public key have a corresponding private key or can more than one public key correspond to just one private key?

Could you not generate the same key as someone else by fluke? What happens if someone sends bitcoins to this key?

I am assuming that u r in a room now. All the air molecules in that room may get condensed at a corner of the room suffocating U to death. By second law of thermodynamics, it may happen. But is it happening ? U'll be surprised to know, there is more possibility of this to take place than the address collision u r assuming... :)


Title: Re: What if someone generates the same address/key as you?
Post by: unlimited_020 on August 24, 2014, 10:39:48 PM
Thanks guys for your patience.


Title: Re: What if someone generates the same address/key as you?
Post by: jeroenn13 on August 25, 2014, 05:39:05 PM
It could happen but the chances are very small.
There are a few people who are trying to get the same wallet but it takes years.


Title: Re: What if someone generates the same address/key as you?
Post by: DannyHamilton on August 25, 2014, 05:43:37 PM
it takes years.

No.

It takes billions of years.


Title: Re: What if someone generates the same address/key as you?
Post by: zetaray on August 25, 2014, 05:54:02 PM
I think moat people understand it will take billions of years to brute force an address, but it is still an extremely thin chance someone else can generate a key to your address. It just makes you feel insecure.


Title: Re: What if someone generates the same address/key as you?
Post by: srgkrgkj on August 25, 2014, 05:57:23 PM
IT would take millions of years even with some of the best hardware :P


Title: Re: What if someone generates the same address/key as you?
Post by: DannyHamilton on August 25, 2014, 05:59:46 PM
it is still an extremely thin chance someone else can generate a key to your address.

The word "extremely" doesn't explain how unlikely it is.  It's like saying that there is an extremely thin chance that all the air molecules in the room could spontaneously collect in one corner and suffocate me to death, so I feel insecure in all rooms.

It just makes you feel insecure.

Only if you have a poor understanding of probability and very large numbers.


Title: Re: What if someone generates the same address/key as you?
Post by: DannyHamilton on August 25, 2014, 06:00:10 PM
IT would take millions of years even with some of the best hardware :P

No.

It would take billions of years.


Title: Re: What if someone generates the same address/key as you?
Post by: Testing123 on August 25, 2014, 06:00:58 PM
I think moat people understand it will take billions of years to brute force an address, but it is still an extremely thin chance someone else can generate a key to your address. It just makes you feel insecure.

If you understand how incredibly low the chance is, you shouldn't feel insecure.

Here is what DannyHamilton responded to a very similar question a few months ago. ;D
 
It is also possible that all the air in the room will spontaneously collect in one corner suffocating everyone in the room.  The chance is extremely low, so low it is like impossible, but extremely low chance does not equal impossible.

Now ask any lay person if they think that it is possible for all the air in the room to suddenly collect tightly in a corner leaving everyone to suffocate, and we'll see if "impossible" in general use means what you think it means.


EDIT: Oops, DannyHamilton mentioned that analogy faster than me. ;D


Title: Re: What if someone generates the same address/key as you?
Post by: Abdussamad on August 26, 2014, 10:03:44 AM
This will blow your mind:

http://lmgtfy.com/?q=bitcoin+quantum+sun+pic


Title: Re: What if someone generates the same address/key as you?
Post by: LiteCoinGuy on August 26, 2014, 10:15:40 AM
I remember a calculation of the likelyhood of that happening. IIRC a collision (2 identical private keys generated) is as likely as winning the lottery jackpot after getting struck by lighning 17 days in a row and surviving.



lucky bastard  ;D


Title: Re: What if someone generates the same address/key as you?
Post by: BitcoinBadger on August 26, 2014, 03:32:28 PM
Answer is simply No.


Title: Re: What if someone generates the same address/key as you?
Post by: 07Ghost on August 27, 2014, 07:51:32 AM
it takes years.

No.

It takes billions of years.

At that time maybe cryptocurrency not exist  ;D   
who knows


Title: Re: What if someone generates the same address/key as you?
Post by: melisande on August 27, 2014, 10:33:02 AM
it takes years.

No.

It takes billions of years.

At that time maybe cryptocurrency not exist  ;D   
who knows

its just not possible   ;D ;D ;D


Title: Re: What if someone generates the same address/key as you?
Post by: Kluge on August 27, 2014, 10:42:57 AM
Somewhere, I made calculations on this, but the gist is that it's many multitudes more likely for someone running one slow program to correctly guess the name, ID#, and CW2 of a credit card with an active LoC than it is for hundreds of botnets of hundreds of thousands of computers all running hyper-efficient software generating addresses to find a funded address.

Like Burt says, it's basically impossible for an incidental collision, and it's also basically impossible to intentionally find a used or funded BTC address. -But to answer your question, they'd be able to spend and send bitcoin in/to the address just like you.

ETA:
Here are the chances:
Assuming 500K addresses which either have funds or will have funds within next three months,
0.0000000000000000000000000000000000000000034211388289180104270598866779539% chance per check.

Assuming average computer can do 250 optimized DSV-like checks per second,
0.00000000000000000000000000000000000000085528470722950260676497166948848% chance per second.

Assuming a "theft pool" is formed, and 500 of these computers averaging the above click/s,
0.00000000000000000000000000000000000042764235361475130338248583474424% chance per second.

Assuming each theft pool is one botnet, and 20 botnets, exactly the same, exist in these theft pools,
0.0000000000000000000000000000000000085528470722950260676497166948848% chance per second.

Per minute,
0.00000000000000000000000000000000051317082433770156405898300169309%

Per hour,
0.000000000000000000000000000000030790249460262093843538980101585%

Per day,
0.00000000000000000000000000000073896598704629025224493552243804%

Per month (30D),
0.000000000000000000000000000022168979611388707567348065673141%

Per year,
0.00000000000000000000000000026972258527189594206940146568988%


Assume worst-case scenario, DSV-like software can check 5000 addresses (10M of which are funded or will be funded within 6 months) per second, and 100 botnets of 50,000 computers each...
Per day,
0.000000000000000000000000014779319740925805044898710448761%

Per month,
0.00000000000000000000000044337959222777415134696131346283%

Per year,
0.0000000000000000000000053944517054379188413880293137978%

Per century,
0.00000000000000000000053944517054379188413880293137978%


Are we done, now? :)


ETA: Worse-than-worst case scenario. NSA can check 1T addresses per second, 1T addresses are funded.
Per century,
0.0000000000000021577806821751675365552117255191%

Per billion centuries,
0.0000021577806821751675365552117255191%

for credit card:
What is the probability (per check) of finding a valid, activated credit card number and selecting the correct CVV, cardholder's name, and expiration date, assuming the expiration date is not beyond five years into the future?

Maybe just for a US Capital One MasterCard credit card, to keep things simple. Uses MOD 10 algorithm. http://en.wikipedia.org/wiki/Mod_10 The first six digits of these cards are 517805. Digits 7-15 are unknown - the account ID #. Digit 16 is the MOD 10 checksum number.

This means there is a total pool of 99,999,999 accounts. Assume 10,000,000 are activated.

Expiration date is simple. Most (all?) aren't valid for more than 5 years. That gives a 1/60 chance of getting only the expiration date correct per check.

Cardholder's name is more of a clusterfuck. Let's assume only looking at "black" and "white" names (we're looking for a US account, remember) gives you 85% of all total active accounts. Let's assume common names make up 60% of all total active accounts, and that there are 50,000 common name combinations.

CVV is easy, and we'll assume we don't know how Capital One comes up with these numbers, so it's a simple 1/999 chance.

So. We need to successfully correct all of them in one go, and we have one ~1/10 chance (account #), one 1/60 chance (exp. date), one ~1/83333 chance (cardholder name), one 1/999 chance (CVV).

I think the per-check probability of all this comes to .000000000020020100300621424707921073926538% (low confidence, someone smart should check this because I originally posted this post as a question but ended up giving enough data where I thought I could solve it).

Keep in mind, per-check chance of finding funded bitcoin address is ~0.0000000000000000000000000000000000000000034211388289180104270598866779539%.

To make the numbers a little easier to grasp, here is %chance of finding bitcoin address if "DSV-like software can check 5000 addresses (10M of which are funded or will be funded within 6 months) per second, and 100 botnets of 50,000 computers each":
Per century,
0.00000000000000000000053944517054379188413880293137978%
If 100 botnets of 50,000 computers could check only 1,000 addresses per second (5x slower than above stats for bitcoin), the chance of correctly guessing info on an activated credit card is:
Per century,
10.01005015031071235396%

ETA: I left out PIN number. Point still stands.


Title: Re: What if someone generates the same address/key as you?
Post by: btchaste on August 27, 2014, 01:27:16 PM
Every now and then someone ask this question but the answer is written everywere, also in the bitcoin wiki.


Title: Re: What if someone generates the same address/key as you?
Post by: monsterbitty on August 27, 2014, 01:32:27 PM
The Possibility is always zero to get the same key, it is not impossible but just wait millions of years to get it :).


Title: Re: What if someone generates the same address/key as you?
Post by: nicepumper on August 27, 2014, 02:42:56 PM
All these math are making my brain hurt, thanks.


Title: Re: What if someone generates the same address/key as you?
Post by: kittycatbtc on August 27, 2014, 03:19:28 PM
So by what i understood, another reason BTC is superior to credit cards  8)


Title: Re: What if someone generates the same address/key as you?
Post by: thecast on August 27, 2014, 04:48:44 PM
So you have more chances at winning the lottery?  ;D


Title: Re: What if someone generates the same address/key as you?
Post by: DannyHamilton on August 27, 2014, 05:35:18 PM
So you have more chances at winning the lottery?  ;D

I suppose that depends on the lottery.  Different lotteries have different odds.  However, any lottery that has the same odds of winning as the odds of generating the same bitcoin address as someone else would be a lottery that nobody would play (since nobody would ever win).


As an example, lets assume that it's after the year 2140 and all the bitcoins that will ever exist have already been mined.

To demonstrate how unlikely it is, lets assume that nobody ever lost any private keys and no bitcoins have ever been permanently lost, so ALL bitcoins are accessible.  Then lets assume that all the bitcoins are spread out into the smallest possible outputs.  That would result in 2,099,999,997,690,000 addresses each with exactly 0.00000001 BTC in them.  This gives you the largest possible set of bitcoin addresses that could ever exist with bitcoins in them.

Given that you are trying to find any one of 2,099,999,997,690,000 different addresses out of a total of approximately 1.46 X 1048 possible addresses, your odds of "winning" on any given attempt are approximately 1 in 6.96 X 1032

Looking at the Mega Millions lottery that is popular in the United States, the odds of winning the jackpot with a single set of 6 numbers are:
1 in 258,890,850

If I haven't messed up my math, the odds of winning the Mega Millions lottery jackpot twice in a row with that same set of numbers are therefore:
1 in 6.7 X 1016

The odds of winning the Mega Millions lottery jackpot three times in a row with that same set of numbers are then:
1.7 X 1025

We finally have better odds of finding a bitcoin address that has a balance if we compare to the odds of winning the Mega Millions lottery jackpot four times in a row with the same exact set of 6 numbers every time: 4.5 X 1033

Of course there aren't actually 2,099,999,997,690,000 different addresses that are holding a bitcoin balance (and there never will be due to lost bitcoins and the fact that people will generally store more than 0.00000001 BTC per adddress).  If we use a more realistic number (perhaps something like 2,100,000,000 addresses with a balance) we find that:

You have better odds of winning the Mega Millions lottery jackpot all four times on your next four attempts with the exact same set of 6 numbers each time than you will ever have of have of generating a bitcoin address that already exists in a single attempt.



Title: Re: What if someone generates the same address/key as you?
Post by: Vortex20000 on August 28, 2014, 12:31:59 AM
I can get an account cracked... in, according to my computer, E-988985950 years.



Title: Re: What if someone generates the same address/key as you?
Post by: bitkilo on August 28, 2014, 11:44:40 AM
First of all, does every public key have a corresponding private key or can more than one public key correspond to just one private key?
Every public key is calculated directly from its corresponding private key.  There are slightly less than 2256 possible public/private key pairs.

yes I don't think it will happen anytime soon because that is 1 big fuckin number of possibilities, something like
1.157920893×10^77. Well that's what a mate told me it was and he is pretty smart. I can't claim I worked that out.
Can't see it happening in my lifetime.


Title: Re: What if someone generates the same address/key as you?
Post by: cassimares on August 28, 2014, 11:52:01 AM
I dont get it, you mean there is a chance the private key would be same?


Title: Re: What if someone generates the same address/key as you?
Post by: Kluge on August 28, 2014, 12:00:45 PM
I dont get it, you mean there is a chance the private key would be same?
Absolutely, but it's millions times more likely your dad's actually your maternal grandpa.


Title: Re: What if someone generates the same address/key as you?
Post by: DannyHamilton on August 28, 2014, 01:00:26 PM
Can't see it happening in my lifetime.

As long as the private keys are randomly generated with proper entropy, I can't see if happening in the lifetime of any human being that will ever exist on the face of the earth.

I dont get it, you mean there is a chance the private key would be same?

Only if the wallet is using a faulty random number generator.  As long as the private key is randomly generated with sufficient entropy, it won't ever happen.

If there is a bug in some wallet software, then it is possible that it will generate an insufficiently random number resulting in another copy of that software generating the same random number for someone else.


Title: Re: What if someone generates the same address/key as you?
Post by: BurtW on August 28, 2014, 04:45:39 PM
First of all, does every public key have a corresponding private key or can more than one public key correspond to just one private key?
Every public key is calculated directly from its corresponding private key.  There are slightly less than 2256 possible public/private key pairs.

yes I don't think it will happen anytime soon because that is 1 big fuckin number of possibilities, something like
1.157920893×10^77. Well that's what a mate told me it was and he is pretty smart. I can't claim I worked that out.
Can't see it happening in my lifetime.

10x = 2256

ln(10x) = ln(2256)

x(ln(10)) = 256(ln(2))

x = 256(ln(2))/(ln(10))

x = 77.06367888997918597471715704947

2256 = 1077.06367888997918597471715704947
      = 10(0.06367888997918597471715704947 + 77)
      = (100.06367888997918597471715704947)(1077)
      = 1.1579208923731619542357098500863 * 1077

Math is fun.



Title: Re: What if someone generates the same address/key as you?
Post by: DannyHamilton on August 28, 2014, 04:52:06 PM
Math is fun.

Agreed.

However, if you trust Google to be able to handle basic mathematics properly, you can also just enter:

2^256

into the Google search text box and click the "Google Search" button.

https://i.imgur.com/3OnmmNg.png


Title: Re: What if someone generates the same address/key as you?
Post by: BurtW on August 28, 2014, 05:32:20 PM
That is not as much fun.  I can also just put 2256 into my calculator, still not a much fun.


Title: Re: What if someone generates the same address/key as you?
Post by: BitCoinDream on August 28, 2014, 06:41:51 PM
I think moat people understand it will take billions of years to brute force an address, but it is still an extremely thin chance someone else can generate a key to your address. It just makes you feel insecure.

If you understand how incredibly low the chance is, you shouldn't feel insecure.

Here is what DannyHamilton responded to a very similar question a few months ago. ;D
 
It is also possible that all the air in the room will spontaneously collect in one corner suffocating everyone in the room.  The chance is extremely low, so low it is like impossible, but extremely low chance does not equal impossible.

Now ask any lay person if they think that it is possible for all the air in the room to suddenly collect tightly in a corner leaving everyone to suffocate, and we'll see if "impossible" in general use means what you think it means.


EDIT: Oops, DannyHamilton mentioned that analogy faster than me. ;D

Interestingly I asked the question then... ::)


Title: Re: What if someone generates the same address/key as you?
Post by: g29wheel on August 28, 2014, 08:02:13 PM
Probably now you have understood that it's almost impossible to generate an existing address therefore don't worry about that :)


Title: Re: What if someone generates the same address/key as you?
Post by: Buo on August 28, 2014, 09:08:33 PM
This is a doubt which pop up every week or so, generating the same key is out of the question and there are math proofs for this.


Title: Re: What if someone generates the same address/key as you?
Post by: cookiemonsterwhat on August 28, 2014, 10:44:35 PM
If they have the same key, they would have access to your bitcoin..

But the odds of this ever happening is very slim.