In the ever-evolving world of digital currency, understanding the technical foundations of wallet security is paramount. The latest report, “An In-Depth Analysis of the BIP39 Protocol,” provides a comprehensive look at how mnemonic phrases are generated and transformed into private keys, securing digital assets with unparalleled precision.
The now standardized mnemonic dictionaries include Simplified Chinese, Traditional Chinese, English, Japanese, French, Italian, Korean, and Spanish. Mnemonics in the above languages can be generated, but most mainstream wallet practices still only use English.
Generally, the number of mnemonic words in a wallet is 12 or 24, but this standard can also generate 15, 18, 21 mnemonic words, or even less than 12 words. When developing a wallet, 24 words are generally used for security reasons, and 12 words are generally used for compatibility with other mainstream wallets or ease of use. If it is less than 12 words, the probability of collision is too high and the risk is too high. It is not recommended to use it.
Number of random digits | Number of check digits | Random number plus check digits | Number of mnemonics |
128 | 4 | 132 | 12 |
160 | 5 | 165 | 15 |
192 | 6 | 198 | 18 |
224 | 7 | 231 | 21 |
256 | 8 | 264 | 24 |
1.Canonical encoding of mnemonics and salts using NFKD. (The salt is “mnemonic” + password)
2.Use the PBKDF2 algorithm to obtain a 512-bit seed. PBKDF2 uses HMAC-SHA512 as the hashing algorithm and performs 2048 calculations.
3.The first 256 bits are our private key. As for the function of the last 256 bits, we don’t need to know it for the time being. We will only use it when we use BIP32.
During development, if you use Mnemonic Code Converter to generate mnemonic, and then use the mnemonic to generate a private key, the mnemonic may fail to be verified. But with a 24-word mnemonic phrase, the verification will not fail. Why is this? Generally, we use byte arrays or char arrays in development to store related data, but the minimum space occupied by a byte is one byte (8 bits), except for the 24 check digits of the mnemonic phrase. It can occupy 8 bits, but other mnemonic words occupy less than 8 bits. Many third-party libraries store 1 byte of check digits, but the data recovered from the mnemonic words is indeed missing. Then the verification is done based on byte comparison instead of comparing each bit, so there will be a problem of verification failure.
1.Go to the dictionary to look up words to see if the word entered by the user is in the dictionary.
2.Take out the indexes of all words and convert them into binary data composed of bits in order and then splice and combine them.
3.Split the binary data into random numbers and check digits, perform SHA256 on the random numbers and compare the check digit results to see if they are correct.
1.Since the PBKDF2 algorithm of HMAC-SHA512 is used, the mnemonic cannot be deduced from the 512-bit seed in reverse.
2.Mnemonic words and 128-bit random numbers can be converted into each other, but they have no practical significance.
Ethereum (ETH), the world’s second-largest cryptocurrency by market value, has just broken past $3,000. Data…
On November 11, Binance's co-founder and former CEO, Changpeng Zhao (CZ) stated in a tweet,…
The crypto market is on fire again after the US presidential elections. This has led…
In a recent announcement, Shytoshi Kusama, Shiba Inu's lead developer, addressed the skepticism surrounding SHIB’s…
According to experts at CoinMarketCap (CMC), Bonk (BONK), Cardano (ADA), and Yeti Ouro (YETIO) are…
In a recent analysis, prominent market analyst CryptoBull shared an updated chart on the XRP-Bitcoin…