Introduction
Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.
I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.
I also build and publish a variety of tools, libraries, and open-source projects.
This article introduces ERC721A, based on materials from a previous study session.
The event and slides are available below.
A recording of the session is also available.
The original slide images are retained, including their Japanese text.
Overview
As its name suggests, ERC721A builds on ERC721.
See the following article for ERC-721.
For a more detailed explanation of ERC721A, see the following article.
Differences Between ERC-20 and ERC-721

First, consider the differences between ERC-20 and ERC-721.

ERC-20
Units are interchangeable. Money is a familiar example.
ERC-721
Each token has its own identity, so units are not necessarily interchangeable on a one-for-one basis. An artwork is a familiar example.
See the following article for ERC-20.

Each ERC-721 token has a unique token ID within its contract. Tokens with different IDs can represent different assets and need not have equal value.

Another way to express the distinction is that ERC-20 records who holds how much, whereas ERC-721 records who owns which token. This reflects the difference between fungible and non-fungible tokens.
ERC721Enumerable
This section introduces the ERC-721 enumeration extension, ERC721Enumerable.


ERC721Enumerable makes it possible to enumerate the NFTs owned by a particular address, at the cost of additional gas consumption.
The core ERC-721 interface does not directly provide a function for listing all tokens owned by an address. ERC721Enumerable adds this functionality, but certain operations become more expensive.

There are two associated challenges.
More data updates
To support owner enumeration, operations must update additional ownership-index data.
Higher gas costs
Writing additional data to storage increases gas consumption.

When minting an NFT, the implementation maintains information such as:
- The total number of minted tokens currently represented in the enumerable collection.
- The number of tokens owned by an address.
- Which tokens an address owns and how to enumerate them.
ERC-721 itself requires balance and ownership queries, but it does not require maintaining enumeration indexes or a total-supply query. ERC721Enumerable's additional bookkeeping increases the amount of storage work.

The diagram illustrates minting three NFTs. The numbers in blue represent the total minted supply; the numbers in white represent an address's token balance. These values are updated as tokens are minted.

Updating data for each mint consumes gas each time.

This raises a question: could the updates be grouped rather than performed individually for every token? That is the intuition behind batch-oriented storage optimization.
What Is ERC721A?

ERC721A is an ERC-721 implementation optimized for gas-efficient minting, especially of multiple tokens at once.

It was introduced by the NFT project Azuki (the original article speculates that the A in ERC721A refers to Azuki).
Conventional ERC721Enumerable minting implementations perform per-token bookkeeping. Multiple NFTs can still be minted in one transaction using a batch function, but each token typically requires individual storage updates.
ERC721A allows multiple NFTs to be minted in a single transaction while reducing this repeated storage work. This is especially useful for generative NFT collections where one address mints several consecutive token IDs.

The figure compares the gas costs of ERC721Enumerable and ERC721A. The difference becomes more pronounced as the number of NFTs minted increases.
How ERC721A Works
Addresses Associated with NFTs

In a conventional ERC-721 implementation, each token ID has an explicitly recorded owner address.

With ERC721A, when consecutive token IDs are minted together, ownership information can be recorded only at selected positions in the range.

In the diagram, address 0xA... owns tokens with IDs 1 through 5, but only the first token ID has an explicitly initialized ownership record.
This is a key mechanism behind gas savings. A conventional per-token ownership mapping needs five ownership writes, whereas ERC721A can initialize ownership for the entire consecutive mint range with one ownership write.
Other state, including balances and supply-related counters, still needs to be updated. Nonconsecutive ownership ranges require their own records.
Enumerating NFTs Owned by an Address

An enumeration helper can scan token IDs in order and identify tokens belonging to the requested address.
Token ID 2 in the figure has no directly initialized ownership record. Its most recent preceding initialized ownership record belongs to 0xA..., so its owner can be inferred as that address.
The same principle determines the owner of token ID 6.
Changes in Ownership
Consider what happens when an NFT is sold or transferred to another address.

Suppose token ID 3 is transferred from 0xA... to 0xC....

Updating only token ID 3 is insufficient. Token IDs 4 and 5 do not have explicit ownership records, so they would incorrectly inherit the newly initialized ownership of token ID 3.

To prevent this, after changing token ID 3's ownership, token ID 4 must be explicitly associated with 0xA... if its ownership is not already initialized. This preserves the ownership of the remaining range.
Summary

ERC721A supports efficient batch minting and can provide ownership enumeration through scanning-based helpers, such as the optional queryable extension rather than the core ERC-721 interface itself.
My interpretation is that ERC721Enumerable favors efficient indexed reads, while ERC721A reduces storage writes during batch minting.
ERC721Enumerable maintains arrays and indexes describing which addresses own which token IDs, allowing indexed retrieval. Maintaining those indexes requires additional writes.
ERC721A reduces repeated ownership writes, but enumeration may require scanning token IDs. The time required depends on the collection size and implementation.
Off-chain read calls do not require the caller to pay transaction gas, although they consume computation and are subject to RPC limits. On-chain reads do consume gas. For collections that prioritize batch minting and perform enumeration off-chain, ERC721A can offer significant advantages.
Conclusion
This article introduced ERC721A and its storage optimization strategy. I plan to add implementation details in a future update.
If you have questions, feel free to contact me on Twitter.

