Overview
Thegenerate-operator-keys command generates cryptographic keys for your SSV operator. These keys are used to decrypt validator share data from SSV contract events.
The command supports three modes:
- Raw key generation (default, not recommended for production)
- Encrypted keystore generation (recommended for production)
- Convert existing raw key to encrypted keystore
Usage
Flags
Path to file containing the password used to encrypt the private key.When provided, the command generates an encrypted keystore JSON file instead of raw keys.Alias:
-pPath to an existing operator private key file to convert to encrypted format.Use with
--password-file to encrypt an existing raw key.Alias: -oStore public key in keystore using legacy format (
"pubKey" instead of "pubkey").Only use if you need compatibility with older SSV versions.Alias: -lMode 1: Raw Key Generation (Not Recommended)
Generate a new operator key pair in raw (base64-encoded) format:Output
pk- Public key (base64-encoded)sk- Private key (base64-encoded)
The private key can be used directly in
config.yaml under OperatorPrivateKey, but this is not secure for production.Mode 2: Encrypted Keystore Generation (Recommended)
Generate a new operator key encrypted with a password:Step 1: Create Password File
Step 2: Generate Encrypted Keystore
Output
encrypted_private_key.json containing your encrypted operator key:
encrypted_private_key.json
Step 3: Configure Your Node
Reference the encrypted keystore in yourconfig.yaml:
config.yaml
Mode 3: Convert Existing Key to Encrypted Format
If you already have a raw operator key, convert it to encrypted format:Step 1: Save Your Raw Key
Step 2: Create Password File
Step 3: Convert to Encrypted Keystore
Output
Security Best Practices
Password Security
Password Security
- Use strong, unique passwords (minimum 12 characters)
- Never reuse passwords across operators
- Store password files separately from keystore files
- Use password managers for production environments
- Set restrictive permissions:
chmod 600 password.txt
Keystore File Protection
Keystore File Protection
Backup Procedures
Backup Procedures
What to backup:
encrypted_private_key.json(encrypted keystore)password.txt(password file)- Public key (from initial generation or from keystore)
- Store backups in separate, secure locations
- Use encrypted backup solutions
- Never commit to version control systems
- Consider hardware security modules (HSM) for production
Never Use Raw Keys in Production
Never Use Raw Keys in Production
❌ Bad - Raw key in config:✅ Good - Encrypted keystore:
Examples
Generate New Encrypted Operator Key
Convert Raw Key to Encrypted
Generate with Legacy Public Key Format
Using Environment Variables
Output Files
Encrypted Keystore JSON
When using--password-file, the command creates encrypted_private_key.json:
| Field | Description |
|---|---|
version | Keystore version (4 = EIP-2335 compatible) |
pubkey | Base64-encoded public key |
crypto.cipher | Encryption algorithm (aes-128-ctr) |
crypto.ciphertext | Encrypted private key data |
crypto.kdf | Key derivation function (scrypt) |
crypto.kdfparams | KDF parameters (n, r, p, salt) |
crypto.mac | Message authentication code for verification |
Console Output
Without--password-file, keys are printed to console:
Troubleshooting
Failed to read password file
Failed to read password file
Failed to parse private key
Failed to parse private key
Permission denied
Permission denied
Empty password file
Empty password file
If your password file is empty, the encryption will still work but with an empty password:
Using Generated Keys
In Configuration File
config.yaml
Extract Public Key
Your public key is needed for operator registration:See Also
- start-node - Start your SSV node
- Running a Node - Start your operator node
- Security Best Practices - Secure your operator
