DEV Community

Cover image for SOLANA TOKENS ARE NOT WHAT YOU THINK
Jedi of JavaScript
Jedi of JavaScript

Posted on

SOLANA TOKENS ARE NOT WHAT YOU THINK

If you clicked this expecting some secret conspiracy about Solana tokens, I'm afraid you'll be disappointed. There isn't one. What you will find, though, is the mental model shift that helped me finally understand how tokens actually work on Solana. So, let's get into it.

First off, what even are Solana tokens?

When most people hear the word token, they immediately think "money". That's not wrong... but it's far from the whole story.
In simple terms (cuz life's already complicated enough πŸ€·β€β™€οΈ), a token on Solana is a transferable unit of value. (Keep the word transferable in mind β€” it will become important later.)
Here's the interesting part: the value isn't something Solana decides. You, the developer, define what that value represents.
Depending on your application, a token could represent:

  • Money
  • Proof of ownership
  • Authentication or authorization
  • Voting power
  • Loyalty points
  • Access to premium features

The point is simple: a token is just a transferable representation of something valuable, and what "valuable" means depends entirely on your use case.
Now that we know what Solana tokens are, it's time to do a little detective work πŸ•΅οΈ.

We still don't know what they're made of, who creates them, or where they "live" once they exist, and finally, why is everyone talking about token-2022? And trust me, the answers are probably not what you're expecting - So stay close. The juicy gist is just getting started. πŸ˜„

Now let's answer those one at a time.

What is a Solana token actually made of?

Short answer: data.
But if I left it at that, I'd be doing you a great disservice, so let's dig a little deeper. Think about it for a second. Solana can have millions of different tokens. If they're all just "data," then what makes one token different from another? What makes a USDC token behave differently from an NFT, or from a governance token? The answer lies in the data itself.

Two analogies really helped this click for me.

1. The food recipe analogy 🍝

If you're someone who likes real-world analogies, think of food recipes. (Don't mind me... I'm a foodie, so I couldn't help myself πŸ˜‚.)

What is a recipe? It's simply a collection of instructions and ingredients. The recipe for making lasagna is completely different from the recipe for making butter chicken, even though they're both just recipes.

Tokens work in much the same way.

When I said a token is made up of data, you can think of that data as the recipe. The recipe defines how the token behaves.

It contains the rules for the token, such as:

  • Who is allowed to mint new tokens?
  • Are there any transfer fees?
  • If there are fees, who receives them?
  • Can tokens be frozen?
  • Can new features be added?

It also stores metadata that makes that particular token unique.

2. The OOP analogy πŸ’»

If programming analogies are more your thing, think of a token like a class in Object-Oriented Programming.

A class defines its properties, methods, and the rules that every object created from it should follow.

Likewise, a Solana token is defined by a set of data that describes its behavior and characteristics.

personally, i think the food recipe analogy does it for me

But let's move on to the next question shall we.

Who creates a Solana token?

Before we answer that, we need to understand what a program is.

If you're coming from Web2, you can think of a Solana program as code that lives and runs on the blockchain. It's responsible for executing instructions and enforcing the rules you've written.

When it comes to creating tokens, there are two programs you'll hear about over and over again:

  • The SPL Token Program
  • The Token-2022 Program

The SPL Token Program is the original token program. It laid the foundation for creating fungible tokens and NFTs on Solana and has powered the ecosystem for years.

As Solana evolved, however, developers wanted more built-in functionality without reinventing the wheel every time they created a token. That's where Token-2022 comes in.
Rather than replacing the original Token Program, Token-2022 builds on the same foundation while introducing powerful new features and extensions that give developers much more control over how their tokens behave.
Don't worry if that sounds a little abstract right now. We'll peel back those layers later in the article. πŸ˜‰

Where does a Solana token live?
Short answer: Accounts.
Earlier in my 100 Days of Solana journey, this was one of the concepts I struggled with the most. I kept seeing people say:

"Everything on Solana is an account."

