Solana: vanity token mints
Many Solana tokens are launched at a vanity mint address, like …pump. The mint address is a key pair like any other, and whoever ground it knows its private key. For a mint, that knowledge stops mattering the moment the mint is created.
Why
A mint is created by two instructions, signed by the payer and by the mint key:
ix 1 SystemProgram.createAccount new account: the mint address
owner: SPL Token or Token-2022
ix 2 InitializeMint2 mint authority: your walletThe mint key is needed only in the first one, because a new account must sign its own creation. Afterwards:
- The account is owned by the token program. The System program can no longer transfer its lamports, re-create it or assign it to another program, because those all require a System-owned account.
- The token programs never ask the mint account to sign. Minting, freezing and metadata are controlled by the mint authority and the freeze authority, which are your keys, not the mint's.
- Re-initialising fails: an initialised mint stays initialised.
So a copy of the mint key, the seller's or anyone's, can do nothing. This is why a pre-generated vanity mint key can be sold without long-term trust. It is not true for wallet addresses, whose key keeps full control forever; for those, see split-key.
Caveats
- Before creation, the address is not yet yours. Until you create the mint, anyone holding the key could create it first. Create the mint soon after you receive the key, and buy from a seller who deletes its copy at delivery.
- Token-2022 close authority. The
MintCloseAuthorityextension lets an authority close a mint with zero supply. A closed mint frees the address, and whoever holds the key could create a new mint there. If the address matters to you, do not set a close authority. The verify page shows it if one is set. - Launchpads. pump.fun-style launchpads create the mint for you from a key pair you supply. Afterwards the same rules apply.
Check it yourself
- Paste the mint address on the verify page, or open it in an explorer.
- The owner must be the SPL Token or Token-2022 program, not the System program.
- The mint authority (and freeze authority, if any) must be your keys.
- For Token-2022, no close authority should be set.
Status
The reasoning above follows from how the System and token programs check ownership and signers. We are publishing a devnet demonstration: it creates mints at vanity addresses and tries every move a holder of the mint key could make, and each must fail. Its results will be added here when it has run.