Skip to content

Creating a token

Screenshot 2024-08-28 at 7.09.00 PM.png

Creating your own token (100x coin lets say) requires understanding the Token Program that is written by the engineers at Solana - https://github.com/solana-labs/solana-program-library

Specifically, the way to create a token requires you to

  1. Create a token mint
  2. Create an associated token account for this mint and for a specific user
  3. Mint tokens to that user.

Token mint

It’s like a bank that has the athority to create more coins. It can also have the authority to freeze coins.

Associated token account

Before you can ask other people to send you a token, you need to create an associated token account for that token and your public key

Reference - https://spl.solana.com/token

  • Create a new cli wallet

    solana-keygen new
  • Set the RPC url

    solana config set --url https://api.devnet.solana.com
  • Airdrop yourself some SOL

    solana airdrop 1
  • Check your balance

    solana balance
  • Create token mint

    spl-token create-token

    Screenshot 2024-08-23 at 4.44.15 PM.png

  • Verify token mint on chain

    Screenshot 2024-08-23 at 4.42.55 PM.png

    Screenshot 2024-08-23 at 4.58.03 PM.png

  • Check the supply of the token

    spl-token supply AQoKYV7tYpTrFZN6P5oUufbQKAUr9mNYGe1TTJC9wajM
  • Create an associated token account

    spl-token create-account ChNkv9iW5pZJ1YAsNswC2CrdMUkFJBUbRWinjdLvKpXA

    Screenshot 2024-08-23 at 5.18.14 PM.png

  • Mint some tokens to yourself

    spl-token mint ChNkv9iW5pZJ1YAsNswC2CrdMUkFJBUbRWinjdLvKpXA 100
  • Check your balances in the explorer

    Screenshot 2024-08-23 at 5.20.41 PM.png

  • Import the token in Phantom and see the balances

    Screenshot 2024-08-23 at 5.22.13 PM.png