Bitcoin Forum

Bitcoin => Bitcoin Discussion => Topic started by: SEnergy on November 28, 2015, 01:08:24 PM



Title: Is it possible to generate existing BTC private & public key pair?
Post by: SEnergy on November 28, 2015, 01:08:24 PM
is it theoretically possible to generate a private key of an existing btc address ?

the private key is basically just a random 256bit number, so if I'd know that number I could just create a new private key in WIF form, from which I'd create public key and btc address, or is there something more to this and one 256bit number can have multiple public keys and btc addresses?


Title: Re: Is it possible to generate existing BTC private & public key pair?
Post by: jordant on November 28, 2015, 01:19:41 PM
is it theoretically possible to generate a private key of an existing btc address ?

the private key is basically just a random 256bit number, so if I'd know that number I could just create a new private key in WIF form, from which I'd create public key and btc address, or is there something more to this and one 256bit number can have multiple public keys and btc addresses?
https://i.imgur.com/gUpaqXY.jpg


Title: Re: Is it possible to generate existing BTC private & public key pair?
Post by: Amph on November 28, 2015, 01:39:20 PM
that number is certanly impressive but there are more atom in the universe than the possible private key, so this lead me to think that in a very distant future sha256 will be broken

for the OP... it was asked already and it is not possible


Title: Re: Is it possible to generate existing BTC private & public key pair?
Post by: HardForkComing on November 28, 2015, 01:40:04 PM
that number is certanly impressive but there are more atom in the universe than the possible private key, so this lead me to think that in a very distant future sha256 will be broken

for the OP... it was asked already and it is not possible
SHA256 is already broken.


Title: Re: Is it possible to generate existing BTC private & public key pair?
Post by: DannyHamilton on November 28, 2015, 02:15:46 PM
is it theoretically possible to generate a private key of an existing btc address ?

That really depends on what you mean when you say "possible", and how the existing BTC address was generated.  As long as the private key for the BTC address was generated from a sufficiently random source, nobody else is ever going to generate the same number.  If the private key was generated from something without enough entropy such as a person choosing a password, or faulty random number generating software, then it becomes much more likely that the same private key could be generated.

the private key is basically just a random 256bit number,

This is true.  However, as jordant and Amph have both attempted to explain...

2256 is a VERY big number.  Much bigger than most people are able to comprehend.  The odds of generating the same random 256 bit number as someone else isn't just small, it's astronomically small.  It's so small that any reasonable person would consider it impossible.

so if I'd know that number I could just create a new private key in WIF form, from which I'd create public key and btc address,

Yes.  This is wy it is very important to keep your private keys secure.  If anyone else gains access to your private keys, then they can spend or steal your bitcoins.

or is there something more to this and one 256bit number can have multiple public keys and btc addresses?

If we are talking about P2PKH bitcoin addresses (the addresses that start with a "1"), then a single private key can actually be used for two different bitcoin addresses.  When converting the random number into WIF, you can choose compressed or uncompresses.  Compressed will result in a different address than uncompressed.  Once you have the private key in WIF, there is only 1 bitcoin address associated with that key.

Note that the opposite is not true.

There are 2256 different private keys.  However, P2PKH bitcoin addresses are a representation of a 2160 bit hash.  This means that an address can have multiple private keys.  If we divide the total number of keys by the total number of possible addresses we find that:

2256 / 2160 = 296

On average each possible P2PKH bitcoin address has 296 different private keys that can each spend any bitcoins that are received at that address.

So, while there is only a 1 in 2256 chance of generating the exact same private key as was originally used to create the P2PKH address, there is actually a 1 in 2160 chance of generating any 1 of the 296 different private keys that can all be used to spend bitcoins that are received at that address.

Fortunately, while not nearly as big of a number as 2256, 2160 is still a VERY big number.  Big enough that there shouldn't be any concern of anyone generating any of the private keys as long as the private key is originally generated from a random enough source.


Title: Re: Is it possible to generate existing BTC private & public key pair?
Post by: Small on November 28, 2015, 02:20:59 PM
that number is certanly impressive but there are more atom in the universe than the possible private key, so this lead me to think that in a very distant future sha256 will be broken

for the OP... it was asked already and it is not possible
SHA256 is already broken.
There is currently no weakness in SHA256 and ECDSA. SHA1 however, is weak and has collisions. Private keys can be calculated if quantum computing can break ECDSA. This means that private keys can be derived from public key. Public keys are broadcasted with a transaction. This isn't a huge threat since a fork can be done easily.