At first, I nodded along as if I understood. I didn't. πŸ˜…
Eventually, it clicked.
I like to think of accounts as specialized on-chain containers. They don't all hold the same thing. Instead, each account is designed to hold a specific type of data.
Let's go back to the food analogy.
Our recipe (the token's data) has to be written somewhere, right? And that somewhere would most likely be a note/recipe book right?
Well on Solana that "somewhere" is the mint account. It stores the recipe, the rules that define how the token behaves.
But here's the catch...
You can't cook on a recipe book πŸ˜‚.
You need a pot or a pan to hold the food produced from that recipe.
That's where the token account comes in.
The token account doesn't store the recipe. It stores tokens created from that recipe.
This is exactly why I called Solana accounts specialized. Each account has a specific purpose.
A mint account stores the token's rules, configuration, and metadata.
A token account stores the balance of tokens belonging to a particular owner.
Two different jobs. Two different accounts.

Once this clicked for me, so many other Solana concepts suddenly started making sense.

Let's make it even more concrete.
Instead of staring at words, let's create a token from scratch and watch Solana create both the mint account and a token account, so you can see exactly what role each one plays.
we'll create a nameless bare token using the spl-token program (you have to have a Linux distro running with the Solana CLI tool installed).
first we run the command

spl-token create-token
Enter fullscreen mode Exit fullscreen mode

and we get the following result:


the highlighted string is the mint account address. now let's see what happens if we try to mint a couple of tokens:


An error is returned immediately: "Account not found", which is basically saying, we have the recipe in the recipe book (mint account), but we didn't find any pot/pan (token account) to take the food.
only until we create a token account with the command:

spl-token create account [mint_account_address]
Enter fullscreen mode Exit fullscreen mode

can we then successfully mint the token:


pay close attention to what get's returned here, where it says "token" and gives the mint address, then says "recipient" and gives the token account address we just created.

we can check that the tokens were successfully minted by running the command:

spl-token accounts
Enter fullscreen mode Exit fullscreen mode

which lists all the tokens (by their mint addresses) and their balance on the creators wallet

Now let's go back for a second.
Remember when I said a token is a transferable unit of value, and I asked you to mentally circle the word transferable?

Well... here's why.

Just because something can be transferred doesn't mean it should be.

Imagine I own a vault filled with priceless treasure, and I have the only key.

Could I transfer that key to a random stranger?
Absolutely.
Should I?
Probably not. πŸ˜…

Some tokens are designed to move freely from one wallet to another. Others are meant to stay exactly where they are, or only move under very specific conditions.

Now let's stretch that vault analogy a little further. Suppose anyone could make a copy of my vault key. Suddenly, that key isn't very valuable anymore, is it?

Welcome to the world of NFTs.

An NFT (Non-Fungible token) is unique because its rules ensure there can only ever be one of it. In Solana, that's typically achieved by setting the token's supply to exactly 1, using 0 decimals, and preventing any additional tokens from ever being minted.

In other words, the uniqueness of an NFT isn't magic.

It's just... rules.
This brings us to the heart of the matter: tokens are defined by their rules, and Token-2022 gives you far more powerful tools to define them.
That's where Solana's token programs come in, and where Token-2022 really starts to shine. So on to the next question.

Why Is Everyone Talking About Token-2022?

When Solana launched, it shipped with the SPL Token Program β€” a solid foundation for creating fungible tokens and NFTs. It worked well for basic use cases.

But as the ecosystem matured, developers wanted more powerful features without writing complex custom code every time. So Solana introduced Token-2022 (also called Token Extensions).

Think of it like this:

  • SPL Token Program = A reliable bicycle. Simple and effective.
  • Token-2022 = That same bicycle with optional upgrades: electric assist, better brakes, cargo basket, lights, etc.

You don’t have to use every extension. You enable only what your project needs.

Key extensions include:

  • Transfer fees
  • Custom transfer logic
  • Confidential transfers (privacy)
  • On-chain metadata
  • Interest-bearing tokens
  • Account freezing/pausing
  • Rent reclamation

This makes Token-2022 especially powerful for DeFi, RWAs, gaming, loyalty programs, and regulated finance.

Now, if you've been paying attention, you've probably noticed a pattern.
Every time we talked about a token, we eventually ended up talking about its rules.

  • Who can mint?
  • Who can transfer?
  • Should transfers have fees?
  • Can the token earn interest?
  • Can transfers be paused?
  • Can it even be transferred at all? That's the real takeaway.

A token isn't just defined by what it represents. It's defined by the rules that govern it.
And Token-2022 doesn't change what a token is.
It simply gives developers a much richer toolbox for defining those rules.
Enough theory.
Let's build one from scratch and watch Token-2022 do its thing.

This will be a very short & simple example (taken from the 100 days of Solana challenge, Day 37) but should drive home the point.
we'll create a token using the token extension program like so:

spl-token --program-id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb \
  create-token \
  --decimals 2 \
  --transfer-fee-basis-points 100 \
  --transfer-fee-maximum-fee 500 \
  --interest-rate 5 \
  --enable-metadata
Enter fullscreen mode Exit fullscreen mode

Take note of the change in the command, especially at the beginning with the --program-id flag and the string TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb which points to the address of the token extension program. this command does a couple of things like setting a transfer fee, setting an interest rate and enabling metadata on the mint.

Here's what we get:

then we initialize, we give the token a name, symbol and we add a link to the tokens metadata for more info.

spl-token initialize-metadata \
  [MINT_ADDRESS] \
  "T-REX coin" \
  "TRX" \
  "https://gist.githubusercontent.com/jriffs/cf234b69054aae76075933c090120d36/raw/fab788b10fa36200f8f98e40aff77cdfb4305c1c/dev-to-example.json"
Enter fullscreen mode Exit fullscreen mode


Then we mint, but not without creating a token account first:

spl-token create-account [MINT_ADDRESS]
spl-token mint [MINT_ADDRESS] 1000
Enter fullscreen mode Exit fullscreen mode

Then we try to look inside the token to see what we find:

spl-token display [MINT_ADDRESS]
Enter fullscreen mode Exit fullscreen mode


Notice the "Extensions" section? Yep that's right, all the things we specified we wanted when we created our token, they're all there.

Wrapping up

Tokens on Solana aren't just "crypto money." They're flexible, rule-based primitives that can represent almost anything of value β€” and Token-2022 makes them significantly more powerful than before.

The biggest shift for most Web2 developers is moving from thinking about tokens as assets to thinking about them as programmable rulesets.

I hope this article gave you a solid mental model to build on. If something still feels unclear, drop a comment below. I'm still learning myself and happy to clarify.

Happy building on Solana! πŸš€
(Also... please be kind in the comments. Writing is hard. 😭)

Top comments (1)

Collapse
 
jriffs profile image
Jedi of JavaScript

If you've read this, please leave a comment: question, encouragement, disagreement, anything at all is much appreciated. πŸ˜‡