Eth2 Staking Series: Keys
source|Ethereum Blog
source|
Author | Carl Beekhuizen
Thanks to Sacha Yves Saint-Leger and Danny Ryan for reviewing this article.
No matter which proof-of-stake (PoS) system, the core is the signature scheme. Signatures are used to identify and verify the identity of each validator, allowing us to trace validator actions (whether good or bad) back to the validators themselves.
In eth2, the identity of each validator is their public key. Specifically, each validator will have two sets of keys: signing keys and withdrawal keys.
first level title
Signing keys are keys that validators need to sign attestations and propose blocks. Since a verifier needs to sign at least one message per epoch, client software must escrow the signing key.
first level title
withdrawal key
The client software is always connected to the internet, so it is entirely possible for the verifier's signing key to be compromised. In order to mitigate the corresponding impact, the operation of the verifier needs to be realized through two kinds of keys.
As mentioned above, verifiers perform their duties through signing keys. And the withdrawal key can control the validator's funds (transfer and withdraw ETH).
*Transfers and withdrawals are only possible in Phase 1 at the earliest
first level title
What to do with too many keys?
If for every 32 ETH staked a staker needs to save and deposit using two unrelated keys, things can quickly get out of hand.
In eth2, this solution is achieved byEIP 2333and2334Implementation: This set of standards describes the relationship between withdrawal keys and signing keys, and how they are derived from a single mnemonic.
first level title
mnemonic
For example, recording a set of mnemonics sausage solution loud isolate focus glide frame door clown million shuffle impulse is more accurate than recording a string of keys 0x1e9f2afcc0737f4502e8d4238e4fe82d45077b2a549902b61d65367acecbccba
first level title
When interacting with wallets, you may come across "paths" of the form m/44'/60'/0'/0/0. These paths describe the relationships between keys.
according toEIP 2333according to
, whose relationship takes the form of a tree structure, where the key is determined by the entropy source (seed of the tree) and the tree path.
We use the seed to calculate the root, and then build layer by layer based on the root. The key tree is defined entirely in terms of the relationships between its subsequent branches and the root of the tree.
In effect, this allows us to start at the root of the tree and compute intermediate keys on each branch, then reach the relevant leaf nodes to find any keys we need in the tree.
The magic is that we can start with a single source of entropy (such as a mnemonic) and derive a virtually unlimited number of keys from it.
Also, by storing only that mnemonic, you can back up every key you use as a validator.
Each branch is separated by a / , so m/2 means start with the master key and follow the 2nd branch.
existEIP 2334exist
, the validator's signing key is the 0th subbranch of the withdrawal key. That is to say, in practice, when you follow this standard, if you know the private key used for withdrawal, then you can calculate the corresponding signature private key.
Continuing the above example, we can find the corresponding three signing keys at m/0/0, m/1/0, m/2/0.EIP 2334 The above example was simplified as much as possible to illustrate the concepts, but in practice the paths involved are longer (
All in all, the main thing to remember is this: if you know the mnemonic, you can calculate the withdrawal key, and then use the withdrawal key to get your signing key.
first level title
storage key
Validator clients use keystore files as a means of exchanging keys.
When you are ready to start verification, you need to provide the Keystore and the password to encrypt it to your verifier client. The client needs these two pieces of information to import the private key.
first level title
become a validator
To become a validator, first generate the appropriate keys. When you write down your mnemonic, the key can be generated.
Since it is not possible to withdraw or transfer ETH during Phase 0, there is no need to go through the Keystore to obtain the withdrawal key, it is sufficient to ensure that the mnemonic is stored in a secure manner.
When the validator client needs to use the signing key, each of your validator nodes will receive a Keystore file that stores the corresponding key.
first level title
Shortcut to becoming a validator
We have been working on building a friendly interface to guide users to become validators. Soon we will have a blog post explaining what the Eth2 Launchpad is and how to use it!
first level title
Eth2 Staking Series: Fragmentation Consensus
For more Ethereum information, please pay attention to:
For more Ethereum information, please pay attention to:
Public account: ETH Chinese website
Website: ethereum.cn
Disclaimer: ECN's translation work aims to deliver high-quality information and learning resources for the Chinese Ethereum community. The copyright of the article belongs to the original author. Reprints must indicate the source of the original text and ethereum.cn. For long-term reprints, please contact ethereumcn@gmail.com Authorize.


