Market Cap: $3.6315T -1.300%
Volume(24h): $133.5557B -36.440%
Fear & Greed Index:

51 - Neutral

  • Market Cap: $3.6315T -1.300%
  • Volume(24h): $133.5557B -36.440%
  • Fear & Greed Index:
  • Market Cap: $3.6315T -1.300%
Cryptos
Topics
Cryptospedia
News
CryptosTopics
Videos
Top Cryptospedia

Select Language

Select Language

Select Currency

Cryptos
Topics
Cryptospedia
News
CryptosTopics
Videos

What is the difference between permissioned and permissionless blockchains?

Creating a token on Solana is fast and low-cost using SPL, with tools like CLI or Web3.js to deploy and manage supply on devnet before going live.

Aug 03, 2025 at 07:56 pm

Understanding the Basics of Solana Token Creation

Creating a token on the Solana blockchain has become increasingly popular due to the network’s high throughput, low transaction fees, and developer-friendly ecosystem. Unlike Ethereum, where gas fees can be prohibitive, Solana enables developers to deploy tokens with minimal cost and maximum efficiency. The Solana Program Library (SPL) provides a standardized framework for creating fungible and non-fungible tokens, similar to Ethereum’s ERC-20 or ERC-721 standards. When you create a token using SPL, it becomes compatible with wallets like Phantom and exchanges that support SPL tokens.

To begin, you must understand that every token on Solana is associated with a mint address, which uniquely identifies the token type. This mint address is generated during token creation and cannot be altered. Each wallet that holds the token has an associated token account, which stores the balance. These token accounts must be initialized before receiving tokens, and they require a small amount of SOL to cover rent exemption.

Setting Up Your Development Environment

Before creating a token, ensure your development environment is properly configured. You will need Node.js installed on your machine, preferably version 16 or higher. After installing Node.js, use npm to install the Solana Web3.js library, which allows interaction with the Solana blockchain.

  • Install the Solana CLI toolkit by running sh -c "$(curl -sSfL https://release.solana.com/stable/install)"
  • Confirm installation with solana --version
  • Install Web3.js using npm install @solana/web3.js
  • Generate a new Solana wallet using solana-keygen new --outfile ~/.config/solana/devnet.json
  • Airdrop SOL to your wallet with solana airdrop 2 --url devnet

Ensure you are connected to devnet for testing. The command solana config set --url devnet sets the network. Your wallet’s public key can be viewed using solana address. This key will be used as the authority for your token.

Creating Your SPL Token Using Command Line

The Solana CLI offers a straightforward way to create a token without writing code. Using the SPL Token CLI, you can deploy a new token in seconds. First, install the token tool:

  • Run npm install -g @solana/spl-token-cli
  • Create a new token: spl-token create-token --fund-raising --decimals 9

This command generates a new mint address and funds the mint authority. The --decimals 9 flag sets the token’s divisibility, meaning 1 token equals 1 billion smallest units (similar to 1 ETH = 10^18 wei). You can customize the supply by minting tokens to your wallet:

  • spl-token create-account [MINT_ADDRESS]
  • spl-token mint [MINT_ADDRESS] 1000000

These commands create a token account linked to the mint and issue 1 million tokens to it. The mint authority remains with your wallet unless you revoke it using spl-token authorize [MINT_ADDRESS] mint --disable.

Building a Token with JavaScript and Web3.js

For developers who prefer programmatic control, creating a token via JavaScript offers more flexibility. Begin by importing the necessary modules:

import { Connection, Keypair, PublicKey } from "@solana/web3.js";
import { createMint, getOrCreateAssociatedTokenAccount, mintTo } from "@solana/spl-token";

Establish a connection to devnet:

const connection = new Connection("https://api.devnet.solana.com", "confirmed");
const wallet = Keypair.fromSecretKey(Uint8Array.from([...]));

Create the mint:

const mint = await createMint(
connection,
wallet,
wallet.publicKey,
null,
9
);

The third parameter is the mint authority, and the fourth is the freeze authority (set to null to disable freezing). Next, create a token account:

const tokenAccount = await getOrCreateAssociatedTokenAccount(
connection,
wallet,
mint,
wallet.publicKey
);

Finally, mint tokens:

await mintTo(
connection,
wallet,
mint,
tokenAccount.address,
wallet,
1000000000000
);

This script creates a token with 9 decimals and mints 1 trillion units to your wallet. The mint address will be logged in the console and can be used to verify the token on explorers like Solana FM.

Distributing and Verifying Your Token

After creation, distribute your token by sharing the mint address with recipients. They can create associated token accounts using Phantom or Solflare. To verify your token on Solana FM:

  • Navigate to https://solana.fm
  • Paste the mint address into the search bar
  • View token metadata, supply, and holder distribution

If you wish to add a logo or name, use the Solana Token List repository on GitHub. Fork the repo, add your token’s metadata in the appropriate JSON format, and submit a pull request. Once merged, wallets like Phantom will display your token’s logo.

Transferring tokens requires the recipient’s wallet address and their associated token account. Use the CLI:

  • spl-token transfer [MINT_ADDRESS] [RECIPIENT_WALLET] 100 --fund-recipient

Or use Web3.js transfer() function. Ensure the recipient’s account exists or use --fund-recipient to auto-create it.

Common Pitfalls and Best Practices

One common mistake is losing access to the mint authority. If you disable minting without saving the key, no more tokens can be issued. Always back up your keypair. Another issue is forgetting to fund token accounts. While the mint account requires SOL for rent exemption, associated token accounts also need a small balance.

Avoid using the same keypair for multiple projects. Generate a new one for each token to isolate risk. Test all operations on devnet before deploying to mainnet. Monitor transaction confirmations using solana confirm [SIGNATURE].

When minting large supplies, consider the economic model. Unlimited minting can lead to inflation unless governed by a DAO. Use multi-signature wallets for team-controlled mints to prevent unilateral decisions.

Frequently Asked Questions

Can I change the number of decimals after creating a token?

No, the number of decimals is set at creation and cannot be modified. This value is stored in the mint account and is immutable. Choose carefully during deployment.

What happens if I lose my mint authority key?

If you lose the private key controlling the mint authority, you lose the ability to mint new tokens. The existing supply remains usable, but no additional tokens can be created. There is no recovery mechanism on Solana.

Is it possible to create a token without paying SOL?

Creating a token requires SOL to cover rent exemption and transaction fees. While devnet allows airdrops, mainnet deployment requires real SOL. Budget approximately 0.05 SOL for mint and account creation.

How do I revoke minting rights after initial distribution?

Use the CLI command: spl-token authorize [MINT_ADDRESS] mint --disable. This removes the mint authority, making the token supply fixed. Ensure all desired tokens are minted before disabling.

Disclaimer:info@kdj.com

The information provided is not trading advice. kdj.com does not assume any responsibility for any investments made based on the information provided in this article. Cryptocurrencies are highly volatile and it is highly recommended that you invest with caution after thorough research!

If you believe that the content used on this website infringes your copyright, please contact us immediately (info@kdj.com) and we will delete it promptly.

Related knowledge

See all articles

User not found or password invalid

Your input is correct