Public Key Cryptography and Address Derivation
How a crypto wallet turns one secret number into a public address that anyone can send funds to but only the owner can spend from, using math that's easy to run forward and practically impossible to run backward.
Prerequisites: Blockchains and Consensus
If you tell someone your bank account number, they can pay you but they still can't withdraw a cent — a third party, the bank, checks who's authorized before moving money. Crypto has no bank to ask, so it needs the "prove it's really you" part built into the math itself. The answer is a pair of numbers where one, the private key, must never leave your hands, and the other, derived from it, can be published to the entire world as your address without ever exposing the private key.
The everyday analogy is a padlock you can hand out copies of freely (the public side) while keeping the one key that opens it locked in a drawer (the private side). The trick that makes this work mathematically is a function that's trivial to compute in one direction and computationally hopeless to reverse — like being handed a jigsaw puzzle already assembled and being asked to figure out, by staring at it, exactly which random shuffle order was used to scatter the pieces in the first place.
The chain from secret to address
Step 1 — the private key. A crypto private key is nothing more than a very large random number, typically 256 bits — a number between roughly 0 and , chosen with enough randomness that guessing it is out of the question (there are more possible private keys than atoms in the observable universe).
Step 2 — the public key. The private key is fed through elliptic curve point multiplication: starting from a fixed public point on an agreed curve, the public key is , meaning "add to itself, along the curve's own geometric addition rule, times." Computing from takes a computer a fraction of a second. Going the other way — finding given and — is the elliptic curve discrete logarithm problem, and with current algorithms and hardware it would take longer than the age of the universe for the curve sizes actually used (secp256k1, the curve behind Bitcoin and Ethereum).
Step 3 — the address. The public key is run through one or more cryptographic hash functions (e.g. SHA-256 then RIPEMD-160 for Bitcoin's legacy addresses), producing a short, fixed-length fingerprint. That fingerprint, with a version byte and checksum tacked on and re-encoded into a friendlier alphabet, is the address you see printed as a string of letters and numbers.
In words: a secret random number becomes a public key through one-way elliptic curve math, and that public key becomes the shareable address through one-way hashing. Two irreversible steps stacked on top of each other.
Two worked walkthroughs
Signing, in miniature. Suppose you want to spend funds sent to your address. You don't reveal ; instead you produce a digital signature over the specific transaction data using , following the ECDSA algorithm. Anyone can then take your public key (already visible on the blockchain from a past transaction, or derivable once you reveal it alongside the signature) and verify mathematically that only someone holding the that produced could have generated that exact signature for that exact transaction — without ever being transmitted. If even one byte of the transaction changes, the signature no longer verifies, which is what stops anyone from altering the amount or recipient after the fact.
Why brute force fails, with real numbers. secp256k1 keys live in a space of size roughly . Suppose an attacker had every computer on Earth (order machines) each checking keys per second — an absurdly generous assumption. That's keys per second globally, so exhausting the full keyspace takes on the order of seconds. The universe is about seconds old. The attack would take roughly times the current age of the universe — a number so large that "impossible in practice" is not an exaggeration, it's the literal, checkable arithmetic.
Where it actually matters for a desk
Anyone running crypto infrastructure — a market maker, a custodian, an exchange — lives or dies by key management, not by cryptography itself; the math above has never been the weak point in a real-world hack. Losing the private key means the funds are gone forever, with no recovery mechanism, because there's no institution to appeal to. Exposing the private key (through a bad random number generator, a phishing attack, or a leaked backup) means anyone can drain the address instantly, since possession of is the entire definition of ownership.
A crypto address is derived from a public key, which is derived from a private key, through two one-way functions. Anyone can verify a transaction was authorized by the true owner without that owner ever revealing the private key itself.
The classic confusion is thinking the address itself is the "account." The address is just a public fingerprint; the private key is the actual credential. Two different addresses can be controlled by keys derived from the same seed phrase (via deterministic wallet schemes), so "one address, one identity" is not a safe assumption when reasoning about who controls funds on-chain.
Related concepts
Practice in interviews
Further reading
- Antonopoulos, Mastering Bitcoin (Ch. 4)
- Narayanan et al., Bitcoin and Cryptocurrency Technologies (Ch. 3)