TeachMeBitcoin

Mnemonic to Seed (PBKDF2)

From TeachMeBitcoin, the free encyclopedia Reading time: 2 min

Mnemonic to Seed: The PBKDF2 Process

Once you have your 12 words, they must be converted into a single, high-security 512-bit binary number called the Seed. This is done using a process called PBKDF2 (Password-Based Key Derivation Function 2).

1. The Key Stretching Logic

We don't just hash the words once. Bitcoin uses a technique called Key Stretching to make "Brute Force" attacks much harder.

  1. Password: The mnemonic phrase (e.g., "abandon abandon...").

  2. Salt: The string "mnemonic" plus an optional Passphrase provided by the user.

  3. Iterations: 2048 rounds.

  4. Algorithm: HMAC-SHA512.

By hashing the words 2,048 times, we make it computationally expensive for an attacker to "Guess" your words, even if they know some of them.

2. The Optional Passphrase (The "13th Word")

BIP39 allows you to add a custom password on top of your 12 words.

3. The 512-bit Result

The output of this 2048-round process is a 64-byte (512-bit) binary string.

4. Why not SHA256?

SHA256 is fast. PBKDF2 is slow by design.

Input Iterations Algorithm Output
12 Words + Passphrase 2048 HMAC-SHA512 512-bit Seed

In the final section, we will build a Python Mnemonic Auditor.

☕ Help support TeachMeBitcoin

TeachMeBitcoin is an ad-free, open-source educational repository curated by a passionate team of Bitcoin researchers and educators for public benefit. If you found our articles helpful, please consider supporting our hosting and ongoing content updates with a clean donation:

Ethereum: 0x578417C51783663D8A6A811B3544E1f779D39A85
Bitcoin: bc1q77k9e95rn669kpzyjr8ke9w95zhk7pa5s63qzz
Solana: 4ycT2ayqeMucixj3wS8Ay8Tq9NRDYRPKYbj3UGESyQ4J
Address copied to clipboard!