A comprehensive command-line tool for recovering and managing legacy Solflare wallet keystores, including stake account withdrawals and fund transfers.
This tool solves common problems with legacy Solflare wallets:
- Locked out of legacy Solflare wallet
- Can't access Solflare keystore file
- Need to recover funds from https://legacy.solflare.com
- Unable to withdraw staked SOL from old accounts
- Migrating from legacy Solflare to modern wallet
# 1. Clone and install
git clone https://github.com/thijmau/solflare-wallet-recovery.git
cd solflare-wallet-recovery
npm install
# 2. Prepare your files
# Place solflare-keystore.json and password.txt in the project root
# 3. Run the tool
npm startThis tool provides a complete recovery and retrieval solution:
| Feature | Description |
|---|---|
| Keystore Decryption | Decrypt legacy Solflare keystore files using your password |
| Decrypt-Only Mode | Fast, offline decryption without blockchain operations |
| Balance Checking | View wallet and stake account balances |
| Stake Withdrawal | Unstake and withdraw SOL from multiple stake accounts |
| Fund Transfer | Transfer recovered funds to a new wallet |
| Environment Variables | Pass passwords securely via environment variables |
| CLI Automation | Scriptable with command-line flags for batch recovery |
| Interactive Mode | Step-by-step guided recovery process |
Before you begin, ensure you have:
- Node.js v14.0.0 or higher - https://nodejs.org/
- Solflare keystore file (
.jsonformat) - Wallet password (saved in a text file)
Example files available: Check
docs/directory for sample file formats
docs/solflare-keystore.example.jsondocs/password.example.txt
Visit https://legacy.solflare.com to access your wallet.
Place these files in the project root directory (same folder as script.js):
- Password file: Save as
password.txt - Keystore file: Save as
solflare-keystore.json
Expected file structure:
solflare-wallet-recovery/
├── script.js
├── solflare-keystore.json ← Your keystore here
├── password.txt ← Your password here
├── lib/
└── ...
Note: You can use different filenames/paths, but you'll need to specify them when prompted or via CLI flags.
Once logged into legacy Solflare, you can find:
- Wallet Address: Found under "Your Address"
- Stake Account Addresses: Listed in "Your staking accounts" section
The default mode guides you through each step with prompts.
Start the tool:
npm startProcess flow:
- File Input - Provide keystore and password file paths
- Decryption - Keystore is decrypted and verified
- Connection - Connect to Solana network
- Balance Check - View your wallet balance
- Stake Accounts - Add stake account addresses
- Withdrawals - Optionally withdraw from stake accounts
- Transfer - Optionally transfer all funds to new wallet
Note: The tool provides detailed logging with color-coded output:
[DEBUG](gray) - Diagnostic information[INFO](blue) - General information[SUCCESS](green) - Successful operations[WARN](yellow) - Warnings and partial failures[ERROR](red) - ErrorsCompletion Messages:
- "RECOVERY COMPLETE!" - All operations succeeded
- "RECOVERY COMPLETED WITH ERRORS" - Wallet decrypted successfully, but some transfers failed (you may need to transfer manually using the saved keypair)
Advanced: CLI Flags (Non-Interactive Mode)
For automation or scripting, use CLI flags to provide all options upfront.
Basic syntax:
node script.js [options]| Flag | Description | Default |
|---|---|---|
-k, --keystore <path> |
Path to keystore file | solflare-keystore.json |
-p, --password <text> |
Password as text (supports env variables) | - |
--password-file <path> |
Path to password file (alternative to -p) |
- |
--decrypt-only |
Only decrypt keystore, skip blockchain operations | false |
-r, --rpc <url> |
Solana RPC URL | https://api.mainnet-beta.solana.com |
-s, --stake-accounts <addresses...> |
Stake account addresses (space-separated) | - |
-w, --withdraw-to <address> |
Destination for stake withdrawals | Current wallet |
-t, --transfer-to <address> |
Final transfer destination | - |
-y, --yes |
Auto-confirm all prompts | false |
--no-tips |
Hide tips message | - |
-V, --version |
Show version number | - |
-h, --help |
Display help | - |
Decrypt-only mode (fast, offline, no RPC connection):
node script.js --password-file password.txt --decrypt-onlyPassword from environment variable:
export PASSWORD="your-password"
node script.js -p "$PASSWORD"Custom keystore location:
node script.js -k ./my-keystore.json --password-file ./my-password.txtFully automated recovery:
node script.js \
-k solflare-keystore.json \
-p "$PASSWORD" \
-s StakeAccount1111111111111111111111111111111 StakeAccount2222222222222222222222222222222 \
-w DestinationWallet111111111111111111111111111 \
-t FinalWallet11111111111111111111111111111111111 \
-y --no-tipsDisplay help:
node script.js --help
⚠️ CRITICAL: This tool handles sensitive cryptographic material (private keys).
Before using with real funds:
- Review the complete Security Policy
- Review automated security audit results
- Run
npm auditlocally and test with small amounts first
Having issues? Check these resources:
-
TROUBLESHOOTING - Common problems and solutions
- Decryption errors
- Connection issues
- Transaction failures
- File format problems
-
FAQ - Frequently asked questions
-
GitHub Issues - Report bugs or ask for help
If this tool helped you recover your funds, consider supporting the development:
| Currency | Address |
|---|---|
| Bitcoin (BTC) | bc1qj24nen3z3en5n89eqg3dsh37cgjytmdqjsehq5 |
| Ethereum (ETH) | 0xd4e249a6aeda20e318922ea448992df26d23bc3d |
| Solana (SOL) | 9cz2vBNaS9ZKnXzyLM1D7HjF1p9gwH4mYXamDpRg3UWN |
Tips appreciated but never required. This tool is free and open source.
Contributions are welcome!
- For major changes, open an issue first to discuss
- Submit Pull Requests for improvements
- Solflare Documentation - https://docs.solflare.com/
- Solana Documentation - https://docs.solana.com/
- Legacy Solflare Wallet - https://legacy.solflare.com
GPL-3.0 License - LICENSE
NO WARRANTY: This software is provided "as is", without warranty of any kind. Use at your own risk.
The author is NOT responsible for loss of funds, vulnerabilities in dependencies, or issues with external services. You are responsible for auditing code, verifying transactions, and securing your keys.
Star this repo if it helped you recover your funds!
Made with ❤️ by Thijmen Maus

