In Web2, asset distribution is controlled by backend services, databases, and business logic.
In Solana, those rules can live directly inside the token itself.
In this experiment, I explored how far Token-2022 Program can go by combining:
- Non-transferable tokens
- Token accounts across multiple wallets
- Transfers with protocol-level enforcement
- Token burning
- On-chain state inspection
The goal was not just to create tokens, but to understand how Token-2022 changes the mental model of token design.
π§ Context: Why Token-2022 matters
Traditional SPL tokens rely on application-level logic. That means rules like restrictions, permissions, or behavior are often enforced off-chain.
With Token-2022, those rules move into the protocol layer.
Official references:
This changes the mental model completely:
Tokens are no longer just balances. They become programmable state machines with built-in economic rules.
πͺ 1. Creating a non-transferable token mint
The first step was creating a mint using the Non-Transferable extension.
I used this because I wanted to test how Token-2022 can enforce identity-like behavior directly at the protocol level.
spl-token create-token \
--program-id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb \
--enable-non-transferable
Result:
Address: BdjdjoR9bS1bei3Gn5crn4jqYAtsxgm7q9B7NAubj42k
Decimals: 9
Signature: 52FfGLA8UHYskSZuwzdWTMnMZnjh8sjAGmM8WT7rjjSgL5jFt6HhkvA5saowDx2cAkwvEhT4PVC9Pw1BorSxU45i
π‘ Why this matters
Non-transferable tokens cannot be moved between wallets.
This makes them useful for:
- credentials
- identity systems
- achievements
- access control mechanisms
Instead of enforcing rules in an application layer, the restriction is enforced by the protocol itself.
π 2. Creating a token account and minting
Next, I created a token account and initialized the mint flow.
spl-token create-account BdjdjoR9bS1bei3Gn5crn4jqYAtsxgm7q9B7NAubj42k \
--program-id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb
Result:
Creating account P2H8JGKs7TGNmrv1TP9HRCQK7wwLFRSzC8MsgE5DiUQ
Signature: 5t6y36E2UQxeV3Sr6eBVUbJAEoVGtZTVheETash9f3G6eSkeMhC2Shk88XnCRAjNZT5fKYTEQskJzhqKE3Wze6J5
π‘ Why this matters
Each token account represents:
- ownership
- balance
- and state tied to mint rules
Even with extensions, the account model remains the foundation of Solanaβs token system.
π 3. Creating an ATA for a second wallet
To simulate multi-user behavior, I created a second wallet account:
spl-token create-account BdjdjoR9bS1bei3Gn5crn4jqYAtsxgm7q9B7NAubj42k \
--owner ~/.config/solana/id_back.json \
--fee-payer ~/.config/solana/id.json \
--program-id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb
Result:
Creating account 9z325AvvFhnb6AqsVCGLWtccTSdxuNZafurZqnmE7UMD
Signature: 28b5K5o9xhPmNwgUHDwHmHRXq1GwLYQpawdYH2N27PEuadDD4BLxGmJFSdVM94md1hqB1MB13uFHyD8Ycj4xuEyE
π‘ Why this matters
This step represents real-world multi-user distribution systems.
However, Token-2022 extensions allow rules to be enforced at protocol level instead of relying on backend logic.
πΈ 4. Attempting a transfer
I attempted a token transfer between accounts:
spl-token transfer BdjdjoR9bS1bei3Gn5crn4jqYAtsxgm7q9B7NAubj42k 5 \
$(solana-keygen pubkey ~/.config/solana/id_back.json) \
--program-id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb \
--allow-unfunded-recipient
π‘ Why this matters
This is where Token-2022 shows its flexibility.
Depending on enabled extensions, transfers can be:
- fully allowed
- restricted
- or modified at protocol level
This reduces the need for custom validation logic in traditional applications.
π₯ 5. Burning tokens
To test supply control, I burned tokens:
spl-token burn P2H8JGKs7TGNmrv1TP9HRCQK7wwLFRSzC8MsgE5DiUQ 3 \
--program-id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb
Result:
Burn 3 tokens
Source: P2H8JGKs7TGNmrv1TP9HRCQK7wwLFRSzC8MsgE5DiUQ
Signature: 33uX4vtabxexV5teve7VCUbTZRcs3D3Kha3kzNz2zbJpsswRXGmdVptViDsYFFfpkLwwZCbKjb3s4dFxM3yiYT7a
π‘ Why this matters
Burning tokens is not just destruction.
It represents a deterministic state change on-chain, reducing total supply at the protocol level.
π 6. End-to-end lifecycle observation
After running the full flow:
- Mint was created successfully
- Token accounts were initialized
- Transfers were executed under protocol rules
- Tokens were burned
- State changes were visible across explorers
This highlights a key difference from Web2 systems:
In Web2, state lives in databases.
In Solana, state is deterministic, replicated, and enforced by the protocol.
π§ What surprised me
The biggest shift was conceptual:
- Tokens are not just balances
- They are programmable state machines
- Ownership rules live at mint level
- Behavior is enforced at the protocol layer
This becomes even more powerful when combined with extensions like:
- transfer fees
- metadata binding
- identity-based tokens
π Whatβs next
Next steps in this exploration:
- Transfer fee extensions and fee withdrawal mechanisms
- Metadata-driven token systems
- Token-gated applications
- More advanced Token-2022 behaviors
Because Token-2022 is not just a token standard.
It is a framework for building economic logic directly into blockchain primitives.


Top comments (0)