Rust CLI and library for Solana wallet key management, encrypted keystores, 2FA/3FA, bot integration, SOL/SPL transfers, and WSOL tools.
๐ Sol-SafeKey
Secure Solana key management library with AES-256 encryption
Military-grade wallet security with simple bot integration - secure password handling, encrypted keystores, and full Solana operations support.
ไธญๆ | English | Website | Telegram | Discord
๐ Table of Contents
- What This Project Provides
- โจ Features
- ๐ Quick Start
- ๐ฆ Installation
- ๐ Feature Guide
- ๐ Documentation
- ๐ Security
- ๐ฌ Contact
What This Project Provides
Sol-SafeKey is a Rust CLI and library for Solana wallet key management, encrypted keystore workflows, bot integration, and optional 2FA/3FA protection. It is designed for developers who need a safer local workflow for private keys while still supporting common Solana wallet and trading operations.
| Area | Coverage | |------|----------| | Key storage | AES-256 encrypted keys, keystore files, password-based unlock, hardware fingerprint support | | Authentication | 2FA/TOTP setup, triple-factor wallet generation, 3FA wallet unlock | | Solana operations | SOL balance, SOL transfer, SPL token transfer, WSOL wrap/unwrap/close, durable nonce accounts | | Trading utilities | Pump.fun sell, PumpSwap sell, Pump.fun cashback, PumpSwap cashback | | Integration | CLI menu, Rust library, bot helper APIs, examples, bilingual user guides |
๐ Feature Guide
๐ Quick Start
Installation โ โ Unlock Wallet โ Check Balance๐ Core Functions
- 1. Create Plaintext Key - Generate unencrypted keypair (testing only)
- 2. Create Encrypted Key - Encrypt and save to keystore
- 3. Decrypt Key - Decrypt keystore and reveal private key
๐ Wallet Management
- U. Unlock Wallet - Unlock wallet for Solana operations
๐ก๏ธ Advanced Security
- 4. Setup 2FA - Configure two-factor authentication
- 5. Generate Triple-Factor Wallet - Create 3FA wallet
- 6. Unlock Triple-Factor Wallet - Decrypt 3FA encrypted wallet
๐ฐ Solana Operations
Balance & Transfer
- 7. Check Balance - Query SOL balance
- 8. Transfer SOL - Send SOL
WSOL Operations
- 9. Create WSOL ATA - Create WSOL ATA
- 10. Wrap SOL - SOL โ WSOL
- 11. Unwrap WSOL - WSOL โ SOL
- 12. Close WSOL ATA - Close WSOL ATA
Token Operations
- 13. Transfer SPL Token - Send SPL tokens
- 14. Create Nonce Account - Create durable nonce
DEX Operations
- 15. Pump.fun Sell - Sell on Pump.fun DEX
- 16. PumpSwap Sell - Sell on PumpSwap DEX
Cashback Operations
- 17. Pump.fun Cashback - View/claim pump.fun cashback (SOL)
- 18. PumpSwap Cashback - View/claim PumpSwap cashback (WSOL)
๐ฆ Installation
Install from crates.io (Recommended)
The latest stable release is available on crates.io:
# Install with all features enabled
cargo install sol-safekey --features full
Verify installation
sol-safekey --version
Start interactive menu
sol-safekey start
This installs the complete CLI with all features:
- ๐ Core encryption - AES-256 password-based encryption
- ๐ 2FA/TOTP - Two-factor authentication support
- ๐ Solana operations - Full Solana transaction support
- ๐ฑ DEX operations - Pump.fun & PumpSwap trading
- ๐ฐ Cashback - Claim trading cashback rewards
Install from source
# Clone repository
git clone https://github.com/0xfnzero/sol-safekey.git
cd sol-safekey
Build and install
cargo install --path . --features full
System Requirements
- Rust: 1.70+ (install from rustup.rs)
- Operating System: Linux, macOS, or Windows
- Network: Internet connection for Solana RPC calls
Cargo Feature Flags
full- Enable all features (default for CLI)cli- Command-line interface with colored output2fa- Two-factor authentication (TOTP) supportsolana-ops- Solana blockchain operationssol-trade-sdk- Trading operations (Pump.fun, PumpSwap)
๐ Complete Interactive Menu Guide
๐ View Complete Interactive Menu Guide โ INTERACTIVE_TUTORIAL.md
Comprehensive step-by-step guide for all interactive menu operations, including detailed instructions, use cases, and example outputs for each of the 18 menu options.
๐ Documentation
- Bot Integration Guide - How to integrate sol-safekey into your bot
- User Guide - Complete usage instructions and examples
๐ Security
- โ Password Security: stdin pipe only (never in environment variables)
- โ Encryption: AES-256 with PBKDF2 key derivation
- โ Memory Safety: Immediate password cleanup after use
- โ Hardware Fingerprint: Device-based security layer
- โ 2FA Support: Optional two-factor authentication for enhanced security
๐ ๏ธ Available Operations
Wallet Management
- Create Wallet - Generate new encrypted wallet with AES-256
- Import Wallet - Import existing wallet from private key or seed phrase
- Export Wallet - Export wallet to encrypted JSON format
- View Address - Display wallet public address
SOL Operations
- Query Balance - Check SOL balance in your wallet
- Transfer SOL - Send SOL to other addresses
- Wrap SOL - Convert SOL to WSOL (Wrapped SOL)
- Unwrap WSOL - Convert WSOL back to SOL
- Close WSOL ATA - Close WSOL ATA account
Token Operations
- Transfer SPL Token - Send SPL tokens to other addresses
- Query Token Balance - Check token balances
DEX Operations
- ๐ฅ Pump.fun Sell - Interactive token selling on Pump.fun DEX (internal market only)
- ๐ PumpSwap Sell - Sell tokens on PumpSwap DEX
Cashback Operations
- Pump.fun Cashback - View and claim pump.fun cashback (native SOL)
- PumpSwap Cashback - View and claim PumpSwap cashback (WSOL)
Advanced Features
- Durable Nonce Accounts - Create and manage nonce accounts for offline signing
- 2FA Support - Optional two-factor authentication for enhanced security
Transaction Management
- Check Transaction Status - Query transaction status on Solana
๐ Examples
See examples/bot_example.rs for a complete bot integration example.
๐ค Contributing
Contributions welcome! Please ensure security best practices are followed. Use English for commit and PR descriptions.
๐ License
MIT License - See LICENSE file for details