惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog
Microsoft Security Blog
Microsoft Security Blog
Jina AI
Jina AI
博客园 - 叶小钗
J
Java Code Geeks
博客园 - 聂微东
博客园 - 司徒正美
大猫的无限游戏
大猫的无限游戏
阮一峰的网络日志
阮一峰的网络日志
V
V2EX
美团技术团队
WordPress大学
WordPress大学
M
MIT News - Artificial intelligence
雷峰网
雷峰网
酷 壳 – CoolShell
酷 壳 – CoolShell
GbyAI
GbyAI
罗磊的独立博客
T
The Blog of Author Tim Ferriss
aimingoo的专栏
aimingoo的专栏
T
Tailwind CSS Blog
The Cloudflare Blog
Stack Overflow Blog
Stack Overflow Blog
N
Netflix TechBlog - Medium
小众软件
小众软件

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
What Token Extensions Are and Why a Web2 Developer Should...
Vinay · 2026-06-26 · via DEV Community

You already understand tokens. Extensions are just middleware for your money.

If you have ever worked with Stripe, you know the pattern. You start with a simple charge: send money from point A to point B. Then you add features — subscriptions, transfer fees, metadata on invoices, compliance checks. Each feature is a separate Stripe product or API call, and wiring them together is your job.

Solana's Token Extensions Program is the same idea, but at the blockchain protocol level. Instead of bolting features on top of a basic token after creation (which Solana does not allow), you declare every capability upfront, and the runtime enforces it automatically. No smart contract to write. No backend service to maintain. Just configuration flags at creation time.


What is a token extension?

A token extension is an optional feature you enable when you create a token mint. Under the hood, each extension reserves extra bytes in the mint's on-chain account. Those bytes store configuration — an interest rate, a fee percentage, a metadata URI — and the Solana runtime reads them during every transaction.

The original SPL Token Program is simple. It stores supply, decimals, and authorities. The Token Extensions Program (TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb) is a superset. It stores everything the original does, plus additional data for each extension you enable.

Extensions map directly to Web2 concepts

Extension Web2 Analogy What It Does
Transfer Fees Payment processor fee Deducts a % on every transfer
Interest-Bearing Savings account APY Displays time-adjusted balance
Metadata Product catalog entry Stores name, symbol, URI on-chain
Default Account State KYC gating All accounts start frozen; you thaw approved users
Non-Transferable Professional license Tokens cannot be sold or transferred
Permanent Delegate Admin revoke power Issuer can burn tokens from any holder

A concrete example

Here is the exact command I ran to create a token with transfer fees, interest-bearing, and metadata — all in one line:

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

This single command does what would take three separate services in Web2:

  • Transfer fees (like Stripe taking 1%): 100 basis points = 1%, capped at 5 tokens
  • Interest-bearing (like a savings account): 5% continuous compounding
  • Metadata (like a product database entry): space reserved for name, symbol, and URI

After creating the mint, I added the metadata:

spl-token initialize-metadata [MINT_ADDRESS] \
  "ArcCoin" "ARC" \
  "https://example.com/metadata.json" \
  --program-id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb

Then I inspected everything with:

spl-token display [MINT_ADDRESS] \
  --program-id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb

The output showed each extension as a separate block — TransferFeeConfig, Interest-bearing, Metadata Pointer, Metadata — all living in the same on-chain account.


What surprised me

Extensions are additive in cost. Each one adds bytes to the mint account, and bytes require SOL for rent-exempt status. My bare mint (default-frozen only) was 171 bytes. Adding interest-bearing bumped it to 222 bytes. The multi-extension mint with transfer fees + metadata + interest was 599 bytes — costing over 2x the rent.

In Web2 terms: extensions are like choosing between a lightweight microservice and a feature-rich monolith. Both have their place, but you should make the choice deliberately.


Where to go deeper

The official Solana documentation covers every extension in detail:

If you are a Web2 developer curious about Solana, start with the extensions that map to problems you already solve — transfer fees, metadata, access control. You will recognize every one of them.