Sacha Saint-Leger c26b06dd12
Add page on recovering key(s) (#2153)
* Add page on recovering key

* rm extra file
2020-12-07 00:15:19 +01:00

2.9 KiB

Recover existing keys / Generate more keys

Your mnemonic can be used to recover lost keys and generate new ones.

Every time you generate a keystore from your mnemomic, that keystore is assigned an index. The first keystore you generate has index 0, the second index 1, etc. You can recover any key using your mnemonic and that key's index. For more on how keys are derived, see this excellent post.

To stay consistent with the rest of the book, we'll take you though how to do this using the deposit-cli's binary executable.

Specifically, we'll be using the existing-mnemonic command. According to the deposit-cli's README:

This command is used to re-generate or derive new keys from your existing mnemonic. Use this command, if (i) you have already generated keys with this CLI before, (ii) you want to reuse your mnemonic that you know is secure that you generated elsewhere (reusing your eth1 mnemonic .etc), or (iii) you lost your keystores and need to recover your keys.

Recover existing key

⚠️ Recovering validator keys from a mnemonic should only be used as a last resort. Exposing your mnemonic to a computer at any time puts it at risk of being compromised. Your mnemonic is not encrypted and if leaked, can be used to steal your funds.

Run the following command from the directory which contains the deposit executable:

Pyrmont

./deposit existing-mnemonic --validator_start_index 0 --num_validators 1 --chain pyrmont

Mainnet

./deposit existing-mnemonic --validator_start_index 0 --num_validators 1 --chain mainnet

You'll be prompted to enter your mnemonic, and a new password for your keystore.

Check that the validator_keys directory contains your extra keystore.

Copy the validator_keys directory to nimbus-eth2 and then follow the instructions here.

Generate another key

⚠️ If you wish to generate another validator key, you must take great care to not generate a copy of your original key. Running the same key on two different validator clients will likely get you slashed.

Run the following command from the directory which contains the deposit executable:

Pyrmont

./deposit existing-mnemonic --validator_start_index 1 --num_validators 1 --chain pyrmont

Mainnet

./deposit existing-mnemonic --validator_start_index 1 --num_validators 1 --chain mainnet

You'll be prompted to enter your mnemonic, and a new password for your keystore.

Check that the validator_keys directory contains an extra keystore.

Copy the validator_keys directory to nimbus-eth2.

Make sure you've made a deposit for your new keystore, and then follow the instructions here.