Small Science: What exactly are mnemonics and private keys?
比特派钱包
2019-09-05 08:13
本文约2792字,阅读全文需要约11分钟
So what are the mnemonic and the private key? They are chanted every day...Why are they so important? Who is more important? What is the ulterior relationship between the mnemonic and the private key?

After stepping into the blockchain world, we often hear the words "how important is the private key", "how important is the mnemonic phrase"...

So what are mnemonic words and private keys? They are chanted every day...

Why are they so important?

Who is more important?

What is the ulterior relationship between the mnemonic and the private key?

I believe that most people must be confused about this. If I hadn't had to write a popular science article, I wouldn't be bothered...

But one thing is undisputed:

Private keys and mnemonics are undoubtedly the most important things in the process of managing and using cryptocurrencies.

secondary title

1. What does the private key look like?

The Bitcoin private key is essentially a random number, just like you throw a dice to throw a number.

However, the private key of Bitcoin will be longer, and more concretely, it is a 256-bit number composed of 0 and 1.

0100101…01010100 (256 digits in total)

So here comes the question, so many 0s and 1s make me dizzy, how can I back them up?

Smart brother Cong invented a special encoding (Base58) that can convert a large string of 01010 into an easier backup.

For example, the following character, which is the form of our common private key:

KwYHFL7WfhJPkfQkp1LsUwHvy1Pd9KynuxjjVDMZvRSV5D9VJq3v

Such a private key is "relatively" easy to back up and enter, ahem...

secondary title

2. What is the use of the private key?

How did your receiving address come about?

is computed with the private key.

How is your transaction authorized to be sent out?

is signed with a private key.

How are your assets restored in the wallet?

It is the private key that helps.

The private key is electricity, the private key is light, the private key is dad

secondary title

3. Is the private key safe?

We mentioned earlier that the private key is essentially a 256-bit random number, so the total number of private keys generated is 2 to the 256th power.

This total may sound ordinary, but it can no longer be described by common things:

"The diameter of a hair, the size is about 500,000 atoms superimposed, and the total number of private keys is close to the number of all atoms in the observable universe."

"Every gram of land (substance) on the 360 ​​earths becomes an earth, and the sum of all the water molecules on these earths is the total number of private keys."

Therefore, if you want to obtain the private key of a specific address through violent collision, the difficulty is equivalent to finding a water molecule on so many earths, or an atom in the vast universe... and you, even if you lose your home key, you can’t find it.

Although the private key can be generated in a large enough range, if there is a problem with the algorithm for generating the private key, there will be hidden dangers.

For example, if the random number generation of a wallet is not random enough, it is possible to generate the same set of private keys for two users. Here we will test the cryptography skills of the wallet team.

(The extremely random algorithm pioneered by the Bither & Bitpie team is to add random factors such as user-side signals, sounds, images, etc. to increase the entropy pool when the user calculates the private key to generate high-quality random numbers. Inventing the extremely random algorithm It is also one of the reasons why our team was recommended by bitcoin.org.)

Seeing this, everyone was stunned. The private key is so important, but I only backed up 12 words in many wallets, and I didn’t back up the private key. Am I not cool? !

Don't be afraid, with me warming you, how can you be cold.

secondary title

4. What does the mnemonic look like?

The most common mnemonic is a set of 12 words.

1、health   2、fine       3、profit       4、below 

5、crowd   6、wish      7、task        8、gown 

9、mind    10、surge   11、apple    12、max

secondary title

5. What is the use of the mnemonic?

How did your receiving address come about?

It is calculated by the mnemonic.

How is your transaction authorized to be sent out?

It is signed by the mnemonic.

How are your assets restored in the wallet?

It's the mnemonic that helps.

The mnemonic is electricity, the mnemonic is light, and the mnemonic is dad

The mnemonic is the only certificate of assets in your blockchain world. Those who have the mnemonic will own the assets on the corresponding address.

"...No, that's what you said about the private key just now!"

secondary title

6. What is the relationship between the mnemonic and the private key?

In fact, the mnemonic and the private key are functionally the same. (Prove that the previous paragraph did not make up the word count at all)

The essence of the mnemonic is also a string of random numbers (128-256 bits). However, because the form of random numbers and the form of private keys are inconvenient to use, the Bitcoin community adopted the BIP39 protocol to allow random numbers to be converted into words through specific encoding. words in the library.

(Small knowledge: Bitcoin Improvement Proposals, or BIP for short, is a design guidance document that provides specifications for the Bitcoin community and improves Bitcoin and its operating process and external environment characteristics)

Mnemonic words do not need to be case-sensitive, and they are relatively common words, which are much more convenient to use than private keys. Therefore, in recent years, mnemonic word wallets have gradually become mainstream wallets.

Another advantage of the mnemonic wallet is that a set of mnemonics can derive N private keys, and each private key can correspond to a currency. If you have 30 currencies (BTC, ETH, LTC, EOS, etc.), you don’t need to record the private key for each currency separately, you only need to record a set of mnemonics to control all assets.

Bitpie wallets will display both the mnemonic phrase and the private key to the user, but generally speaking, it is enough to back up the mnemonic phrase.

secondary title

7. Are the mnemonic phrases common among wallets?

secondary title

8. Will the mnemonic be eliminated?

The emergence of the mnemonic is approved by the Bitcoin core development team and the community, and the corresponding BIP protocol is written in the Bitcoin open source code.

From the development history of wallet backup:

The wallet has gone through three processes of backing up the wallet file - backing up the private key - backing up the mnemonic.

secondary title

9. What should I pay attention to when backing up and restoring the private key and mnemonic?

1. The private key consists of uppercase, lowercase, and numbers. Pay attention to the distinction when backing up and restoring.

2. Please do not store the private key and mnemonic in the networked device, but carefully copy it on paper or store it in the Bingjia mnemonic board.

secondary title

10. What is the reason for the prompt "invalid mnemonic" when recovering with mnemonic?

The reason for this is generally that a certain word was copied wrong, but because the words have a fixed lexicon, you can search for similar words in the lexicon and try to replace the input.

Official English thesaurus address: https://github.com/bitcoin/bips/blob/master/bip-0039/english.txt

secondary title

11. What is the difference between Chinese mnemonic words and English mnemonic words?

emmm Only the language is different, but the usage is the same.

Both Chinese and English mnemonics have official thesaurus. But because there are more wallets supporting English mnemonics around the world, and the Chinese lexicon contains rare words, which will easily cause users to leave uneducated tears, so I recommend that you use English.

secondary title

12. Are mnemonics and secret words the same thing?

Yes. When we first made wallets, the term "mnemonic" had not yet been born in China, so we created the term "secret language". Later, everyone seemed to have a wider acceptance of the term mnemonic, so we changed "secret words" to "mnemonic words" in our new clients.

That's all I can think of right now, if you have any questions, please feel free to contact me.

pie

bitpie.com

比特派钱包
作者文库