⛓️ secp256k1: Bitcoin's Chosen Curve
Explore why Bitcoin chose this specific elliptic curve for security
Your Progress
0 / 5 completed⛓️ ECC in Blockchain
Bitcoin and Ethereum both use elliptic curve cryptography, but with different implementations. Let's explore how!
🎮 Interactive: Compare Implementations
- 1.Generate random 256-bit private key (d)
- 2.Compute public key: Q = d × G (G is generator point)
- 3.Compress public key (33 bytes instead of 65)
- 4.Create Bitcoin address from public key hash
- •Performance: Chosen for computational efficiency
- •Simple: Equation y² = x³ + 7 (a=0, b=7)
- •Battle-tested: Used since 2009, never broken
- •Non-NIST: Not standardized by NIST (some prefer this)
🔐 Wallet Generation Process
Both Bitcoin and Ethereum follow this general process to create a wallet:
Create 256 bits (32 bytes) of random data using cryptographically secure RNG
Convert entropy to 12-24 word seed phrase (BIP39 standard)
Private key (d) = entropy value (must be < curve order n)
Q = d × G (scalar multiplication on secp256k1 curve)
Hash public key (Bitcoin: SHA-256 + RIPEMD-160, Ethereum: Keccak-256)
📊 Quick Comparison Table
| Feature | Bitcoin | Ethereum |
|---|---|---|
| Curve | secp256k1 | secp256k1 |
| Hash Function | SHA-256 + RIPEMD-160 | Keccak-256 |
| Public Key | Compressed (33 bytes) | Uncompressed (64 bytes) |
| Address Format | Base58 (starts with 1 or 3) | Hex (starts with 0x) |
| Address Length | 25-34 characters | 42 characters (40 + 0x) |
| Signature Scheme | ECDSA | ECDSA |
⚠️ Common Security Mistakes
Using predictable "random" numbers (like timestamp) can expose your private key. Always use crypto.getRandomValues() or equivalent CSPRNG.
Reduces privacy. Best practice: generate new address for each transaction (HD wallets do this automatically).
Encrypt private keys at rest. Hardware wallets keep keys in secure enclaves that never expose them.