From Wallet Seed to Ethereum Address: Hashing, Key Derivation and Cryptographic Primitives
Twelve words become a 0x… address through six standards. This page takes the pipeline apart. For each step it shows what kind of operation it is (generation, derivation, public-key cryptography, hashing, checksum or encoding), runs it live in the browser, and measures its statistical behaviour.
The pipeline at a glance
Boxes are data, arrows are operations. Every arrow is deterministic except the first. After the entropy is drawn, the whole wallet (every key, every address) can be recomputed from the words alone.
- Entropy128–256 random bits
- CSPRNGkey generation
- Mnemonic12–24 words
- BIP-39 append SHA-256 checksum bits, split into 11-bit word indicesencodingchecksum
- Seed512 bits
- BIP-39 PBKDF2-HMAC-SHA512, 2048 rounds, salt "mnemonic" + passphrasekey derivation
- Master key + chain code256 + 256 bits
- BIP-32 child derivation along the BIP-44 path m/44'/60'/0'/0/ikey derivation
- Private key k256 bits, 1 ≤ k < n
- secp256k1 Q = kGpublic-key crypto
- Public key64 bytes, X ‖ Y
- Keccak-256, keep the last 20 byteshashing
- Address20 bytes, 40 hex digits
- EIP-55 uppercase hex letters chosen by Keccak-256(address)checksumencoding
- Checksummed address0xf39Fd6e5…b92266
Six kinds of operation, kept apart
Key generation
Creating secret material from randomness. It is the only non-deterministic step: a CSPRNG draws 128–256 bits. Its quality bounds everything after it, because nothing downstream can add entropy.
Pipeline: entropy for the mnemonic. Property: unpredictable and uniform.
Key derivation
Computing new keys deterministically from existing secrets with a keyed pseudo-random function (HMAC-SHA512). It adds no entropy. It spreads one secret into many keys that look independent.
Pipeline: PBKDF2 seed stretching, BIP-32 child keys along the BIP-44 path.
Public-key cryptography
A one-way relation between a private and a public key (Q = kG) that also supports signatures: anyone can verify, only the holder of k can sign.
Pipeline: secp256k1 public key; ECDSA signatures on every transaction.
Hashing
Unkeyed map from arbitrary input to a fixed-size digest that behaves like a random function. Preimage, second-preimage and collision resistance, plus the avalanche effect.
Pipeline: Keccak-256 for the address. SHA-256 and SHA-512 inside the BIP-39 checksum, HMAC and PBKDF2.
Checksums
Redundancy that detects accidental errors (typos, swapped words). Not a security mechanism against an adversary: anyone can compute a valid checksum.
Pipeline: the last 4–8 bits of a BIP-39 phrase, the letter case of an EIP-55 address.
Encoding
A reversible change of representation with no secret and no loss: bits ↔ words, bytes ↔ hex, a mixed-case display. It provides no confidentiality.
Pipeline: the BIP-39 wordlist, hexadecimal addresses, EIP-55 capitalisation.
Generation vs derivation: generation answers "where does the secret come from?" (randomness). Derivation answers "how do I get more keys out of it?" (a deterministic function). A wallet does one generation and unlimited derivations. That is why backing up 12 words backs up every account the wallet will ever create.
Live demo: run the pipeline
Test phrases only. The demo generates new phrases or loads public test phrases, and runs entirely in the browser. Never type a real recovery phrase into any website.
-
1 · Entropy
key generationRandom bits from
crypto.getRandomValues(a CSPRNG). For the test phrases, the bits are recovered from the words.hex -
2 · Mnemonic (BIP-39)
encodingchecksumENT bits + CS = ENT/32 bits of SHA-256(entropy), cut into 11-bit groups. Each group indexes one of 2048 words. Click a word to replace it with a random one and watch the checksum fail (it survives about 1 time in 16).
-
3 · Seed
key derivationPBKDF2(HMAC-SHA512, password = mnemonic, salt = "mnemonic" + passphrase, 2048 rounds, 64 bytes). The rounds slow down brute force. The passphrase has no checksum: every passphrase opens a valid but different wallet.seed -
4 · HD derivation (BIP-32 along a BIP-44 path)
key derivationMaster:
I = HMAC-SHA512("Bitcoin seed", seed). Each child:I = HMAC-SHA512(chain code, data), child key = (IL + parent key) mod n. A prime ′ marks a hardened index (≥ 2³¹), whose data is the parent private key. Normal indices hash the parent public key.Path Level (BIP-44) Hardened Private key Chain code -
5 · Private key
key derivation (result)k -
6 · Public key (secp256k1)
public-key cryptoQ = kG on y² = x³ + 7 over Fp, p = 2²⁵⁶ − 2³² − 977. This is the same computation as Part 1 on a curve of size ≈ 2²⁵⁶. It is written as
04 ‖ X ‖ Y.04 ‖ X ‖ Y -
7 · Keccak-256 → address
hashingHash the 64 bytes X ‖ Y (without the 04 prefix) and keep the last 20 bytes, highlighted below.
Keccak-256address -
8 · EIP-55 checksum
checksumencodingHash the lowercase hex text with Keccak-256. Each letter a–f is uppercased when the hash nibble at the same position is ≥ 8. Digits 0–9 carry no information.
Checksummed address
The standards and primitives
| Standard | Year | Role and purpose | Kind |
|---|---|---|---|
| BIP-39 | 2013 | Turns entropy into a phrase humans can write down and re-type, with a checksum against transcription errors. Stretches the phrase into a seed. | encoding, checksum, derivation |
| BIP-32 | 2012 | Hierarchical deterministic wallets: a tree of keys from one seed. Extended public keys (xpub) derive child public keys without any private key (watch-only wallets). | derivation |
| BIP-44 | 2014 | A convention for which branch of the tree to use: m / purpose′ / coin_type′ / account′ / change / index. Ethereum is coin type 60 (SLIP-44). This lets different wallets find the same accounts. | derivation (layout) |
| secp256k1 | 2000 (SEC 2) | Elliptic curve y² = x³ + 7 used for the key pair and ECDSA signatures. Ownership of an account is the ability to sign with k. | public-key crypto |
| Keccak-256 | 2008 / 2012 | Ethereum's general hash. Here it compresses the 64-byte public key into a uniform-looking identifier and drives the EIP-55 checksum. | hashing |
| EIP-55 | 2016 | Backward-compatible checksum: uses the case of hex letters, which old software ignores, to catch typos in addresses. | checksum, encoding |
Statistical properties, step by step
| Stage | Distribution / entropy | Statistical fact worth knowing |
|---|---|---|
| Entropy | Uniform on {0,1}ENT, ENT = 128 or 256 | All later uniformity is inherited from here. A biased RNG cannot be repaired downstream: a "uniform-looking" address from 32 bits of entropy is still brute-forceable. |
| Mnemonic | 204812 = 2132 word sequences, 2128 valid | A random 12-word sequence has a valid checksum with probability 2−4 = 1/16 (24 words: 2−8). The first 11 words are free. Given them, only 128 of the 2048 possible last words are valid. |
| Seed | Pseudo-random 512 bits | PBKDF2 adds ~11 bits of work (211 rounds) but no entropy. A wrong passphrase is undetectable: it gives a different, equally random-looking wallet. |
| BIP-32 child keys | ≈ uniform on [1, n−1] | Child keys look independent of each other and of the parent: knowing one account key reveals nothing about the others (for hardened levels). |
| Public key | Uniform over the 2256-point group, not over 512-bit strings | X takes only about half the values below p, and Y is determined by X up to sign. 64 bytes carry about 256 bits of entropy. As in Part 1, the structure is there by design. |
| Keccak-256 / address | ≈ uniform on {0,1}160 | Avalanche: one flipped input bit changes ≈ 128 ± 8 of the 256 output bits. 160-bit addresses give ~280 collision resistance (birthday bound) and 2160 for a second preimage. |
| EIP-55 | Letter count L ~ Binomial(40, 6/16), mean 15 | Each letter carries one check bit, so a random error passes with probability E[2−L] = (10/16 + 6/16 · ½)40 = (13/16)40 ≈ 0.0247%, the figure quoted in EIP-55. All-lowercase and all-uppercase input carry no check at all. By the same formula, about 2 · 0.0247% ≈ 0.05% of addresses have a correct EIP-55 form that is single-case, so validators cannot tell them from unchecked input. |
Experiments: measure it
Monte Carlo estimates of the probabilities above, using the same code as the demo. Intervals are 95% Wilson score intervals. The experiments start when this section scrolls into view and take a few seconds. A 95% interval misses the true value 1 time in 20, so an occasional "outside" is expected. Press run again and it should move.
A · BIP-39 checksum: how often does a wrong phrase pass?
B · EIP-55: how often does a typo pass?
A random address gets one character replaced and is checked against its EIP-55 checksum. Each letter a–f carries one check bit, so a typo passes only when all the letter cases still happen to match: about (13/16)40 ≈ 0.0247% of the time.
Letters per address
number of a–f characters in random addresses vs Binomial(40, 6/16)
C · Keccak-256 avalanche
Changed output bits after flipping one input bit
Input: random 64-byte strings, the size of an uncompressed public key without prefix. Flip one random bit and compare the two digests.
For a random function the number of changed bits is Binomial(256, ½): mean 128, standard deviation 8. The observed histogram should match the curve. A visible shift or excess spread would be a statistical defect, which is exactly what hash designers test for.
D · Are addresses uniform?
Hex digit frequencies in addresses
Share of 1s per address bit (160 bits)
Timeline
The milestones of the wallet pipeline, in chronological order.
- 1977RSA (Rivest, Shamir, Adleman): first practical public-key encryption and signature scheme, based on factoring.
- 2001SHA-2 family (SHA-256, SHA-512) published by NIST.
- 2012Keccak wins SHA-3 (October). BIP-32 (Wuille): hierarchical deterministic wallets.
- 2013BIP-39: mnemonic code for generating deterministic keys.
- 2014BIP-44: multi-account hierarchy and coin types. Ethereum's yellow paper specifies Keccak-256 as submitted, with the original padding. The same year NIST's draft FIPS 202 adds domain-separation bits.
- 2015SHA-3 standardized (FIPS 202, August). Ethereum mainnet launches in July with Keccak-256, so "SHA3" in Ethereum code means Keccak-256.
- 2016EIP-55: mixed-case checksum addresses.
The order explains the oddities: Ethereum adopted Keccak between the competition win and the final standard, and the Bitcoin-era wallet standards (BIP-32/39/44, all using SHA-2/HMAC) were reused unchanged for Ethereum by choosing coin type 60.
SHA-2 / SHA-512 vs Keccak / SHA-3
| SHA-2 (SHA-256, SHA-512) | Keccak / SHA-3 | |
|---|---|---|
| Construction | Merkle–Damgård: iterate a compression function over blocks | Sponge: absorb into, then squeeze out of, a 1600-bit state |
| Length extension | Vulnerable: H(m) lets you compute H(m ‖ pad ‖ x). Hence HMAC | Not vulnerable: the capacity part of the state is never output |
| 256-bit variant | SHA-256: 512-bit blocks, 64 rounds | rate 1088 bits, capacity 512 bits, 24 rounds |
| In this pipeline | SHA-256 (BIP-39 checksum), SHA-512 inside HMAC (PBKDF2, BIP-32) | Keccak-256 (address, EIP-55) |
Keccak-256 ≠ SHA3-256. Both use the same permutation and the same rate and capacity. Only the padding differs: FIPS 202 appends two
domain-separation bits 01 before the pad10*1 rule, so the first padding byte is 0x06 instead of Keccak's 0x01.
This one byte changes every digest. Try it:
Why not one algorithm for everything?
| Layer | What it must achieve | Chosen tool | Why another tool would not do |
|---|---|---|---|
| Key management (BIP-39/32/44) | Human backup, error detection, unlimited keys from one secret, cross-wallet interoperability, watch-only xpubs | Wordlist encoding + SHA-256 checksum, PBKDF2 and HMAC-SHA512 derivation, a path convention | A hash alone cannot do public derivation (xpub). That needs the homomorphism of the curve: child pub = parent pub + IL·G. |
| Ownership (secp256k1) | Anyone verifies, only the owner signs | ECDSA over secp256k1 | A hash has no key pair. RSA would need ~3072-bit keys for comparable security, against 256-bit keys on the curve. |
| Identifier (Keccak-256) | Short, uniform, collision-resistant name for a public key | Keccak-256, truncated to 160 bits | The public key is 64 bytes and structured (Part 1: not bit-uniform). Hashing compresses it and removes the structure. |
| Typing safety (EIP-55) | Catch typos without changing the address format | Case-based checksum | A cryptographic MAC would need a key. A new format would break existing software. Case is free redundancy that old parsers ignore. |
The deep reason, linking Part 1 and Part 2: the properties conflict. Public-key cryptography and xpub derivation need algebraic structure (a homomorphism). Addresses and checksums need the absence of structure (random-function behaviour). No single primitive can be both, so the pipeline alternates between them: structured where structure is useful, hashed where it would leak or bias.
Try it in a real wallet
Real wallets show each standard at work. Use a separate browser profile and only the public test phrase. Never put real funds on it.
- Install MetaMask (or Rabby or Rainbow) in the fresh profile and choose import wallet with the Hardhat phrase
test test … test junk. - The first account should be
0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266, the same as the demo above. - Import the same phrase into a second wallet app: the same addresses appear. This is BIP-39/32/44 interoperability.
What to look for
- Recovery phrase screen: 12 words from a fixed list of 2048, the BIP-39 encoding. A phrase with a bad checksum is rejected.
- "Add account": a new BIP-32 child along the BIP-44 path. Nothing new needs backing up.
- Address display: the mixed case is the EIP-55 checksum.