Search Beautiful Address, Its Private Key and Seed Phrase on Solana Blockchain

Advanced Solana users can generate beautiful addresses starting from any word like 'mycoin....' or ending with any word or starting and ending. Here how to do this

From here https://solanadev.blogspot.com/2020/12/vanity-addresses-in-solana.html

 

1. Install solana-cli

https://docs.solana.com/cli/install-solana-cli-tools

 

2. Search Solana address starting with any word

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

this means find 1 public and private key where public key (address) starts from word 'you'.

It took less then 1 minute to find such address in my Core i5.

In result you get .json file with numbers that represent private key. You can use it via solana-cli or also you can import it to online wallets like sollet.io (see 5).

 

3. Search Solana address and mnemonic phrase

Note: mnemonic phrase you will get with solana-keygen is not the same as you use for sollet.io. So if you use this mnemonic in sollet.io you will get extremely different address.

solana-keygen grind --ignore-case --use-mnemonic --word-count 24 --starts-with you:1

First it will require BIP39 passphrase. Press enter if you do not need passphrase.

This will put .json file that contains key pair and also will display in terminal its mnemonic phrase of 24 words (there are also other parameters, use 'solana-keygen grind --help' ).

Mnemonic you get can be used only in solana-keygen for recover key pair like this:

solana-keygen recover

paste mnemonic
paste passphrase if you used

Restore wallet with this mnemonic in sollet.io will not give you the same address. So this mnemonic is for recover in solana-cli only. I try to find possible way to use it in sollet.io

 

4. Search Solana address starting and ending with words you like

solana-keygen grind --starts-and-ends-with youni:ni:1

 

5. Import Solana private key to online wallets sollet.io, solflare

We only recommend to use solana-cli or at least hardware wallets when use online tools. For trading it is useful to import your wallet to sollet.io.

0) Create new wallet in sollet.io, and only after that you will be able to import wallet by key pair (instead of mnemonic phrase).

1) Check the .json file contains your key pair like: [12,79,4,180...,16,22]

2) Convert it to Base58 with my python script like this:

wget https://gitgud.io/youni/solana_user_tools/-/blob/master/base58.py

chmod +x base58.py

./base58.py yousolanaaddress.json

privkey:
[12,79,4,180...,16,22]
b't60gbd50TrtiQdYJ'gh39gnkjGOWER36gKWO677'

where 'yousolanaaddress.json' is the name of your key pair file, usually solana-keygen puts filename that contain address.

You will get string like b't60gbd50TrtiQdYJ'gh39gnkjGOWER36gKWO677'. Use string between apostrophes for import to sollet.io.

 

listing of base58.py

$ cat base58.py 

#!/usr/bin/python3

# Convert key pair to Base58 private key
# Usage:
#    base58.py filename
#        where filename is keypair file

import sys
import base58

file_name = sys.argv[1]
privkey = open(file_name, 'r').read()

print('Keypair:\n'+privkey)

line=privkey.replace('[', '').replace(']', '')
l=list(line.split(','))
lst=[int(x) for x in l]
lst_b=bytes(lst)

print('Privkey:',base58.b58encode(lst_b),sep='\n')
#print(base58.b58encode(bytearray(lst))) #2024-03-13 does not work

 

 

6. Extra: Full solana-keygen documentation

solana-keygen-grind

Grind for vanity keypairs

USAGE:
    solana-keygen grind [FLAGS] [OPTIONS]

FLAGS:
    -h, --help           Prints help information
        --ignore-case    Performs case insensitive matches

OPTIONS:
    -C, --config <FILEPATH>
            Configuration file to use [default: /root/.config/solana/cli/config.yml]

        --ends-with <SUFFIX:COUNT>...
            Saves specified number of keypairs whos public key ends with the indicated suffix
            Example: --ends-with ana:4
            SUFFIX type is Base58
            COUNT type is u64

        --starts-and-ends-with <PREFIX:SUFFIX:COUNT>...
            Saves specified number of keypairs whos public key starts and ends with the indicated perfix and suffix

            Example: --starts-and-ends-with sol:ana:4
            PREFIX and SUFFIX type is Base58
            COUNT type is u64

        --starts-with <PREFIX:COUNT>...
            Saves specified number of keypairs whos public key starts with the indicated prefix
            Example: --starts-with sol:4
            PREFIX type is Base58
            COUNT type is u64

 

 

7. Links

1. Solana User Tools https://gitgud.io/youni/solana_user_tools/

2. Sollet.io https://sollet.io

Section
Category