← Course contentsLesson 2 of 8

Cryptography, Keys and Wallets

What cryptography actually does on a blockchain, why nothing on-chain is encrypted, how a wallet is derived, and why no registry of keys is needed.

Cryptography proves. Encryption hides.

These are different tools and Bitcoin uses almost exclusively the first.

CryptographyEncryption
What it doesProves something is true without needing to trust anyoneScrambles data so only a key can read it
In BitcoinEverywhere — hashing (SHA-256, RIPEMD-160) links blocks and fingerprints data; signatures (ECDSA, Schnorr) prove you own a coin without revealing your keyNot on the chain. The ledger is public on purpose

You meet encryption only off to the side: a password on your own wallet file, or the transport link between nodes. Nothing on the chain is encrypted. A common beginner error is to assume the ledger is private; it is deliberately the opposite.

Hashing

A hash takes any input and returns a fixed-length fingerprint that cannot be reversed. SHA-256 always returns 256 bits, whether the input is one letter or a gigabyte.

The property that matters is the avalanche effect. Change a single character of the input and the entire output changes — not slightly, completely. That is what makes hashes tamper-evident: you cannot nudge data and keep the fingerprint close.

Creating a wallet is entirely local

This surprises people: making a wallet never contacts the network.

random entropy -> private key -> public key -> address 256 bits the secret secp256k1 SHA-256 then you protect (one way) RIPEMD-160

The network only learns your address exists when somebody sends a coin to it. There is no registration, no account opening, and nobody to ask.

The full derivation with the named standards:

  1. A secure random generator produces 256 bits of entropy.
  2. BIP39 maps that entropy onto a mnemonic from a 2,048-word list — the seed phrase.
  3. PBKDF2 with HMAC-SHA512 stretches the mnemonic into a 512-bit seed.
  4. BIP32 derives keys hierarchically from that seed.
  5. secp256k1 turns the private key into a public key — an ECDSA key pair.
  6. SHA-256 then RIPEMD-160 hash the public key into the address.

Each step is one-way. Easy to run forward, infeasible to reverse.

Why no registry is needed

Nothing checks that your key is unique. The guarantee is the size of the space.

  • Private keys: 2^256, roughly 1.2 × 10^77 — comparable to the number of atoms in the observable universe.
  • Addresses: 2^160, roughly 1.5 × 10^48, because the address is a 160-bit hash of the public key.

If nine billion people each generated ten million addresses, the chance any two ever collided would be vanishingly small. That is precisely why a wallet can be created offline, without permission, and still be yours alone.

Ethereum: two kinds of account

Externally Owned Account (EOA)Contract Account
Controlled byA private keyCode
Can start a transaction?YesNo — it acts only when called
SigningOne key, one signatureRules live in the code; can require many signers, limits, or a vote
ExamplesMetaMask, a hardware walletMultisig, DAO treasury, DEX, lending pool

On-chain they look identical — an address holding a balance. The only difference is what opens it: a key, or the code.

Note: since EIP-7702 (May 2025) an EOA can also have code attached to it, which breaks the old assumption that "has code" reliably distinguishes a contract from a person.

Origins and the Problem Being Solved