Learn Bitcoin← Home

What are Private and Public Keys in Bitcoin?

A Bitcoin wallet mainly consists of two cryptographic components: a Private Key and a Public Key. These keys allow you to securely receive and spend Bitcoin.

Private Key

A private key is a secret number that proves ownership of your Bitcoin. It is generated by your wallet using a random number generator.

Example private key:

5J3mBbAH58CER2x3WmF4Kk2XnZ8d9F1cA2s7YQd4Z8b5X9Lq1pR

Important points:

  • It must always remain secret
  • Whoever controls the private key controls the bitcoin
  • Think of it as the password to your Bitcoin funds

Public Key

A public key is generated from the private key using a mathematical process called Elliptic Curve Cryptography (ECC). This is done automatically by the wallet software.

Example public key (shortened):

03a34b8c7f1a2d4e5c9f8b7a1d2c3e4f5a6b7c8d9e0f123456789abcdef12345

The public key is then hashed to create the Bitcoin address.

Example Bitcoin address:

bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh

This is the address you share with others to receive Bitcoin.

Simple Flow:

Private Key → Public Key → Hashed → Bitcoin Address

Anyone can send Bitcoin to your address, but only the private key owner can spend it.