Skip to content

Keygen Command

The keygen command generates RSA keys for SSV operator identification

anchor keygen [OPTIONS]

Options

OptionDescriptionDefault
-d, --data-dir <DIR>Directory to store generated keys~/.anchor/{network}
--forceForce overwrite of existing key filesDisabled
--encryptEnable password encryption (password read from terminal or --password-file)Disabled
--password-file <PATH>Path to a file containing the password to useNone
--network <NETWORK>Network to use (mainnet, holesky, hoodi)hoodi
-t, --testnet-dir <DIR>Directory containing testnet specsNone
--debug-level <DEBUG_LEVEL>Verbosity level for terminal logsINFO
-h, --helpDisplay help information

Examples

This will create an unencrypted private_key.txt file containing the newly generated private key and a public_key.txt file with the BASE64 encoded public key used for registering the operator.

anchor keygen

This will create a encrypted_private_key.json file encrypted with the provided password and a public_key.txt file with the BASE64 encoded public key used for registering the operator. The password must be provided via --password-file or interactively when running Anchor.

anchor keygen --encrypt --data-dir /path/to/keys

Anchor will look for the key file in the default directory ~/.anchor/{network}, or the directory specified by --data-dir.