How do seed phrases/mnemonics work?
- Garry Sharp
- Dec 7, 2022
- 2 min read
So for this article we're going to look at self-custody wallets (i.e. wallets where you own your cryptographic keys), if that's too complex don't worry, it's basically a wallet you control (as opposed to leaving your crypto with a 3rd party bank or exchange).
You'll probably notice the first time you create a wallet you are presented with a 12, 18 or 24 word phrase which magically allows you to create all your addresses.
You might think "well hang on! can't someone just guess my words" well... yes... but really no. They could theoretically guess but the number of guesses when you do the math is astronomical. Here's how it works.
The shorter explanation
Everything is a number to a computer (even words and pictures) and numbers are expressed in binary (there are only 1s or 0s)
Each time a new digit gets added the number of possibilities double.
0 / 1 = 2 possibilities
00 / 01 / 10 / 11 = 4 possibilities
000 / 001 / 010 / 011 / 100 / 101 / 110 / 111 = 8 possibilities
When we have 12, 18 or 24 words together (and remember a word is just a number) we get a super long number 29,642,775,000,000,004,096,280,456,416,616,104,704,080,712,280,160,128,216,752,960,616,504,296,488,032,744 when written out fully. FYI, there are less atoms on earth.
The longer explanation
There are 2048 words ordered alphabetically (list is here).
Each word = a number between 0 and 2047 (the first word is considered number 0 not 1)
That means each word can be an 11 bit binary number (that means if you have 11 numbers that can only be 1 or 0 from 0000 0000 000 to 1111 1111 111 that there are 2048 unique combinations.
So lets say your word is "onion", that is word number 1238 which is 1001 1010 110 in binary.
So for one word there are 2¹¹ possibilities (2048).
So what happens with 12, 18 or 24 words? We come up with a very very long list of 1s and 0s (264 in the case of 24 words) by adding the numbers together.
That means there are now 2²⁶⁴ unique combinations (2 to the power of 24 x 11). That's 2.9642775e+79 in scientific notation or 29,642,775,000,000,004,096,280,456,416,616,104,704,080,712,280,160,128,216,752,960,616,504,296,488,032,744 when written out fully. FYI, there are less atoms on earth.
This is why crypto is beautiful, the maths is extremely elegant and it allows people to take secure custody of their own funds whilst making it practically impossible for anyone to brute force guess your seed phrase.
The downside of this of course is that if you lose or forget your seed phrase you can never really recover your funds. At Catena we advise on how to protect against this by using other mathematical techniques.
Feel free to get in touch
Comments