Most people lose crypto in one of two ways: their keys are stolen, or they lose access themselves. Both failures share the same root cause — they never understood what they were actually holding.
This guide explains HD wallets from first principles, then walks through exactly how to generate and store keys so you stay in control forever.
Open the key generator → Everything runs inside your browser. No data ever leaves your device.
What is an HD wallet?
A hierarchical deterministic (HD) wallet is a system that generates an unlimited number of key pairs — Bitcoin addresses, Ethereum addresses, Solana addresses — from a single secret: a 12–24 word recovery phrase.
The phrase is the root. Every address you'll ever use is derived from it mathematically. Lose the phrase, lose everything. Keep the phrase, recover everything — on any device, with any compatible wallet app, forever.
The standards that make this work:
| Standard | What it does |
|---|---|
| BIP39 | Converts random bytes into a human-readable word list |
| BIP32 | Derives a tree of child keys from a master key |
| BIP44/84 | Defines the derivation path per coin (m/44'/0'/… for Bitcoin, m/44'/60'/… for Ethereum) |
| SLIP-0010 | Ed25519 variant used for Solana |
The magic is that the derivation is deterministic and one-way. Given the phrase, you always get the same addresses. Given an address, you cannot go back to the phrase.
The key hierarchy
24-word mnemonic (your only real secret)
│
├── Bitcoin Legacy m/44'/0'/0'/0/0 1A…
├── Bitcoin SegWit m/84'/0'/0'/0/0 bc1q…
├── Ethereum m/44'/60'/0'/0/0 0x…
└── Solana m/44'/501'/0'/0' …base58…
All four addresses come from one phrase. You only need to back up one thing.
How to generate keys securely
1. Use a browser-only tool
The gold standard for key generation is a tool that:
- Runs entirely in the browser (no server receives your data)
- Uses
crypto.getRandomValues— the OS-level entropy source - Has no network calls at runtime (works fully offline)
- Is open source and auditable
hd-keygen meets all four criteria. The cryptographic libraries (noble/secp256k1, noble/hashes) are inlined in the HTML — there is no CDN dependency, no tracking, no backend.
2. Add your own randomness (optional but good practice)
Open the "Add extra randomness" section before generating. Type anything — keyboard mash, random characters, whatever. Your input is SHA-256 hashed and XOR'd with crypto.getRandomValues. Even if you type nothing, the system entropy alone is cryptographically strong. Adding your own entropy ensures that even a compromised random number generator cannot predict your keys.
3. Choose 24 words
12 words give 128 bits of entropy — technically secure, but 24 words give 256 bits. For long-term cold storage there is no reason to use fewer than 24 words.
4. Generate offline when the stakes are high
For significant amounts, open the tool page, then disconnect from the internet before generating. This eliminates any possibility of a network-layer attack observing your keys as they are generated. You can run it from a local file:
# Download the single HTML file
curl -O https://raw.githubusercontent.com/7feilee/7feilee.github.io/main/hd-keygen/index.html
open index.html
How to save keys safely
This is where most people fail. The threat model has three parts:
- Loss — fire, flood, forgotten password, dead hard drive
- Theft — physical break-in, malware, phishing
- Inaccessibility — you die and no one you trust can recover the funds
A single backup solves none of these. You need redundancy with separation.
The two-layer system
Layer 1: Physical backup (what you write down)
Write all 24 words on paper or stamp them into metal. Metal survives fire and water; paper does not. Number each word. Store in at least two separate physical locations — for example, your home and a safety deposit box.
Never store the phrase digitally in plaintext. No photos, no notes app, no email to yourself, no password manager field labeled "seed phrase."
Layer 2: Encrypted digital backup (what you save to the cloud)
Use the "Save encrypted backup" function in the tool. It encrypts your recovery phrase with AES-256-GCM and 600,000 PBKDF2-SHA256 iterations — the same standard used by password managers. Save the .enc file to:
- Google Drive, iCloud, or Dropbox (cloud redundancy)
- A USB drive stored separately from the paper backup
The encrypted file is useless without the passphrase. The passphrase should be:
- At least 16 characters
- Not used anywhere else
- Written in a physical notebook stored separately from both the paper backup and the USB
The separation principle
| Item | Location |
|---|---|
| 24-word paper backup | Home safe |
| Duplicate paper backup | Safety deposit box or trusted person |
master_key.enc | Cloud (Google Drive / iCloud) |
master_key.enc duplicate | USB drive, third location |
| Encryption passphrase | Physical notebook, separate from above |
No single location holds enough to reconstruct your keys. An attacker who steals your laptop gets the encrypted file but not the passphrase. A burglar who finds your notebook gets the passphrase but not the encrypted file. A fire that destroys your home doesn't destroy the cloud copy or the safety deposit box.
Verify your backups
After saving, test that you can recover. Clear the tool, then reimport the phrase from your paper backup and re-derive your addresses. Confirm they match. Do this once a year.
You can also verify the encrypted file can be decrypted offline without a browser:
# Node.js
node -e "const d=require('fs').readFileSync('master_key.enc'),c=require('crypto');const k=c.pbkdf2Sync('YOUR_PASSPHRASE',d.slice(5,37),600000,32,'sha256'),g=c.createDecipheriv('aes-256-gcm',k,d.slice(37,49));g.setAuthTag(d.slice(-16));process.stdout.write(g.update(d.slice(49,-16),'','utf8')+g.final('utf8'))"
# Python
python3 -c "import hashlib;from cryptography.hazmat.primitives.ciphers.aead import AESGCM;d=open('master_key.enc','rb').read();k=hashlib.pbkdf2_hmac('sha256',b'YOUR_PASSPHRASE',d[5:37],600000);print(AESGCM(k).decrypt(d[37:49],d[49:],None).decode())"
What not to do
- Do not screenshot your phrase. Screenshots sync to iCloud/Google Photos automatically.
- Do not type your phrase into any app you did not audit. Hardware wallets, browser extensions, and mobile apps have all been compromised.
- Do not store all backups in one place. Fire, flood, and theft are single-location events.
- Do not use a short passphrase. "password1" defeats 600,000 PBKDF2 iterations in seconds on a GPU.
- Do not reuse addresses. Derive fresh indices for each use. The tool makes this trivial.
- Do not share your public key list carelessly. Addresses are public, but a full list reveals your holdings.
Quick-start checklist
- Open hd-keygen (consider going offline first)
- Add extra randomness, select 24 words, generate
- Write all 24 words on paper — number them, double-check spelling
- Derive addresses for BTC, ETH, SOL — record your primary addresses
- Save encrypted backup with a strong passphrase
- Upload
.encfile to cloud storage - Copy
.encfile to USB drive - Write passphrase in a physical notebook, store separately
- Make a duplicate paper backup, store at second location
- Verify: clear tool, reimport phrase, confirm addresses match
- Verify: decrypt
.encfile offline with Node or Python command
One afternoon of setup. A lifetime of control.
Built on noble cryptography — audited, dependency-free JavaScript. Source: github.com/7feilee/7feilee.github.io.