NFT Basics on Solana
9 examples to get you started with NFTs on Solana - 7 basic and 2 intermediate.
Prerequisites
npm install @solana/kit@7.0.0 @metaplex-foundation/mpl-core @metaplex-foundation/umicargo add anchor-lang@0.32.1Metaplex Core program: CoREENxT6tW1HoK8yfYWXSzaXUcGUimvH2vQJ55jEo.
Basic Examples
1. NFT at the Token Layer
Classic NFTs are SPL mints with supply=1, decimals=0.
spl-token create-token --decimals 0
spl-token mint <MINT> 1
spl-token supply <MINT>- One raw unit in one token account represents ownership
- Metadata layer (Metaplex) adds name, image, collection
- Burning/closing accounts follows SPL rules
Related: SPL Token Basics
2. Read NFT via DAS API
Wallets fetch rich metadata through DAS, not raw GPA alone.
const res = await fetch(DAS_RPC, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
jsonrpc: "2.0",
id: 1,
method: "getAsset",
params: { id: "ASSET_ID" },
}),
});
const { result } = await res.json();
console.log(result?.content?.metadata?.name);- DAS unifies Metaplex Core, Token Metadata, and compressed NFTs
- Requires DAS-enabled RPC provider
- Asset
idformat varies by standard - use id from prior query
Related: Reading NFTs (DAS API)
3. Metaplex Core Single-Account Model
Core stores asset data in one Asset account.
import { createUmi } from "@metaplex-foundation/umi-bundle-defaults";
import { publicKey } from "@metaplex-foundation/umi";
import { fetchAsset } from "@metaplex-foundation/mpl-core";
const umi = createUmi("https://api.devnet.solana.com");
const asset = await fetchAsset(umi, publicKey("ASSET_PUBKEY"));
console.log(asset.name, asset.uri);- Lower account count vs legacy Token Metadata
- Preferred standard for new NFT projects in 2026
- Program ID:
CoREENxT6tW1HoK8yfYWXSzaXUcGUimvH2vQJ55jEo
Related: Metaplex Core
4. Legacy Token Metadata Layout
Older NFTs use mint + metadata PDA + master edition.
// Metadata PDA seeds: ["metadata", token_metadata_program, mint]
const TOKEN_METADATA_PROGRAM = "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s";- Still common in secondary markets and older collections
- More accounts = higher creation rent
- Many tools read via DAS without manual PDA math
Related: Token Metadata
5. Off-Chain JSON Metadata
On-chain URI points to JSON with image and attributes.
{
"name": "Example NFT",
"symbol": "EX",
"description": "Demo asset",
"image": "https://arweave.net/...",
"attributes": [{ "trait_type": "Color", "value": "Blue" }]
}- Image often on Arweave or IPFS
- JSON hash should match on-chain integrity expectations
- Mutable URI allows metadata updates if authority retained
Related: Metadata & Storage
6. Collection Grouping
Collections link many assets under one collection identity.
// Core: collection plugin on asset + collection account
// Token Metadata: verified collection field on metadata account- Verified collections show checkmark in marketplaces
- Unverified collection field is spoofable - verification matters
- DAS
groupingfields expose collection membership
Related: Collections & Verification
7. Compressed NFT (cNFT) Overview
cNFTs store asset data in a merkle tree; on-chain cost per mint is tiny.
// Mint via Bubblegum program into Concurrent Merkle Tree
// Read via DAS getAsset with compression proof fields- Scales to millions of mints (gaming items, POAPs)
- Transfers require merkle proofs
- Bubblegum program:
BGUMAp9Gq7iN3nEkgqX1FbwwdBonfLCEEgxoj36SYPk
Related: Compressed NFTs (Bubblegum)
Intermediate Examples
8. Choose Standard for New Project
| Standard | Accounts | Best for |
|---|---|---|
| Metaplex Core | 1 asset | New 1/1 and collections |
| Token Metadata | 3+ | Legacy compatibility |
| cNFT | Tree leaf | Mass mints |
- Default to Core for new on-chain NFTs unless cNFT scale required
- Token Metadata only when integrating with legacy marketplace requirements
Related: NFT Best Practices
9. Royalties at High Level
Creators set royalty basis points in metadata or Core plugins.
// Royalties enforced by marketplaces + optional on-chain enforcement programs
// Not automatic on plain SPL transfer- Secondary sales honor depends on marketplace enforcement
- Token-2022 transfer hooks and Core plugins add stronger enforcement options
- Document royalty policy in collection metadata
Related: Royalties & Enforcement
Stack versions: This page was written for Agave 4.1.1, Solana CLI 3.0.10, Anchor 0.32.1, anchor-lang 0.32.1, Rust 1.91.1, @solana/kit 7.0.0, Surfpool 0.12.0, and LiteSVM 0.6.x.