How to create your own Solana Token

Anton
7 min readMar 20, 2022

--

Today I want to write about something really cool, I created my own crypto currency on the solana Blockchain. I always wanted to know how this stuff works and today i am gonna walk you trough, it took me some time but the insights I got where pretty nice.

First of all you need:

  • a litte bit of solana (like a couple of cents)
  • a linux machine
  • and a bit of your time

So you need a linux machine, would reccomend a virtual machiene like vm ware or virtualbox and just run the latest version of ubuntu on that.

I wish I knew that before, could have saved me a lot of time. First I tried the free AWS cloud server and installed ubuntu, second I created a digital ocean server, both of them did not work. After some research I found out that there might be not enough ram on the cloud servers, but enough of that for now.

Okay, when you have your linux machine up and running open up your command line. The first thing we need to install is solana tools.(latest version here)

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

Then you need to exit your command line and open it up again (so the paths set up correctly). After you installed solana tools we need to create a solana command line wallet.

solana-keygen new

Set a password if you want. Save your public key somewhere and if you want, your path to your private key and very important your seed phrase. The next step is to send solana to your command line wallet, I used coinbase the minimum you have to send here is 0.05 solana. I send like 5$ and it worked just fine. So just go to send solana in your exchange and put your pubkey as recieving address, should be there seconds later. You can check your balance as seed below wit the command solana balance. You need a tiny bit of solana to create your token, account and to mint the coins.

If you are like me and you created a wallet and send $SOL to it and then you realized that your machine has not enough ram and you have to start over i can show you how to recover your wallet.

Open the new machine istall solana tools again and the use the command

solana-keygen recover ASK

This will ask for your seed phrase and your password you set earlier after that you are ready to continue.

Nextup we need to install some sofware, I am just gonne put them below follow them command for command. The first thing is rust you can check if there is a new version here.

curl — proto ‘=https’ — tlsv1.2 -sSf https://sh.rustup.rs | sh

exit and reopen command line

sudo apt install libudev-dev

sudo apt install libssl-dev pkg-config

sudo apt install build-essential

cargo install spl-token-cli

The last command will take the longest, for me it was around 20 minutes if everything went well and you got no errors (this is where you know if your machine can handle it or if you have to use a different machine), your are ready to go.

Now lets create our token

spl-token create-token

Thats it, super easy and from this moment you are technically part of the solana blockchain, thats amazing right? Save your token address we need that in a moment. Nextup we need to create a account for our token:

spl-token create-account “tokenadress”

Save your account id. If you check your solana balance you will see that you have a bit less solana than before. Now we have a token address and an account, lets mint some tokens now (minting=creating). Use the command below without the “ “

spl-token mint “tokenaddress” “how many tokens” “accountid”

You can check if everything worked and have a look at your account:

spl-token accounts

Now if we want to transfer the tokens to another wallet, we need a wallet that can hold solana tokens, I used my Phantom wallet.

spl-token transfer — fund-recipient — allow-unfunded-recipient “tokenaddress” “numberofcoinstosend” “walletid”

I dont know why medium ist doing this but it os converting 2 of these “-” into one of these “ — “ so keep that in mind 2 x “-” before the fund and the allow instead of a long one haha.

The “ — fund-recipient — allow-unfunded-recipient” is neccecary beacause you need to pay the fees for sending a token you created so the wallet can recive it.

Now you can visit solscan.io and you can lookup your token.

I created 10 million tokens as you can see and i send 1 million of them to my phantom wallet as you can see on the bottom of the picture. I think thats pretty cool :). The next thing is we want to name youre token it seems a bit complicated but I can walk you though it ;).

So first we want a logo for our Token, I used one of my MagigicMushroomClubhouse NFT’S, but it really dosent matter what you use as longe as the image itself is smaller than 200kb. I resized my image to be 80x80 px, you can use this online tool for that. Save the image and continue.

Open up github if you dont have an account register for one we will need it. Open up a new repository, give it a name and upload your .png file. Now select your image and click on download and copy the link from your browser, it should look like this: https://raw.githubusercontent.com/Anditon/crypto/main/solanacoin.png. Save this link somewher or just leave the site open.

Now open op the solana token list on github https://github.com/solana-labs/token-list. Once you are there click on “fork” in the top right corner. Forking is like making a copy of the solana lab token list.

After doing so you can hit the period butten and the VS studio should open.

Should look something like this, first go to assets and create a new folder and you post your token address in there. After that right click your folder and click on upload, to upload your .png file.

When this is done you need to open the solana.tokenlist.json. It is a very large file, in this file is every solana token ther is until this moment.

If you want to you can hit control+f to search for tokens, if you search for Anditon you can find my token. You can copy my token as template for your token and paste it to the bottom of the list be careful with the syntax. It should look like this.

For the address you put your token address, the symbol will be the short version of your coin for example $BTC for bitcoin. The name should be your name for your token ;) and for logoURI you paste your github link of your picture you uploaded in your repository from earlyer. When you have no errors, can be seen in the bottom left corner then you click on the source control button on the left, there should be a 2 next to it. Add a message on the top like “adding tokenname to the list” and click on the checkmark over it.

Go back to the solana github page, click on “pull request” and then on”New pull request” and compare accross forks, chose your fork you created as head repository. Click on create pull request, when everything worked fine it should say “able to merge”

From this point on it is a waiting game because the solana repository has to accept your changes, in my case it took like 2 hours. But when everything is finished you can check on solscan.io if it worked my page now looks like this.

Such a cool feeling to be part of the solana blockchain now. I dont really have a use case for the coin but now i can send it to friends and brag about having my own coin haha. It was a fun project maby I will extend this project if I find a usecase maby for a onlineshop or something else. I am by far not an expert but feel free to contact me, maby I can help or we can just chat a bit ;). Not a native english speaker so dont go too hard on me. Stay tuned for more projects in the future and let me know what you think about this article. Also visit my blog anditonblog.com.

Thank you,

Bye ;)

1.391 words

--

--

Anton
0 Followers

Personal Trainier who loves tech and the internet