Bitcoin Forum

Other => Beginners & Help => Topic started by: Accounting87 on April 28, 2019, 09:35:02 AM



Title: Basics: Mnemonic seed and Private Keys
Post by: Accounting87 on April 28, 2019, 09:35:02 AM
Hi experienced crypto enthusiasts, a little help is needed  8)

Mnemonic seed is a 12-word-long phrase, and each word can be converted into a number, right?
Then, we have 12 numbers. How exactly they generate private keys? And how the seed itself is generated in the first place?

I appreciate if you can tell me more about this in simple words, or share a link to a useful resource.  ::)


Title: Re: Basics: Mnemonic seed and Private Keys
Post by: o_e_l_e_o on April 28, 2019, 10:51:32 AM
This link (https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki) will give you some relevant information about seed phrases.

Mnemonic seed is a 12-word-long phrase, and each word can be converted into a number, right?
Pretty much. Mnemonic seeds are commonly 12 words (corresponding to 128 bits of entropy) or 24 words (corresponding to 256 bits of entropy), but some wallets will also generate 15, 18 or 21 word long phrases. Each word is part of the BIP39 word list (https://github.com/bitcoin/bips/blob/master/bip-0039/english.txt). Each word represents 11 bits of entropy. 11 bits of entropy is 2^11, which gives 2048 possibilities, so each word has a corresponding number between 0 and 2047.

Then, we have 12 numbers. How exactly they generate private keys? And how the seed itself is generated in the first place?
When you first set up a new wallet, it generates a random number known as a seed which it then uses to generate all your future private keys. The process of generating private keys is quite complicated, and is laid out in BIP32 if you want to learn more (https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki). Wallets which do this are known as deterministic wallets (https://en.bitcoin.it/wiki/Deterministic_wallet). To generate your seed phrase, it splits this number in to 11 bit long sections, takes the numerical value (between 0-2047 as above) of each section, matches against the corresponding word in the word list, and then displays that list of words. To recover your seed from your seed phrase, the reverse is true.


Title: Re: Basics: Mnemonic seed and Private Keys
Post by: Velkro on April 28, 2019, 03:01:19 PM

Mnemonic seed is a 12-word-long phrase, and each word can be converted into a number, right?
Then, we have 12 numbers. How exactly they generate private keys? And how the seed itself is generated in the first place?


Its not that simple that words are converted to numbers or something similiar.
Words are converted to numbers to be included as seed in random numbers etc. Its complicated math that words are only little element.


Title: Re: Basics: Mnemonic seed and Private Keys
Post by: AdolfinWolf on April 28, 2019, 03:23:35 PM
Its not that simple that words are converted to numbers or something similiar.
Words are converted to numbers to be included as seed in random numbers etc. Its complicated math that words are only little element.
Huh. For someone that's running a Bitcoin vanity generator you barely know anything about it.

How ironic.  ::)


Title: Re: Basics: Mnemonic seed and Private Keys
Post by: PrimeNumber7 on April 30, 2019, 03:04:06 AM
You should not try to manually convert your seed into a number nor should you try to calculate the xpriv key yourself. This is what your wallet software is for.

The mnemonic word list was chosen so that it allows the end user to make certain minor mistakes and still have access to their private keys. If you only know part of a word in your seed, you can deduct what the word is with limited information. If you know the first 4 letters of the word, there is only one possible word it could be.

When you generate your seed, you should write down the seed on a paper and you may not need to recover your seed with what you wrote down for a long time. You may have difficulties reading your handwriting or the paper may be partially damaged.

Your seed should be generated at random. The ultra paranoid will use dice to generate a seed, however for most people a computer should be fine to generate a seed as long as it doesn’t contain malware. For additional protection from malware, you can use a computer that has never and never will be connected to the internet to generate your seed. If you subsequently load the seed into wallet software on a computer connected to the internet, you will lost most of this protection.