Reference: A Compressed-NFT Mint at Scale
Compressed NFTs (cNFTs) via Bubblegum store asset data in Merkle trees, slashing rent costs for large collections. This reference covers tree creation, batch mint, DAS reads in the client, and cost trade-offs vs traditional Metaplex NFTs.
Recipe
Quick-reference recipe card - copy-paste ready.
1. Create Merkle tree (depth/capacity plan)
2. Create collection cNFT + verify collection setup
3. Batch mint leaves with Bubblegum mint instructions
4. Read assets via DAS getAsset / searchAssets
5. Transfer via Bubblegum delegate path
When to reach for this:
- 10k+ PFP or badge drop
- Gaming inventory at scale
- Cost comparison proposal to stakeholders
- Indexer design for compressed assets
Working Example
import { createSolanaRpc } from "@solana/kit";
const rpc = createSolanaRpc(process.env.RPC_URL!);
const das = process.env.DAS_URL!; // Provider DAS endpoint
async function fetchWalletCnfts(owner: string) {
const res = await fetch(das, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
jsonrpc: "2.0",
id: 1,
method: "searchAssets",
params: { ownerAddress: owner, compressed: true, limit: 1000 },
}),
});
return res.json();
}## Capacity planning (example)
Tree depth 20 -> ~1M leaves max
Mint 50k collection -> depth >= 16
Cost: tree rent + per-mint CU (~ low vs 50k full accounts)
**Read path:** DAS only; `getProgramAccounts` impracticalWhat this demonstrates:
- DAS as first-class read API for wallets
- Tree depth drives max supply
- Cost model before committing to architecture
Deep Dive
Architecture
| Component | Role |
|---|---|
| Merkle tree account | Stores compressed leaf hashes |
| Bubblegum program | Mint, transfer, burn instructions |
| DAS API | Asset proof and metadata resolution |
| Collection NFT | Optional grouping for marketplaces |
Mint Pipeline
- Queue mint jobs with rate limit respect to RPC
- Priority fees on batch transactions during public drop
- Monitor failed mints via signature logs
Gotchas
- GPA for wallet inventory - Timeouts at scale. Fix: DAS
searchAssets. - Undersized tree - Cannot add capacity without new tree. Fix: Depth planning spreadsheet.
- Standard RPC without DAS - cNFT metadata missing in wallet. Fix: Provider with DAS enabled.
- No delegate plan - Marketplaces need delegation flows. Fix: Document delegate ix in spec.
- Assuming same UX as Metaplex NFT - Proof paths differ. Fix: Client team spike DAS early.
Alternatives
| Alternative | Use When | Don't Use When |
|---|---|---|
| Full Metaplex NFT | < 1k high-value art | 100k game items |
| MPL Core | Simpler single-account NFT | Need massive scale |
| Off-chain DB only | Centralized game | On-chain ownership claim |
FAQs
Which RPC providers support DAS?
Major Solana RPC vendors offer DAS; verify in contract before drop.
Bubblegum version?
Pin to ecosystem-supported release; test on devnet tree clone.
Mint bot traffic?
Jito bundles + rate limits on API; captcha on allowlist mint.
Transfer cost?
Lower than full NFT account rent; still pays CU and fees.
Indexer custom?
Possible via Geyser + merkle proofs; heavy engineering.
Tree authority?
Document who can fill tree; multisig for production drops.
Metadata storage?
URI in leaf; use durable hosting like Arweave.
Wallet support?
Test Phantom/Solflare DAS display on devnet before mainnet.
Compliance?
Allowlist and geo gates off-chain; engineering implements merkle allowlist.
Failure recovery?
Track minted leaf index; resume batch from last success.
Related
- Compressed NFTs Bubblegum - mechanics
- Reading Compressed Assets DAS - read path
- Transactions Not Landing - drop day landing
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.