Skip to main content

How to Create a Custom Vanity Wallet Address on Solana

Updated on
Jun 17, 2026

7 min read

Overview

A Solana address is just the base58 public key of a keypair, and with a custom vanity wallet address you can make one that begins and ends with characters you choose. For example, the MetaDAO token mint METAwkXcqyXKy1AtsSgJ8JiUHwGCafnZL38n3vYmeta both opens and closes with meta. These vanity addresses are found by generating candidates over and over until one matches a chosen prefix, suffix, or both.

A recognizable address makes a project's token mint, treasury, or program easier to spot and trust at a glance. It reinforces a brand and helps users confirm they are interacting with the right account instead of a look-alike. The trade-off is the more characters you need, the longer the search takes.

What is Grinding?

Grinding is the brute-force process of generating a Solana vanity wallet address. A grinder creates a fresh keypair, checks whether its base58 address matches your target prefix or suffix, and repeats the cycle, often millions of times, until one matches. There is no shortcut, so the speed depends entirely on your tool and hardware.

This guide covers two ways to grind one. First you will use solana-keygen grind, the command built into the Solana CLI, which is the simplest path and needs nothing extra. Then you will use vanity, an open source, GPU-accelerated tool that grinds much faster and unlocks longer patterns.


TLDR
  • Grind a vanity address with the native solana-keygen grind command, no extra tooling required
  • Grind much faster (and find longer patterns) with the GPU-accelerated vanity tool
  • Cover the three ways to grind with vanity, a seed (grind), a keypair (grind-keypair), and a doppler keypair (grind-doppler), and learn when to use each one
  • Understand the key seed vs. keypair distinction and why it drives speed and safety

What You Will Do


  • Grind a vanity address with solana-keygen grind
  • Install vanity and grind a vanity seed, a vanity keypair, and a doppler keypair
  • Verify a grind result and learn which tool fits which use case
  • Follow wallet-safety best practices for the keys you generate

What You Will Need


Grind with Solana-Keygen

Prefer a video walkthrough? Follow along with Sahil and learn how to create a custom vanity address on Solana.
Subscribe to our YouTube channel for more videos!

solana-keygen has a grind subcommand that generates keypairs until one matches your search criteria. The --starts-with flag takes a PREFIX:COUNT value, so QN:1 means "find one address that starts with QN".

solana-keygen grind --starts-with QN:1

You should see a response like this:

Searching with 10 threads for:
1 pubkey that starts with 'QN' and ends with ''
Wrote keypair to QN...mgr.json

The matching .json file in your current directory is a standard Solana keypair file. You can set it as your default wallet, or load it in code:

solana config set --keypair ./QN...mgr.json

Each extra character makes the search exponentially harder, since base58 has 58 possible characters per position. In practice, two to five defined characters is a comfortable range for solana-keygen. Beyond that, you will want the GPU-accelerated vanity tool covered below.

Explore the Grind Options

Run the help command any time you need a reference:

solana-keygen grind --help

The most useful options are:


  • --starts-with PREFIX:COUNT finds COUNT keypairs whose address starts with PREFIX (for example, --starts-with QN:2 finds two).
  • --ends-with SUFFIX:COUNT matches a suffix instead.
  • --starts-and-ends-with PREFIX:SUFFIX:COUNT matches both ends at once.
  • --ignore-case makes the search case insensitive (it is case sensitive by default).
  • --use-mnemonic outputs a seed phrase instead of a keypair file. Expect a significant slowdown.
  • --num-threads <NUMBER> sets the number of grind threads.

Base58 only

A prefix or suffix must use base58 characters (A-Z, a-z, 0-9) excluding the easily confused ones: zero (0), capital i (I), capital o (O), and lowercase L (l).

Grind with Vanity

vanity is a high-performance grinder that runs on CPUs and GPUs. On a single RTX 4090 it searches well over a billion candidates per second, which makes longer patterns practical instead of theoretical.

Before you run it, you need to understand what it is actually producing.

Seeds vs. Keypairs

vanity can grind two fundamentally different things:


  • Seed: A short text string used with CreateAccountWithSeed. The address is derived as base58(SHA256(base + seed + owner)). It has no private key of its own. It is controlled by the base wallet that signs for it plus the owner program that owns the account.
  • Keypair: A real ed25519 keypair whose public key matches your pattern. The address can sign, just like any wallet.

