Skip to main content

This site is for educational purposes only. Nothing here constitutes financial advice.

Topic 70 of 189

ERC-721A and Compressed NFTs

How gas-optimised NFT standards like ERC-721A made batch mints affordable, and how Solana state compression takes the same idea further by committing compressed NFTs to a Merkle tree instead of storing each one in its own account.

Beginner
8 min readUpdated November 2026Block Clarity Hub Editorial Team

The basics

The NFT Gas Problem

The original NFT standard (ERC-721) was elegant but inefficient. Minting 10,000 NFTs in a single collection meant ~10,000 separate storage operations — gas costs in the thousands of dollars for the collection deployer and end users alike. During the 2021-22 NFT boom, gas wars made mint fees a major friction point. Standards evolved to solve this in two distinct ways: ERC-721A for cheaper Ethereum mints, and Solana state compression for radically different storage architecture.

ERC-721A — Batch-Minting Optimisation

ERC-721A, introduced by Azuki's team in early 2022, is a backwards-compatible reimplementation of ERC-721. The key insight: instead of recording each minted NFT's owner separately, ERC-721A records ownership for ranges of consecutive token IDs. When Alice mints tokens 1-5 in one transaction, only one ownership record is created. The downside: transferring token 3 later requires checking which range it falls in. The net effect: mint gas drops dramatically; transfer gas increases, mainly on a token's first transfer. For most collections this is the right trade because mints are once-per-token, transfers are usually rare.

Compressed NFTs — Solana's Approach

Solana's state compression goes much further. Instead of storing each NFT's data in its own account, compressed NFTs (cNFTs) are leaves in a Merkle tree: the on-chain tree holds the root hash, and the full NFT data is recorded in the transaction that created or updated it and indexed by RPC providers. Owners can prove they own a specific NFT by providing the Merkle proof. Metaplex's documentation describes regular NFT rent on Solana as relatively cheap but scaling linearly, whereas compression drastically reduces the cost of onchain storage. This enables use cases (loyalty programs, in-game items, ticketing) that wouldn't be economically viable with traditional NFT storage.

  • ERC-721A: batch-minting gas optimisation, backwards-compatible with ERC-721
  • cNFTs: Solana's compressed NFTs live as leaves in a Merkle tree, with the data kept in transactions rather than accounts
  • ERC-721A: better mints, costlier first transfers
  • cNFTs: dramatically cheaper for high-volume use cases

Key Takeaways

  • NFT gas costs drove the development of cheaper minting standards
  • ERC-721A optimises batch mints by recording ranges instead of individual tokens
  • Compressed NFTs (Solana) are Merkle-tree leaves: only the tree root is on-chain state and the data lives in ledger transactions
  • Use case determines the right approach — small collections vs millions of items

Going deeper

ERC-721A in Production

ERC-721A has been adopted by many production NFT collections. Specific gas savings: in the ERC721A project's benchmark, batch-minting 5 tokens costs 155,949 gas with OpenZeppelin's ERC-721 versus 63,748 with ERC721A, while transferring those 5 tokens costs 226,655 versus 334,450 gas. The 'consecutive ownership' optimisation works well for fixed-supply collections where users typically mint multiple at once. The transfer cost penalty matters less in practice because most NFTs are transferred rarely or not at all.

ERC-721A Drawbacks

ERC-721A has subtle trade-offs. Sequential-ID requirement means you can't arbitrarily renumber tokens. The 'ownerOf' lookup for any token in a range requires walking back to find the range's owner record — typically cheap but pathological in some scenarios. The implementation has been open source (MIT licence) since the chiru-labs/ERC721A repository was created in January 2022. Many newer NFT collections use it; some use ERC-721 variants with their own optimisations.

How Compressed NFTs Work in Detail

