├── mytoken ├── mytoken-logo.png └── metadata.json ├── blockexplorer ├── blockexplorer-logo.png └── metadata.json ├── token-logo-guide.md └── README.md /mytoken/mytoken-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jspruance/solana-token-tutorial/main/mytoken/mytoken-logo.png -------------------------------------------------------------------------------- /blockexplorer/blockexplorer-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jspruance/solana-token-tutorial/main/blockexplorer/blockexplorer-logo.png -------------------------------------------------------------------------------- /mytoken/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "MyToken Token", 3 | "symbol": "MYT", 4 | "description": "The official utility token of the MyToken project.", 5 | "image": "", 6 | "external_url": "https://mytoken.io", 7 | "attributes": [ 8 | { 9 | "trait_type": "Category", 10 | "value": "Utility" 11 | }, 12 | { 13 | "trait_type": "Network", 14 | "value": "Solana Devnet" 15 | } 16 | ], 17 | "properties": { 18 | "files": [ 19 | { 20 | "uri": "", 21 | "type": "image/png" 22 | } 23 | ], 24 | "category": "image", 25 | "creators": [ 26 | { 27 | "address": "YOUR_WALLET_PUBLIC_KEY_HERE", 28 | "share": 100 29 | } 30 | ] 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /blockexplorer/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "BlockExplorer Token", 3 | "symbol": "BLX", 4 | "description": "The official utility token of the BlockExplorer project — empowering open blockchain education and exploration.", 5 | "image": "", 6 | "external_url": "https://blockexplorer.io", 7 | "attributes": [ 8 | { 9 | "trait_type": "Category", 10 | "value": "Utility" 11 | }, 12 | { 13 | "trait_type": "Network", 14 | "value": "Solana Devnet" 15 | } 16 | ], 17 | "properties": { 18 | "files": [ 19 | { 20 | "uri": "", 21 | "type": "image/png" 22 | } 23 | ], 24 | "category": "image", 25 | "creators": [ 26 | { 27 | "address": "23VB32cT91sBLPea2VvmspLUVjAYC1yLgEeCxNK95EX4", 28 | "share": 100 29 | } 30 | ] 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /token-logo-guide.md: -------------------------------------------------------------------------------- 1 | # 🖼️ Solana Token Logo Guidelines (2025) 2 | 3 | This document outlines best practices for creating and hosting a logo for your Solana token. 4 | Following these recommendations ensures your logo displays correctly in wallets like **Phantom**, **Solana Explorer**, and DEXs such as **Raydium** and **Jupiter**. 5 | 6 | --- 7 | 8 | ## 🪙 Recommended Logo Specifications 9 | 10 | | Property | Recommended Value | Notes | 11 | |-----------|------------------|-------| 12 | | **Shape** | Square (1:1 aspect ratio) | Circular or rectangular images may be cropped | 13 | | **Dimensions** | 512×512 px | Ideal size for most wallets | 14 | | **Minimum Size** | 256×256 px | Acceptable for small displays | 15 | | **Maximum Size** | 1024×1024 px | Larger images increase load times | 16 | | **File Type** | PNG (preferred) | Supports transparency; JPG acceptable | 17 | | **File Size** | ≤ 500 KB | Keep small for faster IPFS loading | 18 | | **Background** | Transparent or dark-mode-friendly | Phantom uses dark UI themes | 19 | | **Filename** | lowercase, no spaces (e.g., `mytoken-logo.png`) | Prevents IPFS link issues | 20 | 21 | --- 22 | 23 | ## 🎨 Design Tips 24 | 25 | - Use **bold, simple shapes** — tokens are shown in small circles. 26 | - Avoid detailed text or small lettering. 27 | - Ensure **strong contrast** so the logo is visible at 32×32 px. 28 | - Save as **PNG-24** with transparency for best compatibility. 29 | - Test the logo at different sizes before uploading. 30 | 31 | --- 32 | 33 | ## 🧩 Integration with Metadata 34 | 35 | Example entry inside your `metadata.json` file: 36 | 37 | ```json 38 | { 39 | "name": "MyToken Coin", 40 | "symbol": "MYT" 41 | "description": "A Solana token for MyToken.", 42 | "image": "ipfs://QmXabc123/mytoken-logo.png", 43 | "properties": { 44 | "files": [ 45 | { "uri": "ipfs://QmXabc123/mytoken-logo.png", "type": "image/png" } 46 | ], 47 | "category": "image" 48 | } 49 | } 50 | ``` 51 | 52 | Wallets automatically display and resize the image when your token is viewed. 53 | 54 | --- 55 | 56 | ## ☁️ Hosting Recommendations 57 | 58 | | Host Type | Examples | Notes | 59 | |------------|-----------|-------| 60 | | **IPFS (Recommended)** | Pinata, NFT.Storage, Web3.Storage | Decentralized, reliable, free tier | 61 | | **Temporary (Testing)** | Imgur, GitHub Pages, Vercel | Use only for devnet/demo projects | 62 | 63 | --- 64 | 65 | ## ✅ TL;DR 66 | 67 | - Use a **512×512 transparent PNG**, under **300–500 KB**. 68 | - Upload it alongside your `metadata.json` to **Pinata or NFT.Storage**. 69 | - Reference it via `ipfs://` or gateway URL in your metadata. 70 | - Keep it simple, centered, and high contrast for best appearance. 71 | 72 | --- 73 | 74 | **Author:** MyToken 75 | **Date:** 2025 76 | **Version:** 1.0 77 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 🪙 Solana Token Tutorial — Token-2022 (2025 Edition) 2 | 3 | A modern, streamlined workflow for creating and testing your own Solana token using the **Token-2022** program with built-in metadata extensions. 4 | 5 | All steps are tested and work on **Windows (via WSL)**, **macOS**, and **Linux** using **Devnet**. 6 | 7 | --- 8 | 9 | ## 🧩 Step-by-Step Tutorial 10 | 11 | --- 12 | 13 | ## ⚙️ Pre-Step: Windows Setup (WSL Requirement) 14 | 15 | If you’re on Windows, Solana development requires the **Windows Subsystem for Linux (WSL)**. 16 | 17 | Open **PowerShell as Administrator** and run: 18 | 19 | ```bash 20 | wsl --install 21 | ``` 22 | 23 | Restart your PC when prompted, then open **Ubuntu** from the Start menu. 24 | You’ll be asked to create a Linux username and password — that’s your local user account. 25 | 26 | > 💡 Once WSL is installed, all remaining steps are performed inside the **Ubuntu terminal**, not PowerShell. 27 | 28 | --- 29 | 30 | ### 1️⃣ Install Solana CLI & Dependencies (Official Solana Installer) 31 | 32 | Run the official installer from the Solana documentation: 33 | 34 | ```bash 35 | curl --proto '=https' --tlsv1.2 -sSfL https://solana-install.solana.workers.dev | bash 36 | ``` 37 | 38 | Example successful output: 39 | 40 | ``` 41 | Installed Versions: 42 | Rust: rustc 1.86.0 (05f9846f8 2025-03-31) 43 | Solana CLI: solana-cli 2.2.12 (src:0315eb6a; feat:1522022101, client:Agave) 44 | Anchor CLI: anchor-cli 0.31.1 45 | Node.js: v23.11.0 46 | Yarn: 1.22.1 47 | ``` 48 | 49 | Verify installation: 50 | 51 | ```bash 52 | rustc --version && solana --version && anchor --version && node --version && yarn --version 53 | ``` 54 | 55 | --- 56 | 57 | ### 2️⃣ Create a Wallet 58 | 59 | Switch to the **Devnet** (Solana’s free public test network): 60 | 61 | ```bash 62 | solana config set --url devnet 63 | ``` 64 | 65 | Create a wallet: 66 | 67 | ```bash 68 | solana-keygen new --outfile ~/.config/solana/devnet.json 69 | ``` 70 | 71 | This will create your wallet and output your **public key** — save it somewhere safe. 72 | 73 | Set it as the active wallet for the Solana CLI: 74 | 75 | ```bash 76 | solana config set --keypair ~/.config/solana/devnet.json 77 | ``` 78 | 79 | Check your config: 80 | 81 | ```bash 82 | solana config get 83 | ``` 84 | 85 | Request some Devnet SOL for testing: 86 | 87 | ```bash 88 | solana airdrop 2 89 | ``` 90 | 91 | --- 92 | 93 | ### 3️⃣ Create a Token Mint (Token-2022) 94 | 95 | Token-2022 allows on-chain metadata, decimals configuration, and future-proof extensions. 96 | 97 | ```bash 98 | spl-token create-token --program-id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb --enable-metadata --decimals 9 99 | ``` 100 | 101 | Copy the **mint address** from the output. 102 | 103 | --- 104 | 105 | ### 4️⃣ Create Token Account 106 | 107 | ```bash 108 | spl-token create-account 109 | ``` 110 | 111 | This creates a wallet account capable of holding your new token. 112 | 113 | --- 114 | 115 | ### 5️⃣ Mint Token Supply 116 | 117 | ```bash 118 | spl-token mint 1000000 119 | ``` 120 | 121 | This mints **1,000,000 tokens** to your account. 122 | 123 | Check balances: 124 | 125 | ```bash 126 | spl-token balance 127 | ``` 128 | 129 | --- 130 | 131 | ### 6️⃣ Verify in Solana Explorer 132 | 133 | Visit: 134 | 135 | ``` 136 | https://explorer.solana.com/address/?cluster=devnet 137 | ``` 138 | 139 | Your token will not display with its **name**, **symbol**, and **image** since we haven't added metadata yet. 140 | 141 | --- 142 | 143 | ### 7️⃣ Add Metadata (Image + Description) 144 | 145 | #### 📁 Folder Setup 146 | 147 | Create a local folder, e.g. `metadata/`, with two files: 148 | 149 | ``` 150 | metadata/ 151 | ├── mytoken-logo.png 152 | └── metadata.json 153 | ``` 154 | 155 | **metadata.json** example: 156 | 157 | ```json 158 | { 159 | "name": "MyToken Token", 160 | "symbol": "MTK", 161 | "description": "The official utility token of the MyToken project — an example Solana token used for this tutorial.", 162 | "image": "mytoken-logo.png", 163 | "external_url": "https://mytoken.io", 164 | "attributes": [ 165 | { "trait_type": "Category", "value": "Utility" }, 166 | { "trait_type": "Network", "value": "Solana Devnet" } 167 | ], 168 | "properties": { 169 | "files": [{ "uri": "mytoken-logo.png", "type": "image/png" }], 170 | "category": "image", 171 | "creators": [{ "address": "", "share": 100 }] 172 | } 173 | } 174 | ``` 175 | 176 | --- 177 | 178 | ### 8️⃣ Upload to IPFS (via Pinata **or Storacha**) 179 | 180 | You can host your token metadata on any IPFS gateway. Below are two simple options: 181 | 182 | --- 183 | 184 | #### 🅰 Option 1 — Pinata 185 | 186 | 1. Upload the entire `metadata` folder to **Pinata**. 187 | 2. Copy the folder’s **CID** (e.g. `bafybeihabc123...`). 188 | 3. Your JSON file will now be hosted at: 189 | 190 | ``` 191 | https://gateway.pinata.cloud/ipfs//metadata.json 192 | ``` 193 | 194 | and the image at: 195 | 196 | ``` 197 | https://gateway.pinata.cloud/ipfs//mytoken-logo.png 198 | ``` 199 | 200 | --- 201 | 202 | #### 🅱 Option 2 — Storacha (Alternative Gateway) 203 | 204 | If you prefer a decentralized, fast gateway alternative: 205 | 206 | 1. Visit https://storacha.network 207 | 2. Click **Upload Folder** and select your `metadata` directory. 208 | 3. After upload, Storacha will return a **CID** (e.g. `bafkreihxyz789...`). 209 | 4. Your hosted files will be accessible at: 210 | 211 | ``` 212 | https://storacha.network/ipfs//metadata.json 213 | ``` 214 | 215 | and 216 | 217 | ``` 218 | https://storacha.network/ipfs//mytoken-logo.png 219 | ``` 220 | 221 | > 🧠 Tip: both Pinata and Storacha host the same IPFS content, so you can use **either gateway** URL interchangeably in the next step. 222 | 223 | --- 224 | 225 | ### ✅ Continue to Step 9 226 | 227 | Once you have your folder’s CID from **either** service, proceed to attach it to your token: 228 | 229 | ```bash 230 | spl-token initialize-metadata "MyToken Token" "MTK" "https://gateway.pinata.cloud/ipfs//metadata.json" 231 | ``` 232 | 233 | > Replace the URL with your chosen gateway (Pinata or Storacha). 234 | 235 | --- 236 | 237 | ### 9️⃣ Attach Metadata to the Token 238 | 239 | ```bash 240 | spl-token initialize-metadata "MyToken Token" "MTK" "https://gateway.pinata.cloud/ipfs//metadata.json" 241 | ``` 242 | 243 | This associates your metadata with your Token-2022 mint. 244 | 245 | --- 246 | 247 | ### 🔟 Transfer Tokens 248 | 249 | ```bash 250 | spl-token transfer 100 251 | ``` 252 | 253 | This sends 100 tokens to another wallet. 254 | 255 | --- 256 | 257 | ### 1️⃣1️⃣ (Optional) Update Metadata Later 258 | 259 | Need to change your token’s **name**, **symbol**, or **URI** after launch? Use the Token-2022 metadata update command. 260 | 261 | > 🔐 You must sign with the **current metadata update authority** set during initialization. 262 | 263 | Update any subset of fields (include only what you want to change): 264 | 265 | ```bash 266 | # Examples (pick what you need) 267 | spl-token update-metadata --name "MyToken Pro" 268 | spl-token update-metadata --symbol "MTKP" 269 | spl-token update-metadata --uri "https://gateway.pinata.cloud/ipfs//metadata.json" 270 | 271 | # Or all at once: 272 | spl-token update-metadata --name "MyToken Pro" --symbol "MTKP" --uri "https://gateway.pinata.cloud/ipfs//metadata.json" 273 | ``` 274 | 275 | Then refresh views: 276 | 277 | - **Explorer:** reload the mint page. 278 | - **Wallets:** restart / clear cache (Phantom: Settings → Troubleshooting → _Clear cache_). 279 | 280 | > ℹ️ Note: Phantom may still show “Unknown Token” if it can’t resolve your JSON via the Metaplex metadata path. The token will still display balances. Wallets like **Solflare** fully display Token-2022 metadata (name/logo). 281 | 282 | --- 283 | 284 | ## 🚀 How to Deploy to Mainnet-Beta 285 | 286 | Once your token works on **Devnet**, you can easily deploy it to the **real Solana network** (Mainnet-Beta). 287 | The process is identical — the only difference is which cluster your CLI is targeting. 288 | 289 | --- 290 | 291 | ### 🌐 1️⃣ Switch to Mainnet-Beta 292 | 293 | Run this command: 294 | 295 | ```bash 296 | solana config set --url https://api.mainnet-beta.solana.com 297 | ``` 298 | 299 | Confirm: 300 | 301 | ```bash 302 | solana config get 303 | ``` 304 | 305 | It should show: 306 | 307 | ``` 308 | RPC URL: https://api.mainnet-beta.solana.com 309 | ``` 310 | 311 | --- 312 | 313 | ### 💰 2️⃣ Fund Your Wallet with Real SOL 314 | 315 | You’ll need real SOL to cover: 316 | 317 | - Transaction fees 318 | - Token creation fees 319 | - Metadata initialization fees 320 | 321 | Transfer SOL from an exchange (e.g. Coinbase, Binance, Kraken) to your wallet’s public address. 322 | 323 | --- 324 | 325 | ### ⚙️ 3️⃣ Repeat the Same Steps 326 | 327 | All token creation and metadata commands are exactly the same: 328 | 329 | - `spl-token create-token ...` 330 | - `spl-token create-account ...` 331 | - `spl-token mint ...` 332 | - `spl-token initialize-metadata ...` 333 | 334 | Just make sure you’re now on `mainnet-beta` and not `devnet`. 335 | 336 | --- 337 | 338 | ### 🔍 4️⃣ Verify Your Token on Explorer 339 | 340 | After deploying, view it here: 341 | 342 | ``` 343 | https://explorer.solana.com/address/ 344 | ``` 345 | 346 | > ⚠️ No “?cluster=devnet” this time — mainnet is the default. 347 | 348 | --- 349 | 350 | ### 🧠 5️⃣ Tips Before Going Live 351 | 352 | - Double-check your metadata URI is **permanent** and hosted on IPFS (Pinata / Storacha). 353 | - Once launched, edits on mainnet cost real SOL. 354 | - Test everything on Devnet first, then deploy to mainnet when ready. 355 | 356 | --- 357 | 358 | ## 🧭 Quick Recap 359 | 360 | For reference, here’s the full command sequence: 361 | 362 | --- 363 | 364 | ## ✅ Quick Reference Summary 365 | 366 | | Step | Command | Purpose | 367 | | -------- | ----------------------------------------------------------------------------------------------------------------------------- | ------------------------ | 368 | | Pre | `wsl --install` | Set up WSL on Windows | 369 | | 1 | Solana installer | Install all dependencies | 370 | | 2 | `solana config set --url devnet` | Switch to Devnet | 371 | | 3 | `solana-keygen new` | Create wallet | 372 | | 4 | `spl-token create-token --program-id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb --enable-metadata --decimals 9` | Create Token-2022 mint | 373 | | 5 | `spl-token create-account ` | Create token account | 374 | | 6 | Explorer | Verify token in Explorer | 375 | | 6.5 | `spl-token mint 1000000` | Mint supply | 376 | | 7 | `spl-token initialize-metadata "MyToken" "MTK" "https://gateway.pinata.cloud/ipfs//metadata.json"` | Attach metadata | 377 | | 8 | `spl-token transfer 100 ` | Transfer tokens | 378 | | 11 (opt) | `spl-token update-metadata --name/--symbol/--uri ...` | Update metadata later | 379 | | 🚀 | `solana config set --url https://api.mainnet-beta.solana.com` | Deploy to Mainnet-Beta | 380 | 381 | --- 382 | 383 | 🧠 **Author:** BlockExplorer 384 | 📅 **Updated:** October 2025 385 | 📘 **Version:** Token-2022 Tutorial Edition 386 | --------------------------------------------------------------------------------