Bitcoin Forum

Other => Beginners & Help => Topic started by: Sausagesandwich on December 16, 2013, 01:09:40 PM



Title: Private/public key question
Post by: Sausagesandwich on December 16, 2013, 01:09:40 PM
Hi all.

I've looked around for an answer to a very simple question but I can't find anything that's enlightened me.

Am I right in saying that the bitcoin algorithm works something like this? The private key is used to generate the public key which is used to generate the address. This process only works one way. The public key can't be generated from the address and the private key can't be generated from the public key. So practically the private key is all that's needed. The address can be forgotten and regenerated if the private key is still known (and can the public key)?

If I have that right then why the need for three pieces of information? Why can't you just have a key pair and the public key acts as the address?


Title: Re: Private/public key question
Post by: BlockChainLottery on December 16, 2013, 01:25:08 PM
Yes, you're right. The address is more for human use I think.
It is shorter than when it's written in hexadecimal and it's base58 to get rid of the 0O, I1, etc pairs.
Different addresses could look the same if it was base64.


Title: Re: Private/public key question
Post by: dandav101 on December 16, 2013, 01:35:13 PM
Hi all.

I've looked around for an answer to a very simple question but I can't find anything that's enlightened me.

Am I right in saying that the bitcoin algorithm works something like this? The private key is used to generate the public key which is used to generate the address. This process only works one way. The public key can't be generated from the address and the private key can't be generated from the public key. So practically the private key is all that's needed. The address can be forgotten and regenerated if the private key is still known (and can the public key)?

If I have that right then why the need for three pieces of information? Why can't you just have a key pair and the public key acts as the address?



     This is probably the best explanation I've seen  so far! It definitely made the whole thing go "click" in my head!! Thank you very much for that and to the responder for confirming it!


Title: Re: Private/public key question
Post by: BurtW on December 16, 2013, 01:41:24 PM
Hi all.

I've looked around for an answer to a very simple question but I can't find anything that's enlightened me.

Am I right in saying that the bitcoin algorithm works something like this? The private key is used to generate the public key which is used to generate the address. This process only works one way. The public key can't be generated from the address and the private key can't be generated from the public key. So practically the private key is all that's needed. The address can be forgotten and regenerated if the private key is still known (and can the public key)?

If I have that right then why the need for three pieces of information? Why can't you just have a key pair and the public key acts as the address?

You are correct!  It is so refreshing to have someone research before posting a question!

Now the Bitcoin address is actually calculated by hashing the public key three times.  During this process the size is reduced from the size of the public key (512 bits or 257 bits) down to 160 bits and a checksum is added.  This is done for three basic reasons:

1) There is an added layer of security.  Instead of putting the public key in the blockchain we put the hash of the public key.  Given the hash in the very public blockchain it now takes two steps to figure out the private key:  hash -> public key -> private key.

2) This reduces the size of the block chain because the hash of the public key is smaller than the public key.

3) If we just used public keys then there would be no checksum.  The Bitcoin addresses have a checksum so if you type in an address by hand and make a mistake in one of the characters the address will be detected as invalid and you can be asked to type it in again.


Title: Re: Private/public key question
Post by: Flanagan on December 16, 2013, 01:57:11 PM
So my question now is:

If I only have a private key for an address of mine, could I use my bitcoins in that address just with that by, for example, importing it to an online wallet like blockchain?

I mean, could I just have that private key without the need to have a backup of any wallet?


Title: Re: Private/public key question
Post by: CIYAM on December 16, 2013, 02:01:22 PM
I mean, could I just have that private key without the need to have a backup of any wallet?

Yes - basically your wallet simply holds your private keys (plus some tx information and labels that are not essential in terms of your actual BTC amounts).