Skip to content

Keygen Command

The keygen command generates RSA keys for SSV operator identification

anchor keygen [OPTIONS]

Options

OptionDescriptionDefault
--output-path <PATH>Directory to store generated keysCurrent Directory
--forceForce overwrite of existing key filesDisabled
--encryptEncrypt the private keyDisabled
--password-file <PATH>Path to a file containing the key passwordNone
--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 --output-path /path/to/keys

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