Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What exactly is a private key and public key in relation to Bitcoin? What are they, how are they used, and how does one find out what their private and public keys are?

share|improve this question
I found this answer helpful: – Highly Irregular Sep 12 '12 at 5:45
up vote 7 down vote accepted

Both of the keys are a part of the Elliptic Curve Digital Signature Algorithm. A private key is just a random number, while the public key is a 2D point coordinate on an Elliptic Curve derived from it. The private key is used to sign messages (in case of Bitcoin - the transactions), and the public key is used to check whether the signature is correct. The public key can either be used raw in a transaction, or turned into a Bitcoin address by means of hashing and other operations.

One can use any library that supports the ECDSA curve used by Bitcoin (secp256k1) to generate the appropriate keypair. There are some online solutions for these tasks, for example my small testing suite website.

However, most commonly one leaves key pair generation to the Bitcoin program. If needed be, the private key can be retrieved from the program by using dumpprivkey Bitcoin API call.

share|improve this answer
A public key is technically not a number, but a pair of coordinates of a point on the EC curve. Also, it doesn't really get encoded into a Bitcoin address; an address encodes the hash of a serialized public key. – Pieter Wuille Sep 12 '12 at 12:51
@PieterWuille Edited accordingly – ThePiachu Sep 13 '12 at 0:59
BTW, is a great tool! – Tomas Sep 13 '12 at 14:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.