# What I learned minting my first SPL token and NFT on Solana

I started a pretty cool bootcamp program called [Turbine](https://turbin3.org/) knowing very little about Solana, minting tokens, NFTs and ended with a working token (MOAR Coin) and a Core NFT, tested on devnet.

This is the whole lesson, in the order I lived it.

### **Your wallet pays for everything**

Creating accounts, uploading files, sending transactions, costs lamports from your devnet keypair.

Before doing anything, fund your devnet wallet

```shell
solana airdrop 2 - url devnet - keypair ./devnet-wallet.json
```

Almost all operations you need will need a wallet with tokens.\
Irys (a hosting platform for NFT images and metadata JSON) bill the same wallet, so ensure you get yourself some lamports before trying to mint anything.

Good thing it was just pennies.

### An SPL mint is just another account

Creating the token itself means renting a tiny on-chain account and initializing it with its decimal precision and a mint authority, in this case you as creator of the token.

The big mental shift: a "token" is just a program-owned account, and everything else (balances, descriptions) just point back to it.

### Tokens live in ATAs, not wallets

In Solana, wallets can't hold tokens Solana directly.

New tokens are always minted into an associated token account (ATA) a dedicated balance account deterministically tied to one mint and one owner, so each holder gets exactly one such account per token type.

### Let the SDK do the transaction plumbing

My first scripts hand-built transactions: blockhash, fee payer, lifetime, sign, assert, send-and-confirm. Great for learning but not for productivity.

```javascript
const client = await createClient()
.use(signerFromFile("./devnet-wallet.json"))
.use(solanaDevnetRpc({ transactionConfig: { version: 1 } }))
.use(tokenProgram());
```

### Transfer taught me to check the source first

My first token transfer failed with `Invalid account data for instruction`.

Checking on-chain showed why: the mint had supply 0. The source must already hold funds. Now I verify before sending: mint supply > 0, source ATA exists with balance.

### Metadata is more costly than the token

Attaching a name, symbol, and link to a newly minted token costs roughly a hundred times more computing than creating the token itself, because the network performs several account-setup operations behind the scenes.

### The NFT Creation Flow

1. Upload the image to decentralized storage
2. Upload the metadata JSON to Irys
3. Mint the NFT

### NFT Update Flow

The Core update flow is:

1. Edit metadata and upload to Irys
2. Update the metadata on chain as the update authority

### So What did I learn?

A token is programmable scarcity you can issue from a laptop: fixed supply, named authority, auditable transfers. Any day of the week all year round. No bank, no paperwork.

That pattern could power loyalty points that can't be counterfeited, event tickets that can't be double-spent, and stablecoins that move globally in seconds.

NFTs extend it to unique things: collectibles, in-game assets, or even your secret recipes, representable as JSON and an ownership record on chain. It proves ownership, is transferable, and updatable without asking anyone's permission.
