cNFT
cNFT (Compressed NFT)¶
cNFT (Compressed NFT) is a breakthrough technology developed by Metaplex that dramatically reduces NFT minting and storage costs through state compression, making large-scale NFT distribution possible.
Core Problem¶
Traditional NFTs Are Expensive - Each NFT requires an independent Token account - Rent-exempt balance: ~0.012 SOL - Minting 1 million NFTs: 12,000 SOL (millions of dollars) - Limits large-scale adoption
cNFT Solution¶
State Compression Uses Merkle trees to compress NFT data: - Only the tree root (32 bytes) is stored on-chain - Full data stored off-chain (Arweave/Shadow Drive) - Ownership verified through Merkle proofs
Cost Comparison - Traditional NFT: ~0.012 SOL each - cNFT: ~0.0001 SOL each - 100x reduction
How It Works¶
Merkle Tree Structure
Minting Flow 1. Add NFT data to Merkle tree 2. Update tree root on-chain 3. Store full data on Arweave
Verifying Ownership 1. User provides NFT data 2. Provides Merkle proof (path) 3. On-chain verification: Checks if computed root matches 4. Verification passes = Owns the NFT
Technical Implementation¶
Bubblegum Program Metaplex's cNFT program: - Manages Merkle trees - Verifies ownership - Handles transfers
Concurrent Merkle Trees Uses concurrent Merkle tree data structures: - Supports parallel updates - Avoids conflicts - Improves throughput
Tree Configuration
Use Cases¶
Large-Scale Airdrops - Community rewards - Event commemoratives - User retention
Game Assets - Game items - Character equipment - Consumables
Membership Systems - Membership cards - Point certificates - Access permissions
Utility NFTs - Tickets - Coupons - Certificates
Creating cNFTs¶
Using Bubblegum
import { createTree, mintV1 } from "@metaplex-foundation/mpl-bubblegum";
// Create Merkle tree
await createTree(umi, {
merkleTree,
maxDepth: 14,
maxBufferSize: 64,
}).sendAndConfirm(umi);
// Mint cNFT
await mintV1(umi, {
leafOwner: owner.publicKey,
merkleTree: merkleTree.publicKey,
metadata: {
name: "My cNFT",
uri: "https://arweave.net/...",
sellerFeeBasisPoints: 500,
collection: { key: collectionMint, verified: false },
creators: [{ address: creator, verified: false, share: 100 }],
},
}).sendAndConfirm(umi);
Reading cNFTs¶
Requires Indexing Service Since data is not fully on-chain, an indexer is needed: - Helius (best cNFT support) - SimpleHash - Shyft
API Query
// Helius API
const response = await fetch(
`https://mainnet.helius-rpc.com/?api-key=${API_KEY}`,
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
jsonrpc: '2.0',
id: 'my-id',
method: 'getAssetsByOwner',
params: { ownerAddress: walletAddress },
}),
}
);
Limitations and Trade-offs¶
Advantages - Extremely low cost - Strong scalability - Suitable for large-scale distribution
Disadvantages - Requires off-chain indexing - Queries more complex than traditional NFTs - Wallet support still maturing - Transfers require Merkle proofs
Ecosystem Support¶
Wallets - Phantom (supported) - Backpack (supported) - Solflare (supported)
Marketplaces - Tensor (native support) - Magic Eden (supported)
Tools - Helius (best indexer) - Metaplex SDK
Case Studies¶
Large-Scale Adoption - Mad Lads (10,000 cNFT collection) - Claynosaurz Pets (hundreds of thousands) - Various game projects
Cost Savings Minting 1 million cNFTs: - Traditional method: ~\(100,000 - cNFT: ~\)100 - 99.9% savings
Future Development¶
Broader Adoption As tools and support mature, cNFTs will become mainstream.
New Use Cases - On-chain identity - Social graphs - Large-scale loyalty programs
Related Concepts¶
- Merkle Tree: The data structure foundation of cNFTs
- State Compression: Core technical principle
- Bubblegum: The cNFT program
- Helius: Leading cNFT indexer
- Traditional NFT: Standard approach with individual accounts per NFT