TLDR:
Mnemonic Seed Phrases were introduced by Bitcoiners in BIP39 and map onto underlying private keys.
Hierarchically Deterministic (HD) wallets take a master seed phrase and derive infinite private keys, and hence infinite cryptocurrency accounts, from them.
Ian Coleman’s tool allows you to do this derivation manually for yourself, either by generating a new seed phrase or using one you already have.
Come back to this tool whenever you’re in a pickle and need to fish out a seed phrase's underlying private keys.
We’ve all gotten used to storing our seed phrases as a list of mnemonic words, but sometimes things can go unexpectedly and we need to fish out the underlying private keys that they convert to.
So in this week’s post I decided to share a really useful tool that does exactly that, and I’m certain that you’ll use it if you’re in Web3 long enough.
Private Keys and Seed Phrases
Since cryptocurrencies were first invented when Bitcoin was released in January 2009, accessing your crypto has always required a private key.
Understanding how keys works is quite complex in itself. But you can just conceptualise that through some cryptographic magic (ie. fancy maths), you can create private keys that can unlock an address on a blockchain and give you access to the crypto assets inside.
Private keys on Bitcoin look something like this:
L19efYWRndFuX7SWrtTaJ5HgeRYg7MRnMJRoMZkbCZkzGLoWxUiK
Which is obviously hard for the human mind to remember, so back in 2013 Bitcoiners improved Bitcoin through a new Bitcoin Improvement Proposal (BIP), called BIP39, that introduced mnemonic seed phrases.
Mnemonic seed phrases are a sequence of 12 - 24 words that are human readable and map onto the private key shown above, eg:
bless earn lunar picture design grief blue sugar jewel pill brother angry banana hawk embrace
In further BIPs they also introduced “hierarchically deterministic” (HD) wallets, where you can use a single master seed phrase to derive infinite private keys, making crypto even more accessible as people could now have a single seed phrase yet infinite different crypto accounts!
The result of these BIPs has become a pretty fundamental pillar of how things work in crypto. Pretty much every wallet nowadays uses mnemonic seed phrases that map onto underlying private keys.
It’s hard to imagine storing a literal private key today let alone one private key per account, since everyone generally uses a single master seed phrase in wallets like Metamask, but that’s how it was at the start.
However from time to time you may need to go beyond your seed phrase and fish out the underlying private keys, and this is where this tool below comes in handy.
Ian Coleman’s BIP39 Tool
A Bitcoiner called Ian Coleman created a great little tool that allows you to manually convert seed phrases to their underlying derived private keys.
You can find the tool at https://iancoleman.io/bip39/, and on opening it you’ll see the following:
The “Generate” button in the UI has a dropdown with it that allows you to choose how many words you want the mnemonic to be generated with. The general consensus from cryptographers is that anything above 12 words will produce a safe seed phrase that’s not possible to hack by brute force.
On selecting the “Coin” dropdown you can see a pretty big list of coins, that includes the likes of ETH, which use the same underlying mnemonic system and hence can be used by this tool too.
In the “BIP39 Mnemonic” box you can either generate a new mnemonic seed phrase or input your own that you’ve generated elsewhere. This means you can fish out the private keys from literally any seed phrase you have for any wallet, as long as it’s a supported coin.
Important warning - only ever input your own seed phrases while offline!
This is easy to do by opening up the website then turning off your computer’s wifi. Doing this ensures that there’s no chance that someone is somehow recording your keystrokes or your screen and can steal your seed phrase and therefore your money. I know it may sound like paranoia but it’s better to be safe than sorry!
Deriving Private Keys
To derive private keys you take the master seed phrase and what’s known as a “derivation path” and pass them through an algorithm to get hold of individual private-public key pairs and their associated accounts.
HD wallets were introduced in BIP32, but later standardised in BIP44 and improved to keep up with SegWit improvements in the later BIP49, BIP84, and BIP141. Ian Coleman’s tool allows you to select any of these BIPs to see the different possible derivation paths.
A derivation path is expressed in the form:
m / purpose' / coin_type' / account' / change / address_index
eg. m / 44' / 0' / 0' / 0 / 0
Where:
- m = Master key (derived from master seed phrase)
- purpose = Purpose of the derivation (e.g., 44’ for BIP44)
- coin_type = Cryptocurrency type (0’ for Bitcoin)
- account = Account index (allows for multiple accounts)
- change = Differentiates between external (0) and internal/change (1) addresses
- address_index = The index of the address
For all intents and purposes you just need to understand that as the final number changes a new private key is derived, and hence you can create infinite private keys from a single master seed phrase, as shown below:
Most wallets still use BIP44, but there are times where you’ll find some that use other derivation paths like BIP49 and above. This tool allows you to derive whatever key you want as long as you know the correct derivation path that your specific wallet uses.
When is this tool useful?
Ok, so this all very interesting but when am I actually going to use any of this?
Well the truth is that this is very much a tool that’s most useful for when *things go wrong*, and I’ll give you a few of these examples below:
(1) You’re worried a seed phrase may have been stolen and want to quickly move your funds out.
By inputting your seed phrase into this tool you can get hold of the private keys for different accounts, then manually import the private key into a hot wallet like Metamask or similar and send your funds elsewhere.
You may struggle to know the derivation path your wallet used, but since you know the account addresses that your funds are stored in, you can quickly check the main derivation paths and find the relevant accounts and their associated private keys.
(2) You’ve put your seed phrase into a different wallet but can’t see your funds.
Checking through the different derivation paths you can see which derivation path your original wallet used and try to understand why those accounts are not showing up in your new wallet.
The best solution here will generally be to move your funds over to the new accounts generated by your new wallet, or find another wallet that uses the same derivation path as your original one did.
(3) You want a temporary mnemonic seed phrase just to run some tests.
Sometimes you just want a burner account where you can try something out that could be a bit risky for an account you have genuine funds in.
You can use the seed phrase generator here and know that it’ll generate a valid set of private keys. Then you can import one of the private keys directly into a hot wallet like Metamask and work from there.
These are just 3 examples but I’m sure at this point you can tell that I could easily give a lot more examples of where this tool can come in handy.
Hopefully today you’ve learned a little bit more about Bitcoin’s history and how seed phrases actually work. I know you probably won’t need this tool today, but one day when you’re stuck in a pickle and need to fish out the underlying private keys from a seed phrase, you’ll know where to go and you can thank me then!