Cryptography for Humans

概念: Why Crypto, Private & Public Key, Digital Signature, Key to Address, 256-bit Security, Elliptic Curves

:::section{mins=2} Why Cryptography :::

:::lead [[gloss:cryptography|Cryptography]] turns a blockchain from a database into a system of ownership. :::

:::p In a bank, identity is verified by the institution: passport, PIN, SMS — and the bank decides if a transfer is authorized. Remove the bank and the core question becomes: who authorizes the transfer? :::

:::p Answer: your [[gloss:private key|private key]]. From one large random number, math derives a [[gloss:public key|public key]] and a wallet identifier you can share. The process is one-way: you can compute forward instantly, but reversing is computationally impossible. :::

:::p When you sign a [[gloss:transaction|transaction]] with your private key, any node can verify the [[gloss:digital signature|digital signature]] using the public key — no passport, no bank. Trust is replaced by math anyone can verify. :::

:::callout{icon=💡} Mailbox model: the address is public (anyone can send to it), but only the key owner can spend from it. :::

:::keypoints{label="Key points"}

  • Your [[gloss:private key|private key]] is not a password — it is ownership
  • [[gloss:public key|Public keys]] are shareable; private keys are never shareable
  • [[gloss:digital signature|Signatures]] authorize transfers without revealing the key :::

:::quiz{id=q-1-4-s1 correct=2 explanation="Correct. Cryptography replaces the trusted intermediaries. A bank verifies your identity and authorizes transfers. In blockchain, your private key does that — using math that any node can verify independently."} What does cryptography replace in blockchain compared to the traditional financial system?

  • Encryption of transaction data
  • The need for internet connection
  • The bank, notary, and identity verification — replaced by math anyone can verify
  • The blockchain itself :::

:::section{mins=3} Private & Public Key :::

:::lead [[gloss:private key|Private key]] — a random number you never share. [[gloss:public key|Public key]] — derived from it, safe to share. Reverse computation is impossible. :::

:::p A private key is “just a number” — but astronomically large: 256 bits means about (10^{77}) possibilities. Your wallet picks one at random when you create it. :::

:::p From the private key, one-way math on an [[gloss:elliptic curve|elliptic curve]] derives the public key. Forward is fast; reversing the public key back into the private key is computationally infeasible. :::

:::p [[gloss:seed phrase|Seed phrase]] is a human-readable encoding of the same secret. Whoever knows the seed effectively knows your private key. :::

:::keypoints{label="Key points"}

  • Never share [[gloss:private key|private key]] or [[gloss:seed phrase|seed phrase]] — ever
  • [[gloss:public key|Public key]] is safe to share: it gives zero ability to spend
  • Randomness is not a detail — weak randomness can leak keys :::

:::quiz{id=q-1-4-s2 correct=0 explanation="Correct. The public key is designed to be shared — it's how others send you funds. The math is one-way: public key is derived from private, but the reverse is computationally impossible. Share freely."} Your friend asks for your public key to send you ETH. Is it safe to share?

  • Yes — the public key is meant to be shared. It gives zero access to your funds
  • No — the public key can be used to derive the private key
  • Only share the last 20 bytes (the address), never the full public key
  • It depends on the blockchain :::

:::section{mins=2} Digital Signature :::

:::lead A [[gloss:digital signature|digital signature]] proves you authorized a transaction — without revealing your [[gloss:private key|private key]]. :::

:::p When you press “Send”, the wallet creates the transaction data, hashes it, and signs that hash with your private key (Bitcoin/Ethereum use [[gloss:ecdsa|ECDSA]]). :::

:::p The signature is what travels with the transaction. Any node verifies it with the [[gloss:public key|public key]]. If you change even one byte of the transaction, the signature becomes invalid instantly. :::

:::callout{icon=💡} Wax seal analogy: anyone can verify the seal, but only the owner can produce it. :::

:::keypoints{label="Key points"}

  • Private key stays on your device — only signature is broadcast
  • Signature proves both authorization and integrity (data not modified)
  • You can’t fake “from” without the private key :::

:::quiz{id=q-1-4-s3 correct=2 explanation="Correct. The private key never travels anywhere. The wallet signs locally and sends the transaction data plus the signature. Any node can verify the signature using your public key — proving you authorized it without ever seeing your private key."} You press Send. Your private key signs the transaction. What exactly travels across the network?

  • The private key + transaction data
  • The public key + transaction data
  • The transaction data + signature (private key never leaves the device)
  • Only the signature — nodes reconstruct the transaction from it :::

:::section{mins=3} From Key to Address :::

:::lead [[gloss:private key|Private key]] → [[gloss:public key|public key]] → wallet identifier. Each step is one-way. :::

