Imagine minting 1 million NFTs for just $110. On Ethereum, this would cost millions. On Solana without compression, it would still run over $250,000. State compression changes everything.

The Problem: On-Chain Storage Costs

Traditional NFTs on Solana store all metadata directly on-chain in individual accounts. Each account requires rent—a deposit to keep data stored on validators. For a single NFT, this costs about 0.0015 SOL (roughly $0.25). Scale that to 1 million NFTs, and you're looking at significant costs.

The blockchain's state grows with every account created. Validators must store and replicate this data across the network, creating scalability bottlenecks. State compression solves this by moving data off-chain while maintaining cryptographic proof on-chain.

How State Compression Works

State compression uses concurrent Merkle trees—a cryptographic data structure that hashes data into a single root hash stored on-chain. Instead of storing each NFT's metadata in its own account, compression stores only the Merkle root on Solana. The actual data lives off-chain with indexers like Helius or SimpleHash.

Here's the technical flow:

  1. NFT metadata is hashed and added to a Merkle tree
  2. Only the root hash is stored on-chain in a single account
  3. Off-chain indexers store the full tree and serve data via API
  4. To verify ownership, users provide a Merkle proof that validates against the on-chain root

The Merkle tree itself lives in a Solana account managed by the SPL Account Compression program and SPL Noop program. The Noop program logs transaction data to Solana's ledger, which indexers parse to reconstruct the tree off-chain.

Bubblegum: The Compressed NFT Standard

Metaplex's Bubblegum program implements compressed NFTs (cNFTs) using state compression. It wraps the low-level Account Compression program with NFT-specific logic, maintaining compatibility with the Token Metadata standard.

When you create a compressed NFT collection, you specify:

  • Max depth: Determines tree capacity (depth 14 = 16,384 NFTs)
  • Max buffer size: Controls concurrent updates (higher = more expensive but faster minting)
  • Canopy depth: Stores part of the proof path on-chain to reduce transfer size

A tree with max depth 20 and buffer size 256 can hold over 1 million NFTs and costs about 110 SOL to create (one-time). Compare that to 1,500 SOL for uncompressed NFTs.

Developer Experience

Working with compressed NFTs requires different tooling than standard NFTs. You'll need:

  • RPC provider with DAS API support: Helius, Triton, or another indexer that implements the Digital Asset Standard API
  • Metaplex SDKs: The JavaScript and Rust SDKs provide Bubblegum helpers
  • Proof management: For transfers and burns, you fetch proofs from the indexer

Minting is straightforward with the Metaplex SDK: