# Mnemonic and seed

> How a Pearl wallet turns 128 random bits into 12 BIP-39 words and a 64-byte seed, worked through on the test phrase. No passphrase on Pearl.

Source: https://pearlcodex.com/technical/keys/mnemonic-seed/ · Last updated: 2026-11-02 · Checked against Pearl's source code at v1.5.5

Your 12 words are not a password. They are your wallet’s random number, written in a form people can copy by hand without mistakes.

Every private key the wallet will ever use is computed from them, in a fixed order. Lose the computer, keep the words, and you can rebuild everything. Let someone else see the words, and they can rebuild everything too. That’s the whole story; the rest of this page is the arithmetic.

## Try it

Generate a phrase, or type the test phrase, and watch the seed, the keys and the first addresses appear.

_Interactive: Seed words. Try it on the page: <https://pearlcodex.com/technical/keys/mnemonic-seed/>_

## How do 12 words hold a random number?

Through a fixed list of 2,048 English words. 2,048 is 2¹¹, so each word stands for exactly 11 bits.

$$
128 \text{ random bits} + 4 \text{ checksum bits} = 132 = 12 \times 11
$$

1. **Draw 128 random bits**

   The [entropy](https://pearlcodex.com/glossary/#entropy). Pearl’s wallet asks the operating system for 16 random bytes.

2. **Add a checksum**

   Hash the entropy with SHA-256 and take the first 4 bits. Append them: 132 bits.

3. **Cut into 11-bit groups**

   12 groups, each a number from 0 to 2,047.

4. **Look up the words**

   Each number picks a word from the English list (abandon = 0, ability = 1, able = 2, about = 3, …).

### Worked example: the test phrase

The BIP-39 test vector uses all-zero entropy. It is published everywhere, so it is the least safe phrase in the world. Here is how it comes out:

| Step                           | Value                                                                                         |
| ------------------------------ | --------------------------------------------------------------------------------------------- |
| Entropy (16 bytes)             | `00000000000000000000000000000000`                                                            |
| SHA-256 of the entropy         | `374708fff7719dd5979ec875d56cd2286f6d3cf7ec317a3b25632aab28ec37bb`                            |
| Checksum: first 4 bits of `3…` | `0011`                                                                                        |
| Groups 1–11                    | `00000000000` × 11 = 0 → abandon                                                              |
| Group 12                       | `0000000` (last entropy bits) + `0011` = 3 → about                                            |
| Phrase                         | abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about |

**Make a guess:** If you pick the 12th word at random, how often does the phrase still pass the checksum?

**Answer:** 1 time in 16.

The last word’s 11 bits are 7 bits of entropy and 4 bits of checksum. Only the words whose last 4 bits match SHA-256 of the entropy pass. With all-zero entropy, exactly 128 of the 2,048 words work as a 12th word. So a wallet catches most slips, but not every one: always double-check your copy.

## How do the words become a seed?

With a deliberately slow function. BIP-39 runs [PBKDF2](https://pearlcodex.com/glossary/#pbkdf2) with [HMAC](https://pearlcodex.com/glossary/#hmac)-SHA512 2,048 times over the words:

$$
\begin{aligned} \text{seed} = \text{PBKDF2}\big(&\text{HMAC-SHA512}, \\ &\text{password} = \text{the 12 words}, \\ &\text{salt} = \texttt{mnemonic} \parallel \text{passphrase}, \\ &2048,\ 64 \text{ bytes}\big) \end{aligned}
$$

The words go in as plain text, joined by single spaces. On Pearl the passphrase is always empty, so the salt is just the 8 letters “mnemonic”. For the test phrase:

`5eb00bbddcf069084889a8ab9155568165f5c453ccb85e70811aaed6f6da5fc19a5ac40b389cd370d086206dec8aa6c43daea6690f20ad3d8d48b2d2ce9e38e4`

- **Size:** 64 bytes
- **Type:** BIP-39 seed
- **Format:** PBKDF2-HMAC-SHA512 output

That 64-byte [seed](https://pearlcodex.com/glossary/#seed) is what the wallet actually uses. The next step, turning it into a master key with HMAC-SHA512 and the key “Bitcoin seed”, is on the [extended keys](https://pearlcodex.com/technical/keys/extended-keys/) page.

## What do Pearl wallets do differently?

The format is standard BIP-39. The habits around it are Pearl’s own:

- **Always 12 words.** `oyster --create` and the desktop wallet both generate 128 bits of entropy. 24-word phrases are never created.
- **Imports are more flexible.** The desktop wallet’s import screen accepts 12, 15, 18, 21 or 24 English words (checksum checked), or a raw hex seed.
- **No passphrase.** Every seed computation in Oyster passes an empty passphrase. There is no “25th word” option anywhere.
- **English only.** The word list is never changed from English.
- **A short quiz.** After showing the phrase, the desktop wallet asks you for words 3, 7 and 12 before it continues.

> **Note: Passwords and passphrases are different things**
>
> The password you set in the Pearl Desktop Wallet, or Oyster’s “private passphrase”, encrypts the keys stored on your computer. It never enters the seed. Forget it, and you can restore from the 12 words and choose a new one. Lose the words, and the password can’t help you.

## Will my words work in another wallet?

In Pearl’s own wallets, yes: Oyster, oystercli and the desktop wallet all derive the same addresses from the same words.

Elsewhere, be careful. A generic “BIP-86 wallet with coin type 808276” will match Pearl for most seeds, but not all. Oyster inherits an old quirk in hardened key derivation that gives different addresses for about 0.8% of seeds. The [derivation paths](https://pearlcodex.com/technical/keys/derivation-paths/) page shows a real phrase where the two disagree.

**Going deeper: Restoring quantum-safe addresses**

If you ever asked Oyster v1.5.3 or earlier for a quantum-safe address (`getnewaddress … pq=true`), move those coins with that release. Oyster v1.5.5 removed the option: a restore derives plain addresses only, and the wallet can’t spend from a pq address even if it finds one. The desktop wallet never made pq addresses, so most users are unaffected.

## How should you store the words?

- **Write them on paper or metal, in order, spelled exactly.** Not in a photo, a cloud note or an email.
- **Never type them into a website,** a chat, or a form that “verifies your wallet”. No one from Pearl will ever ask for them.
- **Keep them as safe as the coins.** Anyone who reads them owns the wallet, from anywhere, without your computer.

> **Pearl vs Bitcoin**
>
> The words, the checksum and the PBKDF2 seed are pure BIP-39: the test phrase gives the same seed in any wallet. Differences are in the wallet: Pearl only makes 12-word phrases, never uses a passphrase, and derives keys on its own path, `m/86'/808276'/0'`.

**Code: phrase and seed in JavaScript**

With [@scure/bip39](https://github.com/paulmillr/scure-bip39), the library this site’s tools use:

```js
import { generateMnemonic, mnemonicToSeedSync, validateMnemonic } from '@scure/bip39';
import { wordlist } from '@scure/bip39/wordlists/english.js';

const words = generateMnemonic(wordlist, 128);      // 12 words, like a new Pearl wallet
validateMnemonic(words, wordlist);                  // true
const seed = mnemonicToSeedSync(words, '');         // 64 bytes; Pearl's passphrase is always ''
```

## In short

- A new Pearl wallet draws 128 random bits. Adding a 4-bit checksum gives 132 bits, which is exactly 12 words of 11 bits each from a 2,048-word list.
- The 12th word is partly checksum, so only 1 in 16 random last words makes a valid phrase. That catches most mistakes.
- The words become a 64-byte seed with PBKDF2-HMAC-SHA512, 2,048 rounds, salt “mnemonic”. Pearl always uses an empty passphrase.
- The seed is the root of every key in the wallet. Your wallet password only encrypts the file on your computer and has nothing to do with the keys.
- The words restore in Pearl’s own wallets. Other BIP-86 software may derive different addresses for about 0.8% of seeds.

## Read the code

- [oyster --create: 16 random bytes, 12 words, empty passphrase](https://github.com/pearl-research-labs/pearl/blob/v1.5.5/wallet/internal/prompt/prompt.go#L238-L301) `wallet/internal/prompt/prompt.go:238-301`
- [--createfromfile, used by the desktop wallet](https://github.com/pearl-research-labs/pearl/blob/v1.5.5/wallet/walletsetup.go#L120-L196) `wallet/walletsetup.go:120-196`
- [The desktop wallet quizzes words 3, 7 and 12](https://github.com/pearl-research-labs/pearl/blob/v1.5.5/apps/apps/pearl-desktop-wallet/src/renderer/src/pages/create-wallet/SeedVerification.tsx#L34) `apps/apps/pearl-desktop-wallet/src/renderer/src/pages/create-wallet/SeedVerification.tsx:34`
- [Import accepts 12 to 24 words or a hex seed](https://github.com/pearl-research-labs/pearl/blob/v1.5.5/apps/apps/pearl-desktop-wallet/src/renderer/src/lib/seed-input.ts#L6-L131) `apps/apps/pearl-desktop-wallet/src/renderer/src/lib/seed-input.ts:6-131`

## Sources

### Bitcoin standards

- [BIP-39: Mnemonic code for generating deterministic keys](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki)
- [BIP-39 English word list](https://github.com/bitcoin/bips/blob/master/bip-0039/english.txt)

### Papers

- [RFC 8018: PBKDF2](https://www.rfc-editor.org/rfc/rfc8018)

### Other

- [learnmeabitcoin: HD wallets](https://learnmeabitcoin.com/technical/keys/hd-wallets/)
