Hey everybody!
I started reading about Bitcoin this weekend and I've got 2 open questions before daring the step to invest money into it.
I've read about the different kind of wallets and since I only want to invest I'd be interested in an offline created paper wallet for cold storage. Now I've followed the steps on Bitcoins page with saving the key generator to my pc, going offline and well generating the key but I wondered: in theory isn't it possible that somehow somebody randomly generates the exact same private key I just did and thus gets access to my Bitcoins that are already linked to my private key? I know the chance is extremely low with 1 to 10^77 but still. Is it possible?
Another question I've got is, when I'm ready to spend my Bitcoins I'll link my private key to an online wallet right? A file will be created on my pc which I should always keep on an external device, encrypted and secured by a password. If I lose said external device or it breaks down shouldn't I still be able to acces my savings if I still have my private key? The one thing i definetly learned is, that I should never tell anyone my private key because if I do they can access my Bitcoins. But when they can shouldnt I be able to do so too even if I lose my wallet file?
Perhabs I've got some really heavy misconceptions with the whole concept of cryptocurrency and I just wanted to clarify them. I hope someone can help me with this
Thanks and cheers!
Florens
First thing is you misunderstand what private keys, public keys and addresses are. So let's clear that up first.
Private keys are 256bit random numbers. Private keys are never made public. They remain secret.
Public keys are derived from private keys and are mathematically related to them. You can't derive a private key from a public key. Each private key has just one public key. They are called a key pair. The public key is revealed to the world and the world uses it to verify transaction signatures generated by your secret private key without you having to expose said private key to the world. Bitcoin public keys are also 256bits.
Hash functions - Hash functions take arbitrary sized data and output numbers of a fixed size. They are one way functions. You can't take the output of a hash function and determine the input. Hash functions are used to create "fingerprints" of data. If even a single bit in the data changes the output of the hash function will change.
Bitcoin addresses are public keys run through hash functions. The hash functions used result in 160bit addresses.
Because 256bits is greater than 160bits all addresses can be unlocked by more than one public/private key pair. That's where the 296 comes from. But this refers to key pairs behind bitcoin addresses not private keys behind public keys. An address is not the same as a public key. It is the public key run through hash functions.
There is such a thing as a deterministic wallet and that uses a single random number to generate a whole tree of addresses. We don't call that random number a private key though. We call it a seed. Each address there has its own private key and they are indistinguishable from randomly generated keys to anyone who doesn't have the seed.
Addresses are derived from the 160-bit hash of the public key. Public key, used by network participants for verifying your signed transactions, is a 256-bit number.
Thus, there are many public keys (and corresponding private keys) that would match any given address.
This is called "hash collision" - a well studied, mostly theoretical concept.
The probability of this happening is astronomically small. The smallness of it is hard to express in words and to grasp intuitively.
Also see
https://www.reddit.com/r/Bitcoin/comments/1w1ipk/odds_the_same_private_key_will_be_generated_twice/This is from a reddit post. Yes, it is possible, but the chances are so small, you are more likely to be hit be an airplane.
And yes. As long as you have your private key, even if your system somewhere fails, you will be able to import the private key in a wallet like electrum, and thus access your keys.
See
http://docs.electrum.org/en/latest/faq.html#can-i-sweep-private-keys-from-other-bitcoin-clientsMore detailed,
http://www.thecleverest.com/importing-bitcoin-from-a-paper-wallet-into-electrum/But, with the private key, you can only recover the bitcoins on that adress, therefore it is better to also write down and remember the seed of your wallet.
Even though the private keys are generated from the same seed, you cannot derive the other private keys from it. It is however possible if you do have the master public key of wallet.