Create Your Own Solana Token

Vishal_Saroj999
6 min readFeb 21, 2024

--

Solana, a prominent blockchain known for its AI integration and EVM compatibility, has seen massive growth thanks to its vibrant community and diverse features. While the 2021 NFT boom was a significant contributor, Solana’s journey extends beyond that. In 2024, exciting advancements like Token Extensions and Firedancer, alongside a thriving ecosystem of over 1200 projects, solidify its position as a major player in Web3. This course empowers aspiring developers to mint tokens, contribute to existing projects, and explore the vast potential of this ever-evolving blockchain.

Course overview

  • Demystifying Solana
  • Craft Your Own Coin
  • CLI
  • Deployment on Solana Devnet

Prerequisites

Solana Ecosystem

What is Solana?

Solana has transcended its 2017 origins to become a leading Web3 platform. This open-source project, now stewarded by the Geneva-based Solana Foundation, empowers developers to build decentralized applications (dApps) at unrivaled speed, scale, and affordability. Its unique architecture and innovative features like proof-of-history consensus and Solana Virtual Machine (SVM) position it as a major player in shaping the future of Web3.

While Solana still boasts impressive transaction speeds and lower fees, its 2021 boom has subsided. Recent congestion events expose scalability challenges, and fees fluctuate based on network activity. However, developments like Token Extensions and a thriving ecosystem of over 1200 projects showcase its evolution beyond just “fast and cheap.” As Solana navigates these challenges and builds a robust ecosystem, its ability to maintain its competitive edge in the ever-changing blockchain landscape remains to be seen.

What is Proof-of History?

Imagine a historical record that proves events happened in a specific order, and you have Proof-of-History (PoH)!.

It’s like a cryptographically secure clock for a blockchain, ensuring transactions are ordered accurately without needing tons of energy. PoH helps blockchains run faster and cheaper.

Why we need Rust?

Solana chose Rust for its speed, security, and concurrency features. Rust’s lack of garbage collection ensures efficient operations, while strong memory safety helps prevent security vulnerabilities in smart contracts. Its ability to handle concurrent transactions smoothly is crucial for Solana’s high processing speed, and its active developer community fosters innovation within the platform. However, remember the learning curve before diving in!

Note: You can learn more about rust .

Setting Up Your Environment

1 -> Install Rust.

  • Go to https://rustup.rs/
  • Download the setup or curl it according to your requirement
  • Open the setup and follow the on-screen instruction and install the setup

2 -> Install Solana Tool Suite

Note :- To start building on Solana, follow this simple guide: install Rust by following the official CLI instructions on their website. Next, download and install VS Code. While optional, installing the C++ Build Tool extension in VS Code can improve compatibility. Finally, open your terminal and run cargo — version to confirm everything is set up correctly. Remember, following the official instructions is key for a smooth ride!

then run solana — -version and you will get a output like this if you have installed the Solana tool suite correctly.

Congratulations, We are now ready to code and build your own SPL token 👍🎉

Using SPL-CLI

Time for the fun part: creating your token! It’ll be a breeze — think 5–10 minutes, way easier than setting up the environment (we all know that struggle!).

Ready? Open your terminal and paste this command:

cargo install spl-token-cli

This installs the necessary tool to build your token magic on Solana Devnet. Let’s dive in!

After putting this cmd:

solana-keygen new — no-outfile

You will see something like above screenshot

Note: Leave the BIP39 passphrase empty and press enter if you don’t have your own passphrase.

Since we have created our Solana wallet, let’s set our network configuration to Devnet using the following command:

solana config set — url https://api.devnet.solana.com

To check if our network is configured with the devnet, use the following command,

solana config get

Now, we need some testnet SOL to pay for the transaction fees on the network and we can use the following command to get some FREE SOL.

solana airdrop 1

This command will transfer 1 SOL to the wallet you will have just created using the CLI.

To check your Solana wallet balance, use the following command:

solana balance

Pheww!!!

Now it’s time to deploy our token on $olana Devnet excited!!

Deploying our SPL Token and Mint It

This would be our course final part ….

SPL token is not the name of the token but it is a token standard used by the Solana ecosystem like ERC-20 for Ethereum.

Let’s begin with token creation

Using following cmd you are able to create a token yes u heard right!!

Just a single cmd…

spl-token create-token

After creating a token u will receive an address of token with a signature (Transaction Hash).

Copy that token address we will use it further.

Before minting the token, we need to create an account to store the token as Solana blockchain doesn’t have storage by default. Hence we will manually assign storage for our token.

Use the following command to create a account:

spl-token create-account <token-address>

Replace <token-address> with your token address (i.e CZV6zGkQj81YX6RScA8hqZ4JmcChyLVM9jKvxbTPYZBS)

Now it’s time to minting the token use following cmd :

spl-token mint <token-address> <token-amount>

Replace the <token-address> with your address and <token-amount>

With how many tokens u want to mint (Create) . Mine was 1000.

Congratulations 🎉 !! we have successfully created and deployed SPL token to Solana Devnet.

Let’s check our newly created token on the Solana devnet explorer

Final Note: As you can see, we have our token deployed on the devnet of Solana Blockchain and the name of the token is showing as “Unknown Token” because in case of SPL tokens, you need to pull the SPL token repository of Solana and add your token to the list for the Solana blockchain to recognize its name and symbol.

For the devnet, we don’t have an option to add our token to the list but you can replicate this process for the mainnet and update the official SPL token list.

To deploy on the mainnet you just need to change solana config line to,

solana config set — url https://api.mainnet-beta.solana.com

and also, you need to buy and transfer the Solana wallet you create to pay for the transaction as mainnet does not have a faucet for you get FREE SOL.

Thank You !!!! Keep Building 🙂

Solana Hackathon.io CryptoCurrency

--

--