Overview
Solana CLI supports several wallet types for managing keypairs and signing transactions:- File System Wallets - Unencrypted keypair files stored on disk
- Paper Wallets - Seed phrases written on paper for offline storage
- Hardware Wallets - Physical devices (Ledger, Trezor) for secure key storage
solana-keygen Tool
Thesolana-keygen tool provides all keypair generation and management functionality:
Common Commands
new- Generate a new keypairpubkey- Display or recover a public keyverify- Verify keypair ownershiprecover- Recover keypair from seed phrasegrind- Generate vanity addresses
File System Wallets
File system wallets store keypairs as JSON files on your computer.Generate a File System Keypair
Generate keypair
Verify Keypair
Verify you control the private key for an address:Multiple Keypairs
Create multiple keypairs by specifying different output files:Security Considerations
- Files are stored unencrypted on disk
- Malware could access keypair files
- Use encrypted storage (FileVault on MacOS, BitLocker on Windows)
- Never share keypair files
- Keep backups in secure locations
- Use hardware wallets for large amounts
Paper Wallets
Paper wallets use BIP39-compliant seed phrases that can be written on paper for offline storage.Generate a Paper Wallet
Generate without output file
Use the
--no-outfile flag to generate a paper wallet:Omitting
--no-outfile creates a file system wallet at ~/.config/solana/id.json.Enter passphrase
The tool prompts for an optional passphrase:Press Enter for no passphrase, or enter one for additional security.
Increase Word Count
For added security, use 24 words instead of the default 12:Derive Public Key from Seed
Recover your public key from a seed phrase:Your seed phrase is not displayed as you type for security reasons.
Verify Paper Wallet
Verify you control a paper wallet:Hierarchical Derivation
Solana supports BIP32/BIP44 hierarchical derivation. By default,prompt:// derives the path m/44'/501'.
Derive a child key:
Solana uses Ed25519 keypairs, so per SLIP-0010, all derivation indexes are hardened regardless of whether ticks are included.
Using Paper Wallets
Use theprompt:// URI anywhere a keypair is required:
Check Balance
To check a paper wallet balance without exposing the seed phrase:- Derive the public key on an air-gapped computer
- Transfer the public key via USB stick to a networked computer
- Check balance using the public key:
Paper Wallet Security
- Extremely secure when used with offline signing
- Inconvenient for frequent transactions
- Protect seed phrase from physical theft
- Consider using a fireproof safe
- Never enter seed phrase on compromised computers
- Use air-gapped systems for high-value operations
Hardware Wallets
Hardware wallets provide excellent security while maintaining convenience.Supported Devices
Solana CLI supports:- Ledger: Nano S, Nano S Plus, Nano X
- Trezor: Model T, Safe 3, Safe 5
Keypair URL Format
Hardware wallets use a special URL format:MANUFACTURER- Device type (ledgerortrezor)WALLET_ID- Globally unique identifier (optional)DERIVATION_PATH- Key derivation path as<ACCOUNT>[/<CHANGE>](optional)
Derivation Paths
All Solana derivation paths implicitly include the prefix44'/501' per BIP44 specifications where 501 is Solana’s coin type.
The full path for usb://ledger?key=0/0 is:
Get Hardware Wallet Public Key
Using Hardware Wallets
Use the keypair URL anywhere a keypair is required:Multiple Accounts
Derive multiple accounts from one device:Hardware Wallet Benefits
- Private keys never leave the device
- Physical confirmation required for transactions
- Secure element chip protection
- Balance between security and convenience
- Suitable for significant token amounts
- Resistant to malware attacks
Vanity Address Generation
Generate keypairs with custom prefixes or suffixes usingsolana-keygen grind.
Generate Address with Prefix
Create an address starting with “SOL”::1 specifies to find 1 match. Longer prefixes take exponentially more time.
Generate Address with Suffix
Create an address ending with “SOL”:Multi-threaded Grinding
Specify thread count for faster generation:Save to File
Save the generated keypair:Best Practices
For Development
- Use file system wallets on isolated development machines
- Never reuse development keypairs on mainnet
- Keep separate keypairs for different clusters
For Production
- Use hardware wallets for validator identity and withdraw authority
- Use paper wallets with offline signing for high-value operations
- Never store mainnet keypairs in plaintext on networked systems
- Implement multi-signature schemes for critical operations
For Validators
- Use hardware wallet for withdraw authority
- Use file system wallet for vote account (requires frequent signing)
- Keep identity keypair secure and backed up
- Consider using a TPU vote signer for improved performance
Backup Strategy
- File System Wallets: Copy keypair files to encrypted USB drives
- Paper Wallets: Write seed phrases on paper, store in multiple secure locations
- Hardware Wallets: Keep device safe, backup seed phrase on paper
- Test recovery procedures regularly
Common Operations
Set Default Keypair
Configure the CLI to use a specific keypair by default:Display Public Key
From file:Recover Keypair
Recover a keypair from seed phrase to a file:Troubleshooting
Cannot find hardware wallet
Ensure:- Device is connected via USB
- Device is unlocked
- Solana app is open on the device
- USB permissions are correct (Linux may require udev rules)
Seed phrase validation fails
If using a seed phrase from another tool with a different word list:Wrong public key derived
Ensure you’re using the correct:- Seed phrase (word order matters)
- Passphrase (case-sensitive)
- Derivation path