Bitcoin Forum

Bitcoin => Bitcoin Discussion => Topic started by: olebitole on January 23, 2014, 02:20:27 PM



Title: How are public and private keys related to the wallet?
Post by: olebitole on January 23, 2014, 02:20:27 PM
Hi, How are public and private keys related to the wallet?


Title: Re: How are public and private keys related to the wallet?
Post by: empoweoqwj on January 23, 2014, 02:50:21 PM
Private keys are kept (hopefully) securely within the wallet - for your eyes only.

Public keys are what you send to other people i.e. bitcoin addresses


Title: Re: How are public and private keys related to the wallet?
Post by: DannyHamilton on January 23, 2014, 03:15:40 PM
Hi, How are public and private keys related to the wallet?

Private keys are a random 256 bit number.  They are stored in the wallet, and unless you make a special effort to export and view them, they are generally hidden from the user.  The wallet uses the private keys to create signatures on the transactions that you send to prove to the rest of the bitcoin network that your are authorized to send the transaction.

The public key is a 256 bit number that is calculated from the private key using elliptic curve mathematics with the Secp256k1 curve.  Because of the mathematical relationship between the private key and the public key, if you have the public key, you can verify a signature that was created with the private key.  While it is quite fast and easy for a computer to calculate the public key when it has the private key, it is not computationally feasible to calculate the private key when you have only the public key.

When your wallet sends a transaction, it includes the public key for each signature that is sent.  The nodes on the network can then use the public key to verify the signature.

The bitcoin address is a base58check encoded RIPEMD-160 hash of a SHA-256 hash of the public key.  A hash is a mathematical function that creates a digest of the original data in a format that is consistent but irreversible.  If you know the public key, and you calculate the RIPEMD-160 hash on that value, you will get the exact same 160 bit digest every time.  However, if you have the 160 bit digest, it is not computationally feasible to calculate what the public key is.  Therefore, when you only have a bitcoin address, it is not possible to calculate the public key, but if you have the public key, it is very fast and easy for the computer to calculate the bitcoin address.

When you first receive bitcoins at an address, the RIPEMD-160 hash value for that address is encoded in the transaction (and permanently stored in the blockchain).  Nobody has access to the private or public keys except you (and any hacker that has stolen your wallet files).  Once you spend the bitcoins, the public key is transmitted (so that the peers can verify the signature), and is permanently stored in the blockchain.  After that, anyone with access to the blockchain has access to both the public key and the address, but they still don't have access to the private key (unless they've gained access to your wallet files).


Title: Re: How are public and private keys related to the wallet?
Post by: manobra on January 23, 2014, 05:22:59 PM
Very Well explained!!

Thank you very much!!


Title: Re: How are public and private keys related to the wallet?
Post by: Afrikoin on May 18, 2014, 03:24:47 PM
Well explained sir! Thank you!


Title: Re: How are public and private keys related to the wallet?
Post by: kik1977 on May 18, 2014, 09:01:51 PM
As usual, very well put, DannyHamilton :)


Title: Re: How are public and private keys related to the wallet?
Post by: abraarukuk on May 18, 2014, 09:10:57 PM
help me,how to receive BTC?


Title: Re: How are public and private keys related to the wallet?
Post by: DannyHamilton on May 18, 2014, 10:21:07 PM
help me,how to receive BTC?

Step 1.
Get a bitcoin wallet (https://bitcoin.org/en/choose-your-wallet).

Step 2.
Find someone that has bitcoins and is willing to give you some in exchange for something of value (https://bitcointalk.org/index.php?board=5.0).

Step 3.
Give that person the bitcoin address from your bitcoin wallet.

Step 4.
Give that person the thing of value that you are exchanging.

Step 5.
Wait for that person to send bitcoins to your wallet.

Note:
If the person that is supposed to send you bitcoins is not trustworthy, consider using escrow (https://bitcointalk.org/index.php?topic=276897.0).



Title: Re: How are public and private keys related to the wallet?
Post by: Campsis on May 18, 2014, 10:33:13 PM
thank you for explaining!


Title: Re: How are public and private keys related to the wallet?
Post by: Slingshot on May 19, 2014, 12:11:45 AM
A Beginners Guide to Bitcoin

http://www.coindesk.com/information/



Welcome to Bitcoin!



Bitcoin is The Future.