:::p Conceptually: the private key is a number. On an [[gloss:elliptic curve|elliptic curve]] there is a fixed base point. Multiplying that point by your number yields the public key. Going forward is easy; reversing is the hard ECDLP problem. :::

:::p To get a shorter wallet identifier, systems apply a [[gloss:hash|hash]] function to the public key. Hashing compresses data into a fixed-size fingerprint — and you can’t reconstruct the original from the fingerprint. :::

:::keypoints{label="Key points"}

  • Public identifiers are derived — they are not secret
  • [[gloss:hash|Hashes]] make long keys short and usable
  • One-way functions are the backbone: easy forward, impossible backward :::

:::quiz{id=q-1-4-s4 correct=1 explanation="Correct. An address is public by design — share it freely. Knowing someone's address gives you zero access to their funds. You can only send to it or view the balance on a block explorer."} Someone knows your Ethereum address. What can they do with it?

  • Access your funds if they also know your seed phrase
  • Send you ETH and see your balance — nothing else
  • Reconstruct your private key using blockchain data
  • Sign transactions on your behalf :::

:::section{mins=3} Why 256-bit Keys Are Unbreakable :::

:::lead 256-bit keys are effectively unbreakable: brute-forcing a [[gloss:private key|private key]] is beyond any realistic compute. :::

:::p A 256-bit space has (2^{256}) possibilities. Even if you could test trillions of keys per second, you still wouldn’t make a dent. :::

:::p That’s why the real risks are not “math gets broken”, but human failures: phishing, malware, leaked [[gloss:seed phrase|seed phrases]], or weak randomness during key generation. :::

:::keypoints{label="Key points"}

  • Attacking 256-bit keys is not practical brute force — it’s operational security failures
  • Protect the [[gloss:seed phrase|seed phrase]] like the key to a safe :::

:::quiz{id=q-1-4-s5 correct=3 explanation="Correct. The key space is so vast it breaks human intuition. 2^256 ≈ 10^77 — comparable to the number of atoms in the observable universe. Randomly landing on an existing key is statistically impossible."} Why is it practically impossible to guess someone's private key even with all the world's computers?

  • Private keys are stored encrypted on servers
  • Guessing requires knowing the owner's identity
  • Keys change every 24 hours automatically
  • 2^256 possible keys — more than atoms in the observable universe. Even all computers for all time couldn't check them all :::

:::section{mins=3} Elliptic Curves :::

:::lead [[gloss:elliptic curve|Elliptic curves]] are the math behind Bitcoin and Ethereum keys: easy to compute public key from private, infeasible to reverse. :::

:::p Bitcoin and Ethereum use the same curve, secp256k1. The public key is a point on the curve; the private key is the scalar you multiply the base point by. :::

:::p You don’t need to do the math by hand — just remember the security property: one-way derivation is what makes asymmetric cryptography work for ownership. :::

:::keypoints{label="Key points"}

  • Private key → public key is fast
  • Public key → private key is the unsolved hard problem
  • These properties enable [[gloss:digital signature|digital signatures]] :::

:::quiz{id=q-1-4-s6 correct=0 explanation="Correct. Same curve means same key generation algorithm — which is why MetaMask and most wallets support both Bitcoin and Ethereum with the same seed phrase. The addresses look different but the underlying math is identical."} Bitcoin and Ethereum use the same elliptic curve (secp256k1). What practical benefit does this have?

  • One wallet can work with both — same key generation, same address derivation logic
  • Transactions can be sent between the two blockchains directly
  • Both chains share the same security budget
  • Private keys are interchangeable between the two networks :::

:::section{mins=2} The Quantum Threat :::

:::lead Quantum computers are a real long-term risk for today’s public-key cryptography — but not an immediate one. :::

:::p A sufficiently powerful quantum computer could break the math assumptions behind some signature schemes. That’s why research into post-quantum signatures exists. :::

:::p In practice, the threat is about timelines and migration: can networks upgrade to new schemes before quantum capability becomes practical? :::

:::keypoints{label="Key points"}

  • Quantum threat is about future migration, not tomorrow’s hack
  • Most real losses today come from leaked keys and scams, not broken math :::

:::quiz{id=q-1-4-s7 correct=0 explanation="Correct. An address is a hash of the public key — not the public key itself. Until you send a transaction, the public key is never revealed. A quantum computer needs the public key to work backwards to the private key. No public key = no attack surface."} You have an Ethereum address that has never sent a transaction. Is it safer from quantum attack than one that has?

  • Yes — until you send, your public key is hidden. Quantum computers can't attack what they can't see
  • No — the address itself reveals enough information
  • It makes no difference — quantum computers can brute force addresses directly
  • Only hardware wallets are safe from quantum attacks :::