Contents

Create your own Cryptocurrency Token (Solana)

I created my own crypto Token and I want to show you how to create your own - It only takes about 15-30 minutes.

Note
First of all, we are NOT going to create a cryptocurrency.
We are going to create a cryptocurrency Token.

If you want to learn more about the differences please check out my other post about basic Crypto Tokenomics.

Why should you create your own Token?

Custom Tokens can represent an investor’s stake in a business or they can serve an economic purpose like a payment instrument. As a token holder, you can use them as a means of payment, utility or trade them with other securities to make a profit.

But the reason we’re creating it is simply to better understand the process behind the blockchain technology - Learning by doing. And simply because it’s fun to learn something new in the world of cryptocurrencies.

Requirements

Workflow

Here is a short overview of what we’re going to do and to give you the bigger picture:

Set up your Solana Wallet

Let’s start with setting up your Solana Wallet first.

Before you begin
Make sure you have installed the Solana Command Line Tools.

MacOS & Linux

Open your Terminal and copy and paste the following command

1
sh -c "$(curl -sSfL https://release.solana.com/v1.9.3/install)"

Windows

Open PowerShell or a Command Prompt (cmd.exe) as an Administrator and copy and paste the following command

1
curl https://release.solana.com/v1.9.3/solana-install-init-x86_64-pc-windows-msvc.exe --output C:\temp\solana-install-init.exe --create-dirs
Release
Feel free to replace v1.9.3 with the release tag matching your desired release version, or just use any of the symbolic channel names: stable, beta, or edge.

Confirm you have the desired version of solana installed by entering:

1
solana --version

Generate a File System Wallet Keypair

1
solana-keygen new --outfile keypair.json
/create-your-own-cryptocurrency-token/generate-new-keypair.png
Generate a new Wallet Keypair.

The content of the keypair.json file looks like this:

1
[53,182,131,247,119,117,227,207,112,73,170,126,222,197,244,99,215,107,255,202,33,43,36,17,104,111,157,246,196,192,174,95,240,23,238,206,118,215,154,238,229,96,11,37,156,123,51,223,5,231,17,117,86,136,103,14,75,95,175,132,148,54,1,13]

It’s basically an array of 64 values, the first 32 represent the private key

1
2
3
private_key_bytes = [53,182,131,247,119,117,227,207,112,73,170,126,222,197,244,99,215,107,255,202,33,43,36,17,104,111,157,246,196,192,174,95]

public_key_bytes = [240,23,238,206,118,215,154,238,229,96,11,37,156,123,51,223,5,231,17,117,86,136,103,14,75,95,175,132,148,54,1,13]
Remember
Your keypair.json file is unencrypted. Do not share this file with others.

Remember, and as we learned in Hot and cold Crypto Wallet (Address), a wallet address like shown in the output above, is just a Base58Check Encoded Public Key Hash.

That’s why your wallet address 8mNvt36N7bW3vuWJ3pFDTSWFp2i7fD1MF8bv6mTFMj8f looks different than your public_key_bytes.

Set Solana Config

By default your RPC URL should be set to https://api.mainnet-beta.solana.com already but here is the command to verify it:

1
solana config get

If it’s not set to the Mainnet not you can set it with this command:

1
2
solana config set --url https://api.mainnet-beta.solana.com
solana config set --keypair keypair.json

Verify your Public Key (Optional)

You can also verify if your public key belongs to your key pair with the following command:

1
solana-keygen verify 8mNvt36N7bW3vuWJ3pFDTSWFp2i7fD1MF8bv6mTFMj8f .\keypair.json
/create-your-own-cryptocurrency-token/verify-public-key.png
Verify if your public key comes from this Keypair.

Import into your Phantom Wallet (Optional)

Copy the contents of your keypair.json and hit import on your Phantom Wallet.

/create-your-own-cryptocurrency-token/import-wallet.png
Import into your Phantom Wallet.

Top up your wallet

