Articles and materials (open source) : Github

password

First understand that the password is not a private key, it is the password used when the account was created (note that you can change it). The password is used in the following situations:

  1. As a payment password for the transfer
  2. You need to enter the password when importing the wallet in the keystore to unlock the keystore

The private key

Private key by 64 length of hexadecimal characters, such as: 0 xa4356e49c88c8b7ab370af7d5c0c54f0261aaa006f6bde09cd4745cf54e0115a, one account only a private key and cannot be modified,. Usually, the private key and the public key in a wallet are paired. With the private key, we can generate the public key through a certain algorithm, and then generate the address through the public key through a certain algorithm. This process is irreversible. The private key must be kept properly. If it is leaked, others can use the private key to unlock your account and transfer your digital currency to the account.

keystore

The Keystore is commonly found in the Ethereum wallet. It saves the private key in an encrypted way as a JSON file. The JSON file is the Keystore, so it is the encrypted private key. The Keystore must be combined with the wallet password to use the account.

The mnemonic word

The private key is a hexadecimal character of 64 bits, which is not good for recording and easy to remember. Therefore, the algorithm is used to transform a string of random numbers into a string of 12 to 24 words that are easy to remember, which is convenient to save records. Note:

  1. Mnemonic words are another form of private key
  2. Mnemonic words can obtain multiple associated private keys, whereas private keys cannot obtain mnemonic words.

To understand the relation between the mnemonic word and the private key, it is necessary to understand the BIP protocol, which is short for Bitcoin Improvement Proposals, which are used to propose new functions or improvements for Bitcoin. There are many versions of BIP protocol, including BIP32, BIP39, and BIP44.

Ethereum support for BIP

BIP is used to propose new features or improvements for Bitcoin, but what about ethereum?

  • In EIPs/ Issues /84, ethereum discussed whether to follow BIP32 and BIP44, and the community raised a lot of interesting ideas. Bitcoin is based on UTXO, so you can use HD wallet (BIP32) to allocate a new address for each transaction to protect your privacy. However, ethereum is based on accounts, with each account having an address, and BIP is a proposal for Bitcoin, and since bitcoin’s data structure is designed around the idea of changing addresses, some of BIP’s proposals may not be appropriate for Ethereum. Mode and the currency of the etheric fang UTXO, etheric fang transfer can’t change address, if in the etheric fang UTXO on implementation, the user must also be signed two part of the deal with the balance sent to an address, part of the balance sent to the second address – this will make the cost doubled, and the second trading may not be in the same block, Of course ethereum can also be implemented through smart contracts. In addition, ethereum’s official wallet is currently in the form of KDF, commonly known as the Keystore.
  • The etheric lane inEIPs/issues/85, the Ethereum community seems to have adopted BIP32’s approach, proposing HD paths as follows:m/44'/60'/0'/0/n, n is the NTH generation address. Currently, ethereum clients that implement BIP32 include:Jaxx, Metamask, Exodus, imToken, TREZOR (ETH) & Digital Bitbox.

Relationship between password, private key, keystore and mnemonic words

How do I Unlock an Account?

There are several ways to unlock an account:

  • Private Key
  • Keystore+Password (Keystore+Password)
  • Mnemonic code

We can get the following conclusions:

  • You can use the private key + password to generate a keystore, that is, to encrypt the private key.
  • You can obtain the private key by using keystore+ password, that is, to decrypt the keystore.
  • Using mnemonic words to obtain different private keys according to different paths, that is, using HD wallet to convert mnemonic words into seeds to generate a master private key, and then derived a large number of child private keys and addresses.