A cNFT collection on Solana uses Bubblegum (Metaplex's compression program; Bubblegum V2 is now the version recommended for new projects). The protocol maintains a Merkle tree of the compressed NFTs minted into it. Each leaf is the hash of one NFT's metadata. To prove you own NFT #12345, you provide its metadata plus a Merkle proof showing the leaf is part of the tree. Transfer = update the leaf, recompute the path to the root, update the on-chain root. The NFT data itself is recorded in the creating or updating transaction rather than in an account, and RPC providers such as Helius index it and serve it through DAS.

DAS — Digital Asset Standard

Solana's DAS (Digital Asset Standard) is the API surface for interacting with cNFTs uniformly with regular NFTs. Wallets and explorers integrate via DAS — users see all their NFTs (compressed and uncompressed) in one list. The standard hides the architectural difference; users don't need to know whether their NFT is compressed or not.

Key Takeaways

  • ERC-721A's cheaper batch mints (about 64k vs 156k gas for 5 tokens in its benchmark) are the load-bearing benefit
  • ERC-721A has subtle constraints (sequential IDs) but is widely production-tested
  • cNFTs are Merkle-tree leaves: the root is on-chain, and the data lives in ledger transactions rather than accounts
  • Solana RPC providers index cNFT data from ledger transactions and serve it via DAS
  • DAS provides a unified API across compressed and uncompressed NFTs

Under the hood

Indexing Requirements

ERC-721A's range-based ownership has implications for indexers. Any on-chain ownerOf lookup has to walk back to find the actual owner of a token ID — more expensive than ERC-721's direct lookup. Indexers that follow the per-token Transfer events ERC721A still emits are unaffected, and the library ships an ERC721AQueryable extension for non-reverting owner queries; for self-hosted indexing, supporting ERC-721A specifically can still be a non-trivial implementation task.

cNFT Data Availability Risk

cNFTs depend on off-chain indexing for data availability. The NFT data lives in past ledger transactions rather than accounts, so if the indexing RPC provider loses it (bankruptcy, malfeasance, simple outage), proving ownership becomes impossible until the data is rebuilt from the ledger or another indexer. This is a real concentration risk if most reads go through a small number of providers. Mitigations: multi-provider indexing, on-chain checkpoints of merkle states, regular metadata snapshots to permanent storage (Arweave, Filecoin). The risk is structural and worth weighing for high-value cNFTs.

ERC-721 Alternatives

Beyond ERC-721A, several alternatives exist. ERC-1155: multi-token standard supporting both fungible and non-fungible tokens in one contract — useful for game items. ERC-2309: a single 'ConsecutiveTransfer' event that batch-emits transfer events for ranges, often paired with ERC-721A. Other implementations: various ownership-encoding optimisations with different trade-offs. The standards landscape continues to evolve; new collections evaluate options based on their specific minting and transfer patterns.

Beyond NFTs — Compression Applied Elsewhere

State compression isn't only for NFTs. Solana's compression infrastructure can be used for any high-volume data: loyalty point ledgers, attendance proofs, IoT data streams. The pattern is general: hash the data into a Merkle tree, keep only the root on-chain, and prove ownership or membership via Merkle proofs.

Pick The Standard Based On Use Case

For traditional 1K-10K supply NFT collections on Ethereum, ERC-721A is generally the right choice. For massive-supply use cases (millions of items: loyalty, game inventories, event tickets), compression (cNFTs on Solana, or analogous patterns on other chains) is essentially mandatory. For multi-fungibility (game items where the same item type can have many instances), ERC-1155 is the standard answer. Pick the standard before designing the contract.

Key Takeaways

  • ERC-721A's range encoding makes on-chain ownerOf lookups costlier; event-based indexers are largely unaffected
  • cNFT data availability depends on RPC-provider indexers — a real structural risk for high-value collections
  • Beyond ERC-721A: ERC-1155, ERC-2309, and others address different trade-offs
  • State compression generalises to many high-volume data use cases beyond NFTs
  • Pick the standard based on supply scale, transfer frequency, and fungibility characteristics

Related Content

CosmWasm and Cosmos Smart Contracts

How CosmWasm enables smart contracts on Cosmos chains via WebAssembly, what makes the developer experience distinct from EVM, and why Cosmos's sovereign-chain architecture is a different bet from rollup-style scaling.

Cardano Plutus and EUTxO Contracts

How Cardano's Extended UTXO (EUTxO) model differs fundamentally from Ethereum's account model, what writing Plutus contracts actually involves, and why concurrency on Cardano works differently.

NEAR Contract Model

How NEAR's sharded execution, async cross-contract calls, and storage staking model differ from Ethereum and Solana — and what writing production NEAR contracts looks like.

ICP Canister Model

How Internet Computer (ICP)'s canisters fundamentally differ from Ethereum-style smart contracts — combining compute, storage, and HTTP-server-like functionality in a single on-chain primitive.

ERC-6551 Token-Bound Accounts

How ERC-6551 lets NFTs own smart contract wallets that can in turn own other assets — enabling 'NFTs that own NFTs,' character-bound inventories, and new composability patterns.

Ordinals, Inscriptions, and BRC-20

How Casey Rodarmor's 2023 Ordinals protocol brought NFTs and tokens to Bitcoin via inscriptions, what BRC-20 means in practice, and how Runes evolved the model.

Algorithmic Stablecoin Failures — Deep Catalogue

How Terra UST, Iron Finance, USDR, and various other algorithmic stablecoins failed — the specific mechanisms in each case, and why all unbacked algorithmic stablecoins face the same structural risk.

Delta-Neutral Stablecoins (Ethena sUSDe)

How Ethena's sUSDe captures perpetual funding rates by hedging spot crypto with short perpetuals, what makes it different from algorithmic stablecoins, and the structural risks beneath the surface.

References & further reading