This split drives both speed and safety. Seed grinding is pure SHA-256 hashing with no elliptic-curve math, so it runs roughly 20x faster than keypair grinding. Keypair grinding takes longer, but produces a private key.

Install Vanity

Install with Cargo. Pick the build that matches your hardware:

# CPU only (default)
cargo install vanity

# NVIDIA GPU (requires the CUDA toolkit / nvcc on the build machine)
cargo install vanity --features=gpu

# AMD, Intel, or Apple GPUs (requires an OpenCL 1.2 ICD loader and headers)
cargo install vanity --features=opencl

Grind a Seed

Use grind when the address belongs to something a program controls, such as a token mint, a stake account, or a program data account. The base (your signing wallet) and owner (the program that will own the account) are both baked into the derived address, so decide them before you grind. This example grinds a token mint owned by the SPL Token program:

vanity grind \
--base <YOUR_WALLET_PUBKEY> \
--owner TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA \
--prefix QN \
--num-gpus 1

The output reports the resulting address and a 16-character seed (shortened for clarity):

using 14 cpus, 1 gpus
target: QN | probability: 1.748728e-5 | expected: 57,184 attempts
cpu 6 match: QNey...qrGn; [122, ..., 73] -> zynnPwuquKefX73I in 0.003s; 6,862,657 attempts/sec
done: 34,459,020 attempts in 1s at 34,284,098 attempts/sec

Always confirm a result before you commit it onchain:

vanity verify --base <YOUR_WALLET_PUBKEY> --owner TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA --seed <SEED>

To use the seed onchain, pass it to create_account_with_seed; the derived address becomes the new account's to_pubkey.

Grind a Vanity Keypair

Use grind-keypair when the address itself needs to sign, such as a wallet you will transact from or a program ID. It produces a standard Solana keypair JSON array:

vanity grind-keypair --prefix QN --suffix qn

The output prints the public key, the seed (hex), and a Solana-compatible keypair JSON array (shortened for clarity):

using 14 cpus, 1 gpus
target: QN...qn | probability: 5.198358e-9 | expected: 192,368,424 attempts
gpu 0 match: QNg83...q5qn in 0.323s
pubkey: QNg83...q5qn
seed hex: 0132...36c4
keypair json (solana-compatible): [1, ..., 125]
done: 104,422,574 attempts in 17s at 6,117,490 attempts/sec

This is a private key

grind-keypair outputs a real private key. Never grind a keypair you intend to fund on hardware you do not control. A rented GPU or third-party grinding service has seen the private key, so treat any outsourced keypair as compromised.

Grind a Doppler Keypair

grind-doppler also produces a real, signable keypair, but it grinds for a different kind of match. Instead of a readable prefix, it looks for a public key whose raw bytes fit a shape that Solana programs can compare against using fewer compute units. The resulting address looks ordinary to a human; the benefit is purely about performance.

vanity grind-doppler --segments 1 --num-gpus 1   # find one cheaper-to-check key
vanity grind-doppler --segments 2 --num-gpus 1 # stricter match, much rarer to find

The result prints the keypair (with Solana-compatible JSON array, same as grind-keypair) plus a per-segment breakdown including the assembly .equ constants for each segment (shortened for clarity):

using 14 cpus, 1 gpus
doppler: >= 1 sign-extendable 32-bit segment(s) | probability: 9.313226e-10 | expected: 1,073,741,824 attempts
gpu 0 match: CSvy...YFYHy in 0.398s
pubkey: CSvy...YFYHy
seed hex: 4f92c...f09d
keypair json (solana-compatible): [79, ..., 52]
doppler: 1/4 sign-extendable segment(s)
seg 0 (bytes 0-7): imm32 -904391254 (0xca1815aa) => .equ EXPECTED_KEY_0, 0xca1815aa
seg 1 (bytes 8-15): 0xcd61910e9f5edb4e (not sign-extendable) => .equ EXPECTED_KEY_1, 0xcd61910e9f5edb4e
seg 2 (bytes 16-23): 0x91f8ae8d74e04ddf (not sign-extendable) => .equ EXPECTED_KEY_2, 0x91f8ae8d74e04ddf
seg 3 (bytes 24-31): 0x3423fa148de6ec68 (not sign-extendable) => .equ EXPECTED_KEY_3, 0x3423fa148de6ec68
done: 16,085,250 attempts in 6s at 2,672,178 attempts/sec

