specborn documentation contents ↓

Validator keys (EIP-2335) #

Test keys only. Do not import keys that hold real value (what is supported).

Importing keystores #

specborn validator keys import --datadir DIR --keystores KEYDIR --password-file FILE
specborn validator keys list --datadir DIR

import reads every keystore*.json file in KEYDIR (the files the staking deposit tools write). For each one it decrypts the keystore in memory with the password from FILE, checks that the password is right, that the secret key is in range and that the keystore's public key is the secret key's, and only then copies the keystore to DIR/validators/keystores/0x<pubkey>.json. Version 4 keystores with scrypt or PBKDF2 and AES-128-CTR are accepted. One password file serves every keystore of one import.

By default the password file is copied to DIR/validators/secrets/0x<pubkey> so that the node can start unattended. With --no-store-password it is not, and you give it at every start: specborn run --validator-keys --validator-password-file FILE (it may be a pipe). Files are written with mode 0600 in directories with mode 0700. Keys and passwords are read from files only; no option takes a key or a password on the command line.

list prints the public keys of the imported keystores without decrypting them. The flags are in the CLI reference.

At every specborn run --validator-keys, the node decrypts every imported keystore before anything else starts. If any keystore fails, every failing file is named and the node does not start (exit 1). Every key must also be in the slashing-protection database (Slashing protection), or the node does not start (exit 1).

Try it with test keys #

The repository contains keystores made for tests, with their password in a plain file. They are public: never use them, or any key whose file is in a repository, for anything real. This imports two of them into a temporary data directory, lists them, creates a slashing-protection database that registers one of them (the root given is an arbitrary test value), and exports it:

runnable offline; checked by scripts/docs/check.sh
d="$(mktemp -d)"
.lake/build/bin/specborn validator keys import --datadir "$d" \
  --keystores Tests/vectors/vkeys/deposit-cli/pbkdf2 \
  --password-file Tests/vectors/vkeys/deposit-cli/pbkdf2/password.txt
.lake/build/bin/specborn validator keys list --datadir "$d"
.lake/build/bin/specborn validator slashing-protection register --datadir "$d" \
  --pubkey 0x996323af7e545fb6363ace53f1538c7ddc3eb0d985b2479da3ee4ace10cbc393b518bf02d1a2ddb2f5bdf09b473933ea \
  --genesis-validators-root 0x212f13fc4df078b6cb7db228f1c8307566dcecf900867401a92023d7ba99cb5f
.lake/build/bin/specborn validator slashing-protection export --datadir "$d" --file "$d/interchange.json"
cat "$d/interchange.json"

Expect warnings if the test files are readable by group or others (use chmod 600), two imported lines, the two public keys in the listing, the registration note, and an interchange file with one key and empty histories.

Limits #

From docs/pieces/vkeys.md §16, §26.3:

Evidence #