Overview
Have you ever wondered how some Solana wallet addresses feature custom prefixes or suffixes (e.g., DUSTawucrTsGU8hcqRdHDCbuYhCPADMLM2VcCb8VnFnQ)?
These aren’t random—they’re crafted using Solana’s CLI tools! In this guide, you’ll learn how to generate a personalized vanity wallet address using the solana-keygen grind command.
👉 Discover advanced wallet customization tips
Prerequisites
- Command-line terminal (e.g., Terminal, PowerShell)
- Solana CLI installed
Step 1: Project Setup
Create a project directory:
mkdir custom-wallet cd custom-walletVerify Solana CLI installation:
solana --versionUpdate Solana CLI if needed:
solana-install update
Step 2: Using Solana-Keygen
The solana-keygen tool generates keypairs with customizable addresses. Key commands:
solana-keygen [OPTIONS] <SUBCOMMAND>Generate a Vanity Address
Use the grind subcommand to search for specific address patterns:
solana-keygen grind --starts-with a23:1Output:
Wrote keypair to a23...mgr.jsonThis creates a wallet starting with a23 and saves the private key to a .json file.
Customization Options
| Option | Description | Example |
|---|---|---|
--starts-with PREFIX:COUNT | Finds addresses starting with PREFIX | --starts-with sol:2 |
--ends-with SUFFIX:COUNT | Finds addresses ending with SUFFIX | --ends-with ana:1 |
--starts-and-ends-with PREFIX:SUFFIX:COUNT | Combines prefix and suffix | --starts-and-ends-with quick:node:3 |
--ignore-case | Case-insensitive search | --starts-with ABC --ignore-case |
--use-mnemonic | Generates a seed phrase (slower) | --use-mnemonic --word-count 24 |
👉 Optimize your Solana wallet security
Step 3: Advanced Example
Generate a 24-word Japanese mnemonic wallet starting with A and ending with M:
solana-keygen grind \
--starts-and-ends-with A:M:1 \
--ignore-case \
--use-mnemonic \
--word-count 24 \
--language japanese \
--no-outfile \
--no-bip39-passphraseOutput:
Found matching key: Address: A...M
Seed Phrase: そら まど あじ あう ...Best Practices
- Avoid overly complex patterns (e.g.,
123456789takes hours to compute). - Secure your seed phrases: Never share
.jsonfiles or mnemonics. - Use BIP39 passphrases for added security (except with
--no-bip39-passphrase).
FAQ
1. How long does it take to generate a vanity address?
- 3–5 characters: Seconds to minutes.
- 6+ characters: Hours or longer (depending on hardware).
2. Can I use special characters in prefixes?
- No. Only Base58 characters (A-Z, a-z, 0-9, excluding
0,I,O,l).
3. Is a vanity address less secure?
- No. Custom addresses use the same cryptographic security as random ones.
4. How do I import a generated keypair?
const keypair = Keypair.fromSecretKey(
Uint8Array.from(JSON.parse(fs.readFileSync('a23...mgr.json')))
);Final Notes
- Explore Solana Name Service (SNS) for human-readable
.soldomains. - Share your custom wallet on Twitter or Discord!
For feedback or topic requests, contact us.
🚀 Happy grinding!