See how Bitcoin creates secure private keys, public keys, and addresses
๐ What You'll Learn
Bitcoin security starts with a 256-bit random number (your private key). This demo shows you:
How a 256-bit private key is generated using random 0s and 1s
Converting binary (0s and 1s) to hexadecimal format
Creating a mnemonic seed phrase (12-24 words) for backup
Using elliptic curve multiplication to generate public keys
Creating Bitcoin addresses from public keys
๐ Think of Bitcoin Keys Like a House
๐
Private Key
Like your house key - Never give it to anyone! Anyone with your house key can enter your house and take everything.
๐
Public Key
Like your house address - You can share it freely. People can send you mail (Bitcoin), but they can't take anything out.
๐ง
Hashing
Like a smoothie blender - Once you blend fruits together, you can't separate them back. One-way transformation!
1Generate 256-Bit Private Key
๐ก What is a Private Key?
A private key is just a very large random number. Bitcoin uses 256 bits (256 ones or zeros). This gives us 2ยฒโตโถ possible combinations - more than atoms in the universe!
Total Bits
256
Ones Count
0
Zeros Count
256
Possible Keys
2ยฒโตโถ
๐ข Binary Format (256 bits):
Click "Generate" to create a private key
๐ค Hexadecimal Format (64 characters):
Why Hexadecimal? Hex is shorter! Each hex character represents 4 bits. So 256 bits รท 4 = 64 hex characters. (0-9 and A-F)
-
๐ง Test Your Knowledge
Q1: If I change just 1 bit in my private key, what happens?
Q2: Can someone recreate your private key from your public key?
Q3: What's the main benefit of a seed phrase over a raw private key?
2Generate Mnemonic Seed Phrase
๐ก Why Use Words Instead of Numbers?
Humans are bad at remembering long numbers but good at remembering words! A seed phrase converts your private key into 12-24 easy-to-write words. You can backup your entire wallet by writing down these words.
โ ๏ธ Security Note: Write these words on paper and store them safely! Anyone with these words can access your Bitcoin. Never store them digitally or take photos.
3Generate Public Key (Elliptic Curve)
๐ก What is Elliptic Curve Cryptography?
Bitcoin uses special math called "elliptic curves" to create a public key from your private key. Think of it like this:
Easy Direction: Private Key ร Generator Point = Public Key
Impossible Reverse: You can't figure out the private key from the public key!
Bitcoin uses the secp256k1 curve. We multiply your private key by a special starting point called "G" (the generator).
The Math Behind It:
Public Key = Private Key ร G
Where G is the generator point on the secp256k1 curve:
G = (0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798,
0x483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8)
๐ Public Key (Uncompressed - 65 bytes):
-
๐ Public Key (Compressed - 33 bytes):
Compressed vs Uncompressed: A public key is an (x, y) point on the curve. We can save space by only storing x and a prefix (02 or 03) indicating if y is even or odd.
-
?What is Hashing?
๐งฉ Hashing: A One-Way Function
A hash function is like a magic blender that:
Takes any input (text, number, file) and creates a unique "fingerprint"
Always gives the same output for the same input
Can't be reversed - you can't get the original input from the output
Even tiny changes in input create completely different outputs
Notice: Just one letter different, but completely different output!
๐ Why Bitcoin Uses Hashing:
Privacy: Your address doesn't reveal your public key
Security: Adds an extra layer of protection
Shorter: Makes addresses more manageable
Checksum: Detects typos in addresses
๐ฎ Try It Yourself!
Hash your name and see what happens when you make tiny changes:
Your SHA-256 Hash:
๐ก Challenge: Try changing just one letter. Notice how the entire hash changes completely? That's the power of hashing!
4Generate Bitcoin Address
๐ก From Public Key to Address Using Hashing
Now we'll use those hash functions to create your Bitcoin address:
The Process:
Start: Take the public key
Hash #1: Put it through SHA-256 (creates 256-bit fingerprint)
Hash #2: Put result through RIPEMD-160 (creates 160-bit fingerprint)
Add checksum: Prevents typos
Encode: Convert to Base58 or Bech32 (human-readable)
Result: A short, safe-to-share address like: bc1q... or 1...
๐ฎ Legacy Address (P2PKH - starts with 1):
-
๐ฎ SegWit Address (P2WPKH - starts with bc1):
-
โ Safe to Share: You can safely share your Bitcoin address with anyone who wants to send you Bitcoin. It's impossible to derive your private key from your address!
โ ๏ธ Critical Security Rules
๐ต NEVER take photos of your seed phrase
Photos can be backed up to the cloud, hacked from your phone, or accidentally shared. Use paper only!
โ๏ธ NEVER store seeds in the cloud
No Google Drive, Dropbox, iCloud, or email. Cloud services can be hacked or shut down. You lose your Bitcoin forever.
๐ฒ NEVER use predictable entropy
Don't create keys from your birthday, name, or common phrases. Use proper random number generators!
โ DO use a fireproof safe
Store your paper backup in a fireproof, waterproof safe. Consider metal backup plates for extra protection.
๐ค What If Scenarios
๐ค What if I lose my seed phrase?
Your Bitcoin is permanently lost. There's no "forgot password" button. No customer service can help. This is why backups are critical!
๐ค What if someone finds my seed phrase?
They can steal all your Bitcoin immediately. Move your funds to a new wallet with a new seed phrase right away if this happens!
๐ค What if my house burns down?
If your only backup burns, your Bitcoin is lost forever. Consider multiple backups in different locations or metal backup plates.
๐ค Can quantum computers break Bitcoin?
Not yet! Bitcoin addresses (especially unused ones) are quantum-resistant. The Bitcoin protocol can upgrade if quantum computing becomes a threat.
๐The Complete Relationship
๐ฒ Random 256 bits
Entropy
โ
๐ Private Key
Keep Secret!
โ
๐ Seed Phrase
12-24 Words
โ
Elliptic Curve Multiplication
๐ Public Key
Share Freely
โ
๐ฎ Address
Receive Bitcoin
๐ Key Security Principles:
One-Way Function: Easy to go from private โ public โ address, impossible to go backward
Private Key: Keep this secret always! Anyone with it controls your Bitcoin
Public Key: Can be shared but usually not needed (address is enough)
Address: Share freely to receive payments
๐ณOne Seed, Many Addresses: HD Wallets
๐ฑ What are HD (Hierarchical Deterministic) Wallets?
Modern Bitcoin wallets don't just create one address. They create a whole tree of addresses from a single seed phrase!
Think of it like a tree:
๐ฑ Seed Phrase (12-24 words)
|
โโ Address 1: bc1q...
โโ Address 2: bc1q...
โโ Address 3: bc1q...
โโ Address 4: bc1q...
โโ ... (millions more!)
๐ฏ Why Is This Useful?
Privacy: Use a new address for each transaction โ harder for others to track your balance
Organization: Separate addresses for different purposes (savings, spending, donations)
One Backup: Write down 12-24 words once, and you can recover ALL your addresses and Bitcoin!
Deterministic: Same seed phrase always creates the same addresses in the same order
Step 2: Master key + index number (0, 1, 2, 3...) โ Child key
Step 3: Each child key โ Bitcoin address
This is a one-way mathematical process. You can't figure out the seed from the addresses!
โ ๏ธ Important Note:
In this demo, we're showing a single key generation for educational purposes. Real wallets like Sparrow, Coldcard, or Trezor use HD wallets automatically. When you write down 12 or 24 words, you're backing up an entire wallet, not just one key!
๐ Ready to Practice?
Now that you understand how keys work, try generating multiple keys and see how each one is completely unique!