Two Kinds of Keys
| Symmetric | Asymmetric (public-key) | |
|---|---|---|
| Keys | One shared secret key | A pair: private key and public key |
| Use | Fast encryption of data | Identity, signatures, key exchange |
| Problem | How to share the key safely? | Solved: the public key can be shared openly |
The Key Pair
- Private key: a secret random number. Only you know it. It controls your funds
- Public key: calculated from the private key. Safe to share
- You can go from private to public easily, but not back
- Blockchains use elliptic curve cryptography, for example secp256k1 in Bitcoin and Ethereum
Mailbox Example
Your public key is like your mailbox address and slot: anyone can drop a letter. Your private key is the key that opens the mailbox. Whoever has the private key owns what is inside.
Digital Signature
A digital signature proves that the owner of the private key approved a message and that the message was not changed.
- Asha writes: 'Send 2 coins to Ravi'
- She signs it with her private key, which produces a signature
- Anyone can verify it with her public key
- If the message changes by even one letter, verification fails
Python Example
Install the library first with pip install ecdsa.
valid: True tampered message rejected
Why This Matters for Blockchain
- Nodes accept a transaction only if the signature is valid
- Nobody needs your password. They just check the math
- Lose the private key = lose the funds. There is no reset button
Practice
- Which key do you share and which do you keep secret?
- What happens if someone changes a signed message?
- Why can nobody help you recover a lost private key on a public chain?
Conclusion
Private keys sign, public keys verify. Digital signatures prove ownership and integrity without revealing secrets, and they are the core of blockchain transactions.

