You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Issue Addressed
Update Lighthouse book to include latest information especially after Capella upgrade
## Proposed Changes
Notable changes:
- Combine Sec 4.1 & 6.1 into Sec 4, because Sec 6.1 is importing validator key which is a required step when want to run a validator
- Combine Sec 5.1 & 5.2 with Sec 5, and move Sec 5 to under Sec 9
- Added partial withdrawals in Sec 6
## Additional Info
Please provide any additional information. For example, future considerations
or information useful for reviewers.
Co-authored-by: chonghe <[email protected]>
% To compile the file using PdfLaTeX, you may use the latex+dvips+ps2pdf compilation. If you are using TeXstudio, this is builtin and you can choose this option by going to Options > Configure TeXstudio under Build & View, choose DVI -> PS -> PDF Chain
2
+
3
+
% Alternatively, you may use XeLaTeX with --shell-escape command. To do so in TeXstuidio, go to Options > Configure TeXstudio > Build. Under "Add Commands", enter a user of your choice, and in the right empty space, insert: txs:///xelatex/[--shell-escape]. When compile, go to Tools > User and select the user you just inserted.
4
+
5
+
\documentclass[]{article}
6
+
\usepackage{pst-all}
7
+
\pagestyle{empty}
8
+
9
+
10
+
11
+
\begin{document}
12
+
13
+
14
+
\begin{figure}
15
+
\psscalebox{1.0 1.0} % Change this value to rescale the drawing.
% To compile the file using PdfLaTeX, you may use the latex+dvips+ps2pdf compilation. If you are using TeXstudio, this is builtin and you can choose this option by going to Options > Configure TeXstudio under Build & View, choose DVI -> PS -> PDF Chain
2
+
3
+
% Alternatively, you may use XeLaTeX with --shell-escape command. To do so in TeXstuidio, go to Options > Configure TeXstudio > Build. Under "Add Commands", enter a user of your choice, and in the right empty space, insert: txs:///xelatex/[--shell-escape]. When compile, go to Tools > User and select the user you just inserted.
4
+
5
+
6
+
\documentclass[]{article}
7
+
\usepackage{pst-all}
8
+
\pagestyle{empty}
9
+
10
+
11
+
12
+
\begin{document}
13
+
14
+
\begin{figure}
15
+
\psscalebox{1.0 1.0} % Change this value to rescale the drawing.
> *Note: 16 GB RAM is becoming rather limited due to the increased resources required. 16 GB RAM would likely result in out of memory errors in the case of a spike in computing demand (e.g., caused by a bug) or during periods of non-finality of the beacon chain. Users with 16 GB RAM also have a limited choice when it comes to selecting an execution client, which does not help with the [client diversity](https://clientdiversity.org/). We therefore recommend users to have at least 32 GB RAM for long term health of the node, while also giving users the flexibility to change client should the thought arise.
Copy file name to clipboardExpand all lines: book/src/key-management.md
+55-48Lines changed: 55 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,12 +3,12 @@
3
3
[launchpad]: https://launchpad.ethereum.org/
4
4
5
5
>
6
-
> **Note: we recommend using the [Staking launchpad][launchpad] to create validators.**
6
+
> **Note: While Lighthouse is able to generate the validator keys and the deposit data file to submit to the deposit contract, we strongly recommend using the [staking-deposit-cli](https://github.com/ethereum/staking-deposit-cli) to create validators keys and the deposit data file. This is because the [staking-deposit-cli](https://github.com/ethereum/staking-deposit-cli) which has the option to assign a withdrawal address during the key generation process, while Lighthouse wallet will always generate keys with withdrawal credentials of type 0x00. This means that users who created keys using Lighthouse will have to update their withdrawal credentials in the future to enable withdrawals. In addition, Lighthouse generates the deposit data file in the form of `*.rlp`, which cannot be uploaded to the [Staking launchpad][launchpad] that accepts only `*.json` file. This means that users have to directly interact with the deposit contract to be able to submit the deposit if they were to generate the files using Lighthouse.**
7
7
8
8
Lighthouse uses a _hierarchical_ key management system for producing validator
9
9
keys. It is hierarchical because each validator key can be _derived_ from a
10
10
master key, making the validators keys _children_ of the master key. This
11
-
scheme means that a single 24-word mnemonic can be used to backup all of your
11
+
scheme means that a single 24-word mnemonic can be used to back up all of your
12
12
validator keys without providing any observable link between them (i.e., it is
13
13
privacy-retaining). Hierarchical key derivation schemes are common-place in
14
14
cryptocurrencies, they are already used by most hardware and software wallets
@@ -30,37 +30,63 @@ We defined some terms in the context of validator key management:
30
30
keypair.
31
31
- Defined in EIP-2335.
32
32
-**Voting Keypair**: a BLS public and private keypair which is used for
33
-
signing blocks, attestations and other messages on regular intervals,
34
-
whilst staking in Phase 0.
33
+
signing blocks, attestations and other messages on regular intervals in the beacon chain.
35
34
-**Withdrawal Keypair**: a BLS public and private keypair which will be
36
35
required _after_ Phase 0 to manage ETH once a validator has exited.
37
36
38
-
## Overview
37
+
## Create a validator
38
+
There are 2 steps involved to create a validator key using Lighthouse:
39
+
1.[Create a wallet](#step-1-create-a-wallet-and-record-the-mnemonic)
40
+
1.[Create a validator](#step-2-create-a-validator)
39
41
40
-
The key management system in Lighthouse involves moving down the above list of
41
-
items, starting at one easy-to-backup mnemonic and ending with multiple
42
-
keypairs. Creating a single validator looks like this:
42
+
The following example demonstrates how to create a single validator key.
43
43
44
-
1. Create a **wallet** and record the **mnemonic**:
### Step 1: Create a wallet and record the mnemonic
45
+
A wallet allows for generating practically unlimited validators from an
46
+
easy-to-remember 24-word string (a mnemonic). As long as that mnemonic is
47
+
backed up, all validator keys can be trivially re-generated.
48
48
49
+
Whilst the wallet stores the mnemonic, it does not store it in plain-text: the
50
+
mnemonic is encrypted with a password. It is the responsibility of the user to
51
+
define a strong password. The password is only required for interacting with
52
+
the wallet, it is not required for recovering keys from a mnemonic.
49
53
50
-
In step (1), we created a wallet in `~/.lighthouse/{network}/wallets` with the name
51
-
`wally`. We encrypted this using a pre-defined password in the
52
-
`wally.pass` file. Then, in step (2), we created one new validator in the
53
-
`~/.lighthouse/{network}/validators` directory using `wally` (unlocking it with
54
-
`wally.pass`) and storing the passwords to the validators voting key in
55
-
`~/.lighthouse/{network}/secrets`.
54
+
To create a wallet, use the `lighthouse account wallet` command. For example, if we wish to create a new wallet for the Goerli testnet named `wally` and saves it in `~/.lighthouse/goerli/wallets` with a randomly generated password saved
55
+
to `./wallet.pass`:
56
56
57
-
Thanks to the hierarchical key derivation scheme, we can delete all of the
58
-
aforementioned directories and then regenerate them as long as we remembered
59
-
the 24-word mnemonic (we don't recommend doing this, though).
Using the above command, a wallet will be created in `~/.lighthouse/goerli/wallets` with the name
61
+
`wally`. It is encrypted using the password defined in the
62
+
`wally.pass` file.
60
63
61
-
Creating another validator is easy, it's just a matter of repeating step (2).
62
-
The wallet keeps track of how many validators it has generated and ensures that
63
-
a new validator is generated each time.
64
+
During the wallet creation process, a 24-word mnemonic will be displayed. Record the mnemonic because it allows you to recreate the files in the case of data loss.
65
+
> Notes:
66
+
> - When navigating to the directory `~/.lighthouse/goerli/wallets`, one will not see the wallet name `wally`, but a hexadecimal folder containing the wallet file. However, when interacting with `lighthouse` in the CLI, the name `wally` will be used.
67
+
> - The password is not `wally.pass`, it is the _content_ of the
68
+
> `wally.pass` file.
69
+
> - If `wally.pass` already exists, the wallet password will be set to the content
70
+
> of that file.
71
+
72
+
### Step 2: Create a validator
73
+
Validators are fundamentally represented by a BLS keypair. In Lighthouse, we use a wallet to generate these keypairs. Once a wallet exists, the `lighthouse account validator create` command can be used to generate the BLS keypair and all necessary information to submit a validator deposit. With the `wally` wallet created in [Step 1](#step-1-create-a-wallet-and-record-the-mnemonic), we can create a validator with the command:
- Derive a single new BLS keypair from wallet `wally` in `~/.lighthouse/goerli/wallets`, updating it so that it generates a new key next time.
81
+
- Create a new directory `~/.lighthouse/goerli/validators` containing:
82
+
- An encrypted keystore file `voting-keystore.json` containing the validator's voting keypair.
83
+
- An `eth1_deposit_data.rlp` assuming the default deposit amount (`32 ETH`) which can be submitted to the deposit
84
+
contract for the Goerli testnet. Other networks can be set via the
85
+
`--network` parameter.
86
+
- Create a new directory `~/.lighthouse/goerli/secrets` which stores a password to the validator's voting keypair.
87
+
88
+
89
+
If you want to create another validator in the future, repeat [Step 2](#step-2-create-a-validator). The wallet keeps track of how many validators it has generated and ensures that a new validator is generated each time. The important thing is to keep the 24-word mnemonic safe so that it can be used to generate new validator keys if needed.
64
90
65
91
## Detail
66
92
@@ -76,36 +102,17 @@ There are three important directories in Lighthouse validator key management:
76
102
- Defaults to `~/.lighthouse/{network}/validators`
77
103
-`secrets/`: since the validator signing keys are "hot", the validator process
78
104
needs access to the passwords to decrypt the keystores in the validators
79
-
dir. These passwords are stored here.
80
-
- Defaults to `~/.lighthouse/{network}/secrets` where `network` is the name of the network passed in the `--network` parameter (default is `mainnet`).
105
+
directory. These passwords are stored here.
106
+
- Defaults to `~/.lighthouse/{network}/secrets`
107
+
108
+
where `{network}` is the name of the network passed in the `--network` parameter.
81
109
82
110
When the validator client boots, it searches the `validators/` for directories
83
111
containing voting keystores. When it discovers a keystore, it searches the
84
-
`secrets/` dir for a file with the same name as the 0x-prefixed hex
85
-
representation of the keystore public key. If it finds this file, it attempts
112
+
`secrets/` directory for a file with the same name as the 0x-prefixed validator public key. If it finds this file, it attempts
86
113
to decrypt the keystore using the contents of this file as the password. If it
87
114
fails, it logs an error and moves onto the next keystore.
88
115
89
116
The `validators/` and `secrets/` directories are kept separate to allow for
90
117
ease-of-backup; you can safely backup `validators/` without worrying about
91
118
leaking private key data.
92
-
93
-
### Withdrawal Keypairs
94
-
95
-
In Ethereum consensus Phase 0, withdrawal keypairs do not serve any immediate purpose.
96
-
However, they become very important _after_ Phase 0: they will provide the
97
-
ultimate control of the ETH of withdrawn validators.
98
-
99
-
This presents an interesting key management scenario: withdrawal keys are very
100
-
important, but not right now. Considering this, Lighthouse has adopted a
101
-
strategy where **we do not save withdrawal keypairs to disk by default** (it is
102
-
opt-in). Instead, we assert that since the withdrawal keys can be regenerated
103
-
from a mnemonic, having them lying around on the file-system only presents risk
104
-
and complexity.
105
-
106
-
At the time of writing, we do not expose the commands to regenerate keys from
107
-
mnemonics. However, key regeneration is tested on the public Lighthouse
108
-
repository and will be exposed prior to mainnet launch.
109
-
110
-
So, in summary, withdrawal keypairs can be trivially regenerated from the
111
-
mnemonic via EIP-2333 so they are not saved to disk like the voting keypairs.
0 commit comments