Secure, auditable toolkit for Solana wallet generation and vanity addresses β using only official Solana Labs libraries.
- Vanity Address Generation β Generate addresses with custom prefixes/suffixes
- Multi-threaded Search β Parallel generation using all CPU cores
- Rust & TypeScript β High-performance Rust CLI + Node.js library
- Secure File Output β Keypairs saved with 0600 permissions
- Solana CLI Compatible β Output format works with
solanaCLI tools - 100% Offline β No network calls, fully air-gappable
- Auditable Code β Clean, documented source code
THIS SOFTWARE IS PROVIDED FOR EDUCATIONAL AND RESEARCH PURPOSES ONLY.
DO NOT USE WITH REAL FUNDS WITHOUT THOROUGH SECURITY REVIEW.
The author(s) accept NO LIABILITY for any damages, losses, or consequences arising from the use of this software. By using this software, you acknowledge that you are solely responsible for your actions and any outcomes.
This software is provided "AS IS" without warranty of any kind. The author(s) make no guarantees about the security, correctness, or fitness for any purpose.
ALWAYS:
- Audit the code yourself before any use
- Use hardware wallets for significant funds
- Understand that vanity address generation has inherent risks
- Generate keys on an air-gapped, offline machine
This toolkit uses ONLY official libraries from Solana Labs. No third-party cryptographic code.
| Implementation | Library | Repository | Maintainer |
|---|---|---|---|
| Rust | solana-sdk |
solana-labs/solana | Solana Labs |
| TypeScript | @solana/web3.js |
solana-labs/solana-web3.js | Solana Labs |
| Shell | solana-keygen |
solana-labs/solana | Solana Labs |
All cryptographic operations (Ed25519 key generation, signing) are handled by these official packages. The toolkit code only provides CLI interface and pattern matching logic.
These standard libraries handle CLI, parallelism, and file I/O β none touch private keys:
| Package | Purpose | Used By |
|---|---|---|
clap |
CLI argument parsing | Rust |
rayon |
Parallel processing | Rust |
serde |
JSON serialization | Rust |
zeroize |
Secure memory clearing | Rust |
- Run offline β Disconnect from the internet when generating wallets
- Audit the code β It's open source, verify it yourself
- Never share private keys or keypair files
- Store secrets securely β Use hardware wallets for significant funds
- Verify file permissions β Keypair files should be
0600(owner read/write only)
# Clone the repository
git clone https://github.com/nirholas/solana-wallet-toolkit.git
cd solana-wallet-toolkit/rust
# Build release binary
cargo build --release
# Binary is at target/release/solana-vanitycd solana-wallet-toolkit/typescript
# Install dependencies
npm install
# Build
npm run build# Requires Solana CLI tools installed
# https://docs.solana.com/cli/install-solana-cli-tools
cd solana-wallet-toolkit/scripts
chmod +x *.sh# Generate address starting with "ABC"
./solana-vanity --prefix ABC
# Generate address ending with "XYZ"
./solana-vanity --suffix XYZ
# Both prefix and suffix
./solana-vanity --prefix AB --suffix 99
# Case-insensitive matching
./solana-vanity --prefix abc --ignore-case
# Specify number of threads
./solana-vanity --prefix ABC --threads 8
# Custom output file
./solana-vanity --prefix Sol --output my-wallet.json
# Generate multiple addresses
./solana-vanity --prefix A --count 5
# Estimate time without generating (dry run)
./solana-vanity --prefix ABCD --dry-run
# Quiet mode (just output public key)
./solana-vanity --prefix AB --quiet# Using ts-node
npx ts-node src/index.ts --prefix ABC
# Or after building
node dist/index.js --prefix ABC --suffix XYZimport { VanityGenerator } from 'solana-vanity-ts';
const generator = new VanityGenerator({
prefix: 'Sol',
ignoreCase: true,
onProgress: (attempts, rate) => {
console.log(`${attempts} attempts, ${rate}/sec`);
}
});
const result = await generator.generate();
console.log(`Found: ${result.publicKey}`);
console.log(`Attempts: ${result.attempts}`);# Generate vanity address using solana-keygen grind
./scripts/generate-vanity.sh Sol
# Batch generate from file
./scripts/batch-generate.sh prefixes.txt
# Verify a keypair file
./scripts/verify-keypair.sh my-wallet.jsonSolana addresses use Base58 encoding (58 possible characters per position).
| Characters | Difficulty | Est. Time (8 cores) |
|---|---|---|
| 1 | 1 in 58 | Instant |
| 2 | 1 in 3,364 | < 1 second |
| 3 | 1 in 195,112 | ~2 seconds |
| 4 | 1 in 11,316,496 | ~2 minutes |
| 5 | 1 in 656,356,768 | ~2 hours |
| 6 | 1 in 38+ billion | ~4 days |
| 7+ | 1 in 2+ trillion | Weeks to months |
Note: Case-insensitive matching roughly doubles your chances for letter characters.
Times depend on your hardware. The Rust implementation typically achieves 50,000-100,000+ keys/second per thread.
solana-wallet-toolkit/
βββ rust/ # High-performance Rust implementation
β βββ src/
β β βββ main.rs # CLI entry point
β β βββ lib.rs # Library exports
β β βββ generator.rs # Core generation logic
β β βββ matcher.rs # Pattern matching
β β βββ output.rs # File output (Solana CLI format)
β β βββ security.rs # Secure memory handling
β βββ Cargo.toml
β βββ README.md
β
βββ typescript/ # Node.js implementation
β βββ src/
β β βββ index.ts # CLI entry point
β β βββ lib/
β β βββ generator.ts # Core generation logic
β β βββ matcher.ts # Pattern matching
β β βββ output.ts # File output
β β βββ security.ts # Security utilities
β βββ package.json
β βββ README.md
β
βββ scripts/ # Shell script wrappers
β βββ generate-vanity.sh # Single address generation
β βββ batch-generate.sh # Batch generation
β βββ verify-keypair.sh # Keypair verification
β βββ utils.sh # Shared utilities
β
βββ tests/ # Test suites
β βββ cli/ # CLI tests
β βββ integration/ # Cross-implementation tests
β βββ fuzz/ # Fuzz testing
β βββ stress/ # Stress tests
β
βββ security/ # Security documentation
β βββ SECURITY_CHECKLIST.md
β βββ audit-*.md
β
βββ docs/ # Documentation
β βββ cli-guide.md
β
βββ tools/ # Utility tools
βββ verify-keypair.ts
βββ check-file-permissions.sh
- Generate random Ed25519 keypair using
solana-sdk/@solana/web3.js - Get the public key (32 bytes)
- Encode as Base58 string (Solana address format)
- Check if address matches the pattern
- Repeat until match found
- Prefix: Check if address starts with the pattern
- Suffix: Check if address ends with the pattern
- Case-insensitive: Compare lowercase versions
Keypairs are saved in Solana CLI JSON format β a JSON array of 64 bytes:
- Bytes 0-31: Ed25519 secret key seed
- Bytes 32-63: Public key
[174,47,154,16,202,193,206,113,199,190,53,133,169,175,31,56,...]This format is compatible with solana config set --keypair and other Solana CLI tools.
| Feature | This Toolkit | solana-keygen grind | Others |
|---|---|---|---|
| Library | Official solana-sdk | Official | Varies |
| Languages | Rust, TypeScript, Shell | Rust | Varies |
| Multi-threaded | Yes | Yes | Some |
| Prefix/Suffix | Yes | Prefix only | Some |
| Case-insensitive | Yes | No | Some |
| Secure Permissions | Yes (0600) | Yes | Rarely |
| Memory Zeroization | Yes | Yes | Rarely |
| Dry Run/Estimate | Yes | No | Rarely |
| Library API | Yes | No | Some |
| Auditable | Yes | Yes | Varies |
# Run all tests
./run-all-tests.sh
# Rust tests
cd rust && cargo test
# TypeScript tests
cd typescript && npm test
# Integration tests
./tests/integration/test_keypair_validity.sh
./tests/integration/test_output_compatibility.shRust:
use solana_sdk::signer::keypair::Keypair;
use solana_sdk::signature::Signer;
// Generate random keypair
let keypair = Keypair::new();
println!("Address: {}", keypair.pubkey());
// Save to file (Solana CLI format)
let bytes = keypair.to_bytes();
let json = serde_json::to_string(&bytes.to_vec())?;
std::fs::write("keypair.json", json)?;TypeScript:
import { Keypair } from '@solana/web3.js';
// Generate random keypair
const keypair = Keypair.generate();
console.log('Address:', keypair.publicKey.toBase58());
// Save to file
const json = JSON.stringify(Array.from(keypair.secretKey));
fs.writeFileSync('keypair.json', json, { mode: 0o600 });All rights reserved. See LICENSE for details.
nich β @nichxbt β github.com/nirholas
- ethereum-wallet-toolkit β Similar toolkit for Ethereum
- Solana Documentation
- solana-sdk on crates.io
- @solana/web3.js on npm
- Ed25519 Specification
- Base58 Encoding
solana wallet rust typescript cli vanity-address keypair ed25519 private-key address-generator solana-sdk web3js cryptocurrency blockchain cold-storage offline-wallet air-gapped open-source educational
β Star this repo if you find it useful!
Educational tool for understanding Solana wallet mechanics
Solana Wallet Toolkit is deployed and accessible over HTTP via MCP Streamable HTTP transport β no local installation required.
Endpoint:
https://modelcontextprotocol.name/mcp/solana-wallet-toolkit
Add to your MCP client configuration (Claude Desktop, Cursor, SperaxOS, etc.):
{
"mcpServers": {
"solana-wallet-toolkit": {
"type": "http",
"url": "https://modelcontextprotocol.name/mcp/solana-wallet-toolkit"
}
}
}| Tool | Description |
|---|---|
get_sol_price |
Current SOL price |
get_solana_defi |
Solana DeFi protocols |
get_price |
Get crypto prices |
search_coins |
Search Solana tokens |
Current SOL price:
curl -X POST https://modelcontextprotocol.name/mcp/solana-wallet-toolkit \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_sol_price","arguments":{}}}'Solana DeFi protocols:
curl -X POST https://modelcontextprotocol.name/mcp/solana-wallet-toolkit \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_solana_defi","arguments":{}}}'Get crypto prices:
curl -X POST https://modelcontextprotocol.name/mcp/solana-wallet-toolkit \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_price","arguments":{"ids":"solana","vs_currencies":"usd"}}}'curl -X POST https://modelcontextprotocol.name/mcp/solana-wallet-toolkit \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'- SperaxOS - source for the MCP marketplace. The hosted marketplace is offline while hosting is being migrated.
- All 27 MCP servers β See the full catalog at modelcontextprotocol.name
Powered by modelcontextprotocol.name β the open MCP HTTP gateway
Full documentation site: https://nirholas.github.io/solana-wallet-toolkit/
- Getting started covers install and first run.
- Examples has copy-paste snippets.
If solana-wallet-toolkit saves you time, star it on GitHub. Stars are how other developers and AI agents find the repositories worth trusting, and they cost you one click.
Know someone who would use it? Post on X Β· Share on Bluesky Β· Share on LinkedIn Β· Submit to Hacker News Β· Share on Reddit
Coding agents and LLM tooling can read this repo directly: AGENTS.md, llms.txt, llms-full.txt. Point an agent at https://github.com/nirholas/solana-wallet-toolkit and it has the context it needs.
- All repositories by nirholas: the full catalog, grouped by topic
- three.ws: the platform for 3D AI agents with Solana wallets, a skill marketplace and x402 payments
- Questions or ideas: open an issue or start a discussion