Level 0 — Foundations · Lesson 4 of 6
Private key, public key and address
How you prove you are the owner without showing your secret: the key pair, the address and what you never give anyone, explained with analogies and a diagram.
Educational content, not investment advice. The full disclaimer
What you will learn
- Explain the role of the private key, the public key and the address.
- Understand how a signature proves the right to move funds without showing the private key.
- Know what must never be given to anyone: the private key and the recovery phrase.
How to prove something is yours without showing your secret
In lesson 3 we said that nodes check whether a transaction has a valid signature. But what is signed, and with what? The answer is cryptography with keys: a pair of two numbers linked mathematically. One is kept secret, the other can be shown to anyone.
The private keyA secret number that gives you control over the funds at an address and with which you sign transactions. It is never given to anyone.Example: Whoever gets your private key can move the funds, and whoever loses it can no longer use them. is the secret number. Whoever has it can sign transactions in the name of the matching address. Bitcoin.org explains that a wallet keeps a private key, with which transactions are signed, as mathematical proof that they come from the owner. The signature also prevents the transaction from being altered after it was issued.
The public keyThe part that can be shown to anyone, computed from the private key; it checks signatures made with the private key without revealing it.Example: The network uses the public key to see that a transaction was signed by the owner. is computed from the private key. It can be shown to anyone and serves to check signatures. The direction is one-way: from the private key the public key is easy to get, but not the other way round, in practice.
The addressA short string of characters, derived, in its simplest form, from the public key, to which funds can be sent; it can be shared with others. Unlike a bank account, anyone who has the address can see all its transactions in the public ledger.Example: You give a friend your address so they can send to you; you never give them the private key. is a short string of characters, derived, in its simplest form, from the public key, to which people can send funds. You can give it to others, the way you give your account number to be paid. Unlike a bank account, anyone who has the address can see all its transactions in the public ledger.
Two analogies, both imperfect
The first: a letterbox. Anyone who knows its address can drop a letter in (the address), but only whoever has the key opens it (the private key). The second: a wax seal. Only you can make your seal, but anyone can check whether a letter really carries your seal (the signature, checked with the public key).
No analogy is exact. In reality there is no box in which someone "puts" money. Funds are entries in the shared ledger, and the private key proves the right to move them.
The signature and the wallet
When you send funds, your wallet creates a digital signatureA mathematical proof made with the private key, showing that the message comes from the holder and was not altered.Example: The wallet signs the transaction; anyone can check the signature with the public key. for that transaction, with the private key. The network checks it with the public key. If it matches, the transaction is accepted. If someone changes a digit of the transaction, the signature no longer matches. The private key does not leave the wallet and is not sent into the network.
A walletA program or device that keeps the keys with which you can use funds on a blockchain; it does not "hold" coins, it holds keys.Example: A wallet app shows your balance by reading the blockchain and signs transactions with your private key. does not "hold" coins in a physical sense: coins are entries in the ledger. The wallet holds the keys and helps you use them.
What you never give to anyone
Whoever has the private key can move the funds, and the move can no longer be undone, because Bitcoin transactions are irreversible (this is how Bitcoin.org describes them). That is why the private key and the recovery phrase (seed phrase)A string of words from which a wallet can rebuild its keys; whoever has it controls the funds, so it is as secret as a private key.Example: No legitimate service asks for your recovery phrase, neither on a site nor in messages. are the most sensitive secrets. Many wallets allow keys to be rebuilt from a recovery phrase (seed phrase), a string of words, and whoever has the phrase controls the funds just like whoever has the key.
On this site there is no field in which to type keys or phrases and we do not generate real keys in the page. The simulator we will build later will use invented data, clearly marked as such.
Where you keep the key matters
Who keeps the keys, you or a company on your behalf, is called custodyWho keeps the keys to an asset: you (self-custody) or a company on your behalf (third-party custody).Example: Whoever has the keys has control; that is why it matters where they are kept.. We talk about the two options at Level 1. For now keep the principle in mind: whoever has the key has control.
Check what you learned
4 questions, one right answer each. After every choice you see whether you got it right, with the explanation. It counts for nothing but you.
Done with the lesson?
Terms in this lesson
- private key
- A secret number that gives you control over the funds at an address and with which you sign transactions. It is never given to anyone.
- public key
- The part that can be shown to anyone, computed from the private key; it checks signatures made with the private key without revealing it.
- address
- A short string of characters, derived, in its simplest form, from the public key, to which funds can be sent; it can be shared with others. Unlike a bank account, anyone who has the address can see all its transactions in the public ledger.
- digital signature
- A mathematical proof made with the private key, showing that the message comes from the holder and was not altered.
- wallet
- A program or device that keeps the keys with which you can use funds on a blockchain; it does not "hold" coins, it holds keys.
- recovery phrase (seed phrase)
- A string of words from which a wallet can rebuild its keys; whoever has it controls the funds, so it is as secret as a private key.
- custody
- Who keeps the keys to an asset: you (self-custody) or a company on your behalf (third-party custody).