A mnemonic is a group of easy to remember words generated from the entropy. It is used to generate a seed, which will be used to derive a HD wallet. It first appeared in BIP39, which is a standard for mnemonic generation.
Entropy is a measure of randomness. The more entropy, the more secure. A bit is the smallest unit of data in a computer. It can be either 0 or 1.
We use the crypto.getRandomValues() function to generate random bits. This
function is available in modern browsers and Node.js. Learn more on MDN
A mnemonic is a group of easy to remember words generated from the entropy. The valid number of words for a mnemonic is 12, 15, 18, 21, or 24. Different numbers of words require different lengths of entropy.
It takes 2 steps to convert an entropy to a mnemonic:
0 0 0 0 0 0 0 0 0 0 0 | #0 | 1abandon |
0 0 0 0 0 0 0 0 0 0 0 | #0 | 2abandon |
0 0 0 0 0 0 0 0 0 0 0 | #0 | 3abandon |
0 0 0 0 0 0 0 0 0 0 0 | #0 | 4abandon |
0 0 0 0 0 0 0 0 0 0 0 | #0 | 5abandon |
0 0 0 0 0 0 0 0 0 0 0 | #0 | 6abandon |
0 0 0 0 0 0 0 0 0 0 0 | #0 | 7abandon |
0 0 0 0 0 0 0 0 0 0 0 | #0 | 8abandon |
0 0 0 0 0 0 0 0 0 0 0 | #0 | 9abandon |
0 0 0 0 0 0 0 0 0 0 0 | #0 | 10abandon |
0 0 0 0 0 0 0 0 0 0 0 | #0 | 11abandon |
0 0 0 0 0 0 0 0 0 1 1 | #3 | 12about |
A seed is a 512-bit (64-byte) value generated from mnemonic . Will be used to derive the master extended key. We will cover this in the next section.
You may have noticed that the length of a mnemonic is not fixed, but the
seed requires exactly 512 bits. To achieve this, the
mnemonic needs to be processed through a function called
PBKDF2 (Password Based Key Derivation Function 2).
This seed will be used to derive a HD wallet.