NFT Basics on Solana
9 examples to get you started with NFTs on Solana - 7 basic and 2 intermediate.
Search across all documentation pages
9 examples to get you started with NFTs on Solana - 7 basic and 2 intermediate.
npm install @solana/kit@7.0.0 @metaplex-foundation/mpl-core @metaplex-foundation/umicargo add anchor-lang@0.32.1Metaplex Core program: CoREENxT6tW1HoK8yfYWXSzaXUcGUimvH2vQJ55jEo.
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>Related: SPL Token Basics
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);id format varies by standard - use id from prior queryRelated: Reading NFTs (DAS API)
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);CoREENxT6tW1HoK8yfYWXSzaXUcGUimvH2vQJ55jEoRelated: Metaplex Core
Older NFTs use mint + metadata PDA + master edition.
// Metadata PDA seeds: ["metadata", token_metadata_program, mint]
const TOKEN_METADATA_PROGRAM = "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s";Related: Token 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" }]
}Related: Metadata & Storage
Collections link many assets under one collection identity.
// Core: collection plugin on asset + collection account
// Token Metadata: verified collection field on metadata accountgrouping fields expose collection membershipRelated: Collections & Verification
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 fieldsBGUMAp9Gq7iN3nEkgqX1FbwwdBonfLCEEgxoj36SYPkRelated: Compressed NFTs (Bubblegum)
| Standard | Accounts | Best for |
|---|---|---|
| Metaplex Core | 1 asset | New 1/1 and collections |
| Token Metadata | 3+ | Legacy compatibility |
| cNFT | Tree leaf | Mass mints |
Related: NFT Best Practices
Creators set royalty basis points in metadata or Core plugins.
// Royalties enforced by marketplaces + optional on-chain enforcement programs
// Not automatic on plain SPL transferRelated: 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.
Reviewed by Chris St. John·Last updated Jul 16, 2026