Categories
Blockchain Code

how to create a vanity Solana wallet

Solana lets you create wallets with custom first or last characters. For instance, maybe you want your wallet to start with mint or bank or fud. You can do this via the Solana CLI (Command Line Interface).

If you just want the code, it’s:

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

And then decode the result in python with:

base58.b58encode(bytes(json.load(open('thelongtextstringofyourwallet.json'))))

A little more detail.

You’ll need to first install a few things if you don’t already have them on your computer. This can be time-consuming, but Google is your friend if you find any issues.

  1. Install the Solana Tool Suite.
  2. I’m also assuming you have python3 installed.

That may take you a while. I have an M1 Mac, and ran into a few issues and wound up scrolling through StackOverflow answers; it probably took me an hour. But then you have Solana Tools installed, and you can do a lot of interacting with the Solana blockchain then.


Once you have python and Solana CLI installed, open your favorite command line tool (I love and use Nova, but wind up in OS X’s Terminal sometimes too) and type:

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

Replace “mint” with whatever you want your wallet ID to start with. So if you want to start with FUD, you’d write solana-keygen grind –starts-with fud:1 and run that.

This is a time-intensive command. On my newer M1 Mac, 3 characters will take seconds, 4 characters can take an hour, 5 characters can take 10-14 hours, and anything more you’d need to run on a borrowed server. (This guy outlines how to do that – it costs -, and 6 characters took the server 2 hours. He estimates 7 would take 10 days).

You could also use –ends-with: if you wanted, either in addition to or instead of –starts-with:. I wouldn’t recommend adding both, as it can take a very long time then. Choose a starts with or ends with.


Once you run that command in your command line, you’ll start seeing the status in your terminal like this:

I usually leave my computer alone during this time, as even on my newer Mac it slows the computer down noticeably.

When it completes, you’ll see something like this:

Wrote keypair to mintjpsrojqN3CYwN22TjjUhqbhhhiokrpWqW2hJjcF.json

Congrats! You’ve just written a new Solana wallet to your computer. The string before .json is your wallet ID. But how the heck do you interact with it from a wallet app like Phantom or Slope?!

If you’re knowledgable on decoding base58 with other tools, like ruby or whatever you prefer, do that here. If you’re not, here you go.

Not too tough! Since you installed python earlier, here’s the commands to run, one at a time:

python3
import json
import base58
base58.b58encode(bytes(json.load(open('mintjpsrojqN3CYwN22TjjUhqbhhhiokrpWqW2hJjcF.json'))))

Note, if this gives an error of No module named ‘base58’ then you’ll need to install base58. On OS X or Linux you can do that with:

pip install base58

Replace that last wallet string with the one you received in the keygen grind. You’ll get a fairly instant result of:

b'areallylongtextstringthatisyourprivatekey'

DO NOT SHARE THAT PART WITH ANYONE.

DO NOT SHARE THAT PART WITH ANYONE.

DO NOT SHARE THAT PART WITH ANYONE.

The string of characters in between the quotes (areallylongtextstringthatisyourprivatekey in the example above) is your private key for the new wallet. Anyone who has that has FULL, COMPLETE ACCESS TO YOUR WALLET and can do anything they’d like with it. You cannot change it, and if you ever publish that key… best to stop using that wallet forever.

So basically, DO NOT SHARE THAT WITH ANYONE.

What you will do with it is go into Phantom, or Slope, or whatever Solana wallet you like, and go to add a new wallet. Choose the “import private key” option and paste that private key character string in there.

You’ve now created a vanity wallet AND have it imported into your wallet app! Congrats!


FoxyDev from the Famous Fox Federation helped me figure this out the first time I did it, and you should totally get a fox.

Leave a Reply