When a program hardcodes a specific public key and checks incoming accounts against it (for example, an access-control gate that only lets a known admin account through), it has to load that 32-byte key and compare it on every call. A grind-doppler key is structured so that part of that load is cheaper, which lowers the compute cost of each comparison. The --segments flag (1 to 4) controls how much of the key gets this treatment: more segments means a bigger saving but an exponentially longer grind.

This only matters when onchain compute is a real constraint, such as a heavily used program where every compute unit per instruction counts. For a normal wallet, token mint, or one-off program, it buys you nothing over grind-keypair, so reach for it only when minimizing compute is a deliberate goal.

Common Vanity Options

These flags apply across the grind modes:

FlagApplies toDefaultMeaning
--num-cpus <N>all0 (all logical cores)CPU mining threads
--num-gpus <N>all (GPU builds)1GPUs to mine on
--count <N>all1stop after finding N matches
--case-insensitivegrind, grind-keypairoffmatch ignoring case
--prefix / --suffixgrind, grind-keypairnonebase58 target(s); supply at least one
--segments <1-4>grind-doppler1sign-extendable segments required

Choose the Right Tool

Use this quick decision guide to pick a mode:

Your goalUse
A short two-to-five character pattern with zero extra setupsolana-keygen grind
A readable address that needs to sign, like a wallet or program IDvanity grind-keypair
A nice pattern on an address controlled by a wallet or program, like a token mint, stake account, or program-owned account (fastest, and the only one safe to outsource)vanity grind
Cheaper onchain key comparisons inside a heavily used programvanity grind-doppler

Staying Secure

However you generate a wallet, follow wallet-safety best practices. Keep keypair files out of version control, never paste a private key or seed phrase into an untrusted tool, and remember the seed-versus-keypair rule: a grind seed is safe to share, but a grind-keypair private key is not. For a deeper primer, see our Introduction to Crypto Wallets and How to Keep Them Secure.

Wrapping Up

You now have two ways to grind a Solana vanity address and, more importantly, the knowledge to choose between them. solana-keygen grind gets you a short pattern in seconds with no extra tooling, while vanity unlocks the speed and longer patterns that real mints and wallets call for.

Frequently Asked Questions

What is a Solana vanity address?

A vanity address is a Solana address that contains a chosen prefix or suffix, such as one starting with 'QN'. It is found by generating candidate addresses repeatedly until one matches the pattern. The matching is brute force, so each additional character makes the search exponentially slower.

What is the difference between solana-keygen grind and the vanity tool?

solana-keygen grind is built into the Solana CLI, runs on your CPU, and is the simplest way to find short patterns of two to five characters. The vanity tool is GPU-accelerated, searching well over a billion candidates per second on a single high-end GPU, which makes longer patterns practical. It also adds seed grinding and doppler keypairs that solana-keygen does not offer.

Should I grind a seed or a keypair?

Grind a keypair (grind-keypair) when the address itself must sign, such as a wallet or a program ID. Grind a seed (grind) when the address is controlled by a wallet or program, such as a token mint, stake account, or program-owned account. Seed grinding is about 20x faster because it is pure SHA-256 hashing with no elliptic-curve math.

Is it safe to grind a vanity address on a rented GPU?

A seed from grind is public and grants no control, so it is safe to outsource by sharing only your public key. A keypair from grind-keypair contains a private key, so grinding it on hardware you do not control means the private key was potentially exposed.

Why does grinding a longer prefix take so much longer?

Base58 uses 58 possible characters per position, so the number of addresses you must search grows by roughly 58x for each additional character you constrain. A two-character prefix is found almost instantly, while a nine-character prefix can take an impractical amount of time on a CPU. This is why longer patterns need GPU acceleration.

What is grind-doppler used for?

grind-doppler produces a signable keypair whose raw public-key bytes contain sign-extendable 32-bit segments. It is a niche optimization for authors of hand-tuned sBPF programs that hardcode and compare against an expected key, where each sign-extendable segment saves a compute unit per comparison.

Resources


We ❤️ Feedback!

Let us know if you have any feedback or requests for new topics. We'd love to hear from you.

Share this guide