Let’s top up your wallet address you just created with some $SOLto cover the transaction fees.

/create-your-own-cryptocurrency-token/topup.png
Top up your Wallet.

If you imported your wallet address into Phantom you can check the balance there or you can use solana balance to check:

1
solana balance
/create-your-own-cryptocurrency-token/balance.png
Check your balance.

Create Token

Now that we have sent some $SOL to our wallet address we can start creating our actual Token Address, which we will later use to mint fresh Tokens and send them to our Token Account which we will also create in the same process.

Create Token and Token Account

1
spl-token create-token

Token Address: 2LTQripZZZXekBg5311zu4zdzKr7VwiQ81RzVL62S72q

/create-your-own-cryptocurrency-token/create-token.png
Create your Token.
1
spl-token create-account 2LTQripZZZXekBg5311zu4zdzKr7VwiQ81RzVL62S72q

Token Account: CB7WEx4wtFiy6ftJWbaSvBfw1pbxe3wq65DjEbWmGRve

/create-your-own-cryptocurrency-token/create-token-account.png
Create your Token Account.
Note
Your Token Account is associated with your Token Address.

Mint Token Account

We’re going to mint 1.000.000 tokens (out of thin air) with this token address 2LTQripZZZXekBg5311zu4zdzKr7VwiQ81RzVL62S72q and then going to send them to our token account CB7WEx4wtFiy6ftJWbaSvBfw1pbxe3wq65DjEbWmGRve.

1
spl-token mint 2LTQripZZZXekBg5311zu4zdzKr7VwiQ81RzVL62S72q 1000000 CB7WEx4wtFiy6ftJWbaSvBfw1pbxe3wq65DjEbWmGRve

Check your Token Account Balance

1
spl-token accounts
/create-your-own-cryptocurrency-token/token-account-balance.png
Token Account Balance.

Limit Token Supply

Let’s Limit your supply to prevent unlimited minting.

1
spl-token authorize 2LTQripZZZXekBg5311zu4zdzKr7VwiQ81RzVL62S72q mint --disable

Transfer token to a browser wallet

1
spl-token transfer --fund-recipient tokenAddress transferAmount recipientAddress
1
spl-token transfer --fund-recipient 2LTQripZZZXekBg5311zu4zdzKr7VwiQ81RzVL62S72q 1000000 F7tHkHNUkM2R3w2A6fyVDK29m9y8oNx851nhYoa4SuRp

Register your Token

To actually finish the creation of your Token we want to have it officially listed on the Solana Registry.

I am not going into details here, so feel free to check out my pull request at github.com/solana-labs/token-list for reference.

But basically the only details you need for your PR are:

1
2
3
4
"address": "2LTQripZZZXekBg5311zu4zdzKr7VwiQ81RzVL62S72q",
"symbol": "<yourTokenSymbol>",
"name": "<yourTokenName>",
"logoURI": "https://raw.githubusercontent.com/<yourLogoURI>.png",

Once your PR was merged you can see your token officiall listed on your Phantom wallet and the official solana.com registry (see solscan.io or Solana Explorer)

/create-your-own-cryptocurrency-token/token-listing.png
Token Listing

Summary

Okay, let’s summarize the whole thing again and show what we have done. We have created the following:

  1. We created a Wallet Address: 8mNvt36N7bW3vuWJ3pFDTSWFp2i7fD1MF8bv6mTFMj8f to be used as a so called Authority to fund the creation but also to mint our Token.
  2. We created a Token (Address): 2LTQripZZZXekBg5311zu4zdzKr7VwiQ81RzVL62S72q which is then associated to our Token Account: CB7WEx4wtFiy6ftJWbaSvBfw1pbxe3wq65DjEbWmGRve.
  3. In the end we registered our Token 2LTQripZZZXekBg5311zu4zdzKr7VwiQ81RzVL62S72q on the Solana Token Registry to make it available.

If you want to know how to create a secure wallet address, check out my post Create a secure and anonymous Crypto Wallet.