Add page on recovering key(s) (#2153)

* Add page on recovering key

* rm extra file
This commit is contained in:
Sacha Saint-Leger 2020-12-07 00:15:19 +01:00 committed by GitHub
parent 7363bf3c7c
commit c26b06dd12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 63 additions and 1 deletions

View File

@ -23,7 +23,7 @@
- [Graffiti the blockchain](./graffiti.md)
- [Nimbus binaries](./binaries.md)
- [Troubleshooting](./troubleshooting.md)
- [Import another pair of keys]()
- [Recover / generate more keys](./more-keys.md)
# Tutorials
- [Grafana and Prometheus](metrics-pretty-pictures.md)
- [Network stats + monitoring](./eth2-stats.md)

View File

@ -0,0 +1,62 @@
# 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](https://blog.ethereum.org/2020/05/21/keys/).
To stay consistent with the rest of the book, we'll take you though how to do this using the [deposit-cli's](https://github.com/ethereum/eth2.0-deposit-cli) [binary executable](https://github.com/ethereum/eth2.0-deposit-cli/releases).
Specifically, we'll be using the `existing-mnemonic` command. According to the deposit-cli's [README](https://github.com/ethereum/eth2.0-deposit-cli#step-2-create-keys-and-deposit_data-json):
> 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](./keys.md).
## 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](./deposit.md) for your new keystore, and then follow the instructions [here](./keys.md).