Title: Re: Is it possible to generate existing BTC private & public key pair?
Post by: fr4nkthetank on November 28, 2015, 02:21:54 PM
the number of possibilities is TOO damn high !


Title: Re: Is it possible to generate existing BTC private & public key pair?
Post by: Snail2 on November 28, 2015, 02:43:37 PM
Theoretically possible, but damn hard to get it done in practice. So I'd say at the current commercially available technical level it's nearly impossible.


Title: Re: Is it possible to generate existing BTC private & public key pair?
Post by: Slark on November 28, 2015, 02:49:11 PM
I will use metaphor to answer this: It is 100% certain from scientific point of view that there are life in universe somewhere. But did you see the aliens?
It is the same with BTC public and private keys.


Title: Re: Is it possible to generate existing BTC private & public key pair?
Post by: ProfessionalGoogler on November 28, 2015, 02:55:38 PM
In the matrix we would call this an anomaly which is of course possible.

Yes, yes... it is possible for you to generate the same address as someone else... But I mean.. so is time travel..   8)


Title: Re: Is it possible to generate existing BTC private & public key pair?
Post by: AncilVTwo on November 28, 2015, 03:15:05 PM
is it theoretically possible to generate a private key of an existing btc address ?

That really depends on what you mean when you say "possible", and how the existing BTC address was generated.  As long as the private key for the BTC address was generated from a sufficiently random source, nobody else is ever going to generate the same number.  If the private key was generated fro something without enough entropy such as a person choosing a password, or faulty random number generating software, then it becomes much more likely that the same private key could be generated.

the private key is basically just a random 256bit number,

This is true.  However, as jordant and Amph have both attempted to explain...

2256 is a VERY big number.  Much bigger than most people are able to comprehend.  The odds of generating the same random 256 bit number as someone else isn't just small, it's astronomically small.  It's so small that any reasonable person would consider it impossible.

so if I'd know that number I could just create a new private key in WIF form, from which I'd create public key and btc address,

Yes.  This is wy it is very important to keep your private keys secure.  If anyone else gains access to your private keys, then they can spend or steal your bitcoins.

or is there something more to this and one 256bit number can have multiple public keys and btc addresses?

So, while there is only a 1 in 2256 chance of generating the exact same private key as was originally used to create the P2PKH address, there is actually a 1 in 2160 chance of generating any 1 of the 296 different private keys that can all be used to spend bitcoins that are received at that address.

Fortunately, while not nearly as big of a number as 2256, 2160 is still a VERY big number.  Big enough that there shouldn't be any concern of anyone generating any of the private keys as long as the private key is originally generated from a random enough source.
i didnt know bitcoin addresses can have multiple private keys, i always thought it was oner per address lol. thanks for the info.


Title: Re: Is it possible to generate existing BTC private & public key pair?
Post by: Sanjx on November 28, 2015, 03:20:07 PM
That would be REALLY, REALLY hard to do, but not impossible. Danny's post explains it all. It's really hard to happen.


Title: Re: Is it possible to generate existing BTC private & public key pair?
Post by: odolvlobo on November 28, 2015, 07:52:59 PM
Here is another analogy:

There are around 5x1046 water molecules on the earth (1.4x1021 liters according to the USGS (http://water.usgs.gov/edu/earthhowmuch.html))
There are 1.46x1048 bitcoin addresses.

Suppose I pick a single water molecule somewhere on the earth and I generate a single bitcoin address. If you also pick a water molecule and generate a bitcoin address, you are 30 times more likely to pick the same water molecule than to generate the same bitcoin address.


Title: Re: Is it possible to generate existing BTC private & public key pair?
Post by: odolvlobo on November 28, 2015, 08:38:00 PM
Here is another analogy:

There are approximately 1x1044 molecules of air in the atmosphere.
There are 1.46x1048 bitcoin addresses.

Suppose I pick a single molecule of air and I generate a single bitcoin address. If you also pick a molecule of air and generate a bitcoin address, you are 15000 times more likely to pick the same molecule than to generate the same bitcoin address.


Title: Re: Is it possible to generate existing BTC private & public key pair?
Post by: Meuh6879 on November 28, 2015, 08:53:01 PM
is it theoretically possible to generate a private key of an existing btc address ?

No.

Proof : https://www.youtube.com/watch?v=ZloHVKk7DHk