ERC-721 (NFT Token Standard)
The standard for unique tokens, one owner per token id.
Basically
ERC-721 is a shared set of rules on Ethereum for digital items that are not interchangeable. Each item, called a non-fungible token or NFT, has a unique ID and its own ownership record.
Key Takeaways
- ERC-721 is the Ethereum token standard for non-fungible tokens. Each token has a unique ID, exactly one owner at any time, and an on-chain ownership record that anyone can verify without trusting a central authority.
- ERC-20 tokens are interchangeable, while ERC-721 tokens are individually distinct. The standard defines core functions such as ownerOf, transferFrom and approve, plus optional extensions for metadata and enumeration.
- ERC-721 powers the entire NFT ecosystem on Ethereum, including digital art, gaming items, event tickets and real-world asset tokenisation. ERC-721 introduced the safeTransferFrom pattern, which prevents tokens from being permanently locked in incompatible contracts.
What Is ERC-721?
ERC-721 (Ethereum Request for Comments 721) is a technical standard that defines a shared interface for creating and managing non-fungible tokens (NFTs) on the Ethereum blockchain. William Entriken, Dieter Shirley, Jacob Evans and Nastassia Sachs authored it, with the proposal made in January 2018 and finalised as EIP-721 in June 2018. Shirley was CTO of Dapper Labs and co-creator of CryptoKitties.
The word "fungible" means interchangeable: one ERC-20 token is identical to any other token of the same type, just as one dollar bill is worth the same as any other dollar bill. ERC-721 reverses that idea by giving each token a unique identifier, a uint256 token ID, with exactly one address owning each token at any given time. The smart contract maps token IDs to owner addresses, creating a verifiable ownership ledger.
The standard emerged from the CryptoKitties phenomenon in late 2017, when a collectible cat-breeding game generated enough transaction volume to congest the entire Ethereum network. CryptoKitties showed massive demand for unique digital assets, but no shared interface for non-fungible tokens existed, so each project implemented its own transfer and ownership logic. ERC-721 standardised that logic, allowing any compliant token to work with any compatible wallet, marketplace or application.
How It Works
An ERC-721 contract is deployed to Ethereum and keeps an internal mapping of token IDs to owner addresses. A newly minted token receives a unique ID, with the contract recording the creator as its initial owner. Transfers update the mapping and emit on-chain events, which marketplaces, wallets and block explorers index to display ownership history.
The standard inherits from ERC-165, which lets contracts declare which interfaces they support. Other contracts can therefore query whether an address implements ERC-721 before trying to interact with it.
Core Interface
Every ERC-721 contract must implement these functions: Together, they form the contract's required interface.
The key difference from ERC-20 is what each standard tracks: ERC-20 maps addresses to balances, showing how many tokens an address holds, while ERC-721 maps token IDs to addresses, showing who owns each specific token. The balanceOf function returns a count, but you cannot determine which specific tokens an address owns without the enumerable extension.
Events
Three events must be emitted so off-chain applications can track ownership changes. Off-chain applications use these events to follow token activity.
Minting emits a Transfer event with the from address set to 0x0, while burning emits a Transfer event with the to address set to 0x0. These conventions let indexers and block explorers track the entire lifecycle of every token.
The safeTransferFrom Pattern
The safeTransferFrom function is one of ERC-721's main innovations, calling a special callback on the recipient when a token is transferred to a smart contract address. The callback gives the recipient a way to confirm that it can receive the token.
The recipient contract must implement onERC721Received and return the specific magic value 0x150b7a02 to confirm it can handle NFTs. The transfer reverts if the recipient does not implement this function or returns the wrong value. That check prevents tokens from being permanently locked in contracts with no way to transfer them out, a problem that has caused millions of dollars in ERC-20 token losses where no equivalent safety check exists.
Approval Mechanics
ERC-721 provides two levels of approval for delegating transfer rights. These approvals let you give another address permission to transfer your tokens.
Metadata Extension
The optional ERC721Metadata extension adds three functions that most implementations include. These functions provide metadata for tokens.
The tokenURI function links NFTs to their visual content. It returns a URI, typically an HTTPS or IPFS URL, pointing to a JSON file that follows a standard schema:
The image field points to the actual media. The attributes array is not part of the original ERC-721 specification, but OpenSea's metadata format made it a de facto standard, enabling trait-based filtering and rarity calculations in marketplaces.
Most NFTs therefore store only a pointer on-chain, not the media itself. The token still exists on-chain if the external storage, whether a centralised server, IPFS pinning service or Arweave, goes offline, but it points to nothing. Bitcoin Ordinals differ fundamentally because they inscribe the entire content directly into the blockchain.
Enumerable Extension
The optional ERC721Enumerable extension adds on-chain token listing capabilities. You can use these capabilities to list tokens directly on-chain.
These functions enable on-chain enumeration of all tokens or all tokens owned by a specific address. Without this extension, you cannot iterate through tokens on-chain, so applications must index Transfer events off-chain instead.
The trade-off is gas cost, because maintaining enumeration data structures adds significant overhead to minting and transfer operations. Many modern NFT contracts, including popular implementations such as ERC-721A, omit the enumerable extension to reduce gas fees and rely on off-chain indexing instead.
Gas Costs
ERC-721 operations use more gas than ERC-20 operations because they update more state variables per transaction. Typical costs vary by implementation:
Optimised implementations such as ERC-721A, developed by Azuki, sharply reduce batch minting costs by deferring ownership record updates. ERC-721A writes a single owner record for consecutive token IDs and resolves ownership lazily during transfers, rather than writing an owner for each token individually. The result can be an 80% or greater reduction in per-token mint cost for large batches.
ERC-721 vs ERC-20
The fundamental difference is fungibility. Each ERC-20 unit is identical and fungible, while each ERC-721 token is unique and non-fungible.
ERC-721 vs ERC-1155
ERC-1155, proposed by Witek Radomski in 2018 and finalised in 2019, introduced the multi-token standard. A single ERC-1155 contract can manage fungible and non-fungible token types simultaneously, with a configurable supply for each token ID. A supply of one creates a non-fungible token, while a supply of millions creates a fungible token.
The key advantage is batch operations through safeBatchTransferFrom, which transfers multiple token types in a single transaction. A player trading dozens of gaming items at once pays significantly less than when calling transferFrom individually for each ERC-721 token. ERC-1155 also reduces deployment costs because one contract replaces what would otherwise require separate ERC-20 and ERC-721 deployments.
ERC-721 vs Bitcoin Ordinals
Ordinals, launched by Casey Rodarmor in January 2023, brought NFT-like functionality to Bitcoin. Its architecture is fundamentally different from ERC-721:
Ordinals inscriptions are fully immutable and self-contained, with no external dependencies, admin keys or smart contract logic. ERC-721 offers more flexibility through programmable contracts but relies on external storage for media content. You can read the research article on Bitcoin Ordinals and BRC-20 evolution for a deeper comparison.
The NFT Market and ERC-721 Adoption
CryptoKitties launched in November 2017 and catalysed the creation of ERC-721. The game's popularity caused significant congestion on Ethereum, demonstrating both demand for unique digital assets and the need for a standardised approach.
The NFT market exploded in 2021, with trading volume surging from roughly $95 million in 2020 to approximately $24.9 billion in 2021. Beeple's "Everydays: The First 5,000 Days" sold at Christie's for $69.3 million in March 2021. Bored Ape Yacht Club launched in April 2021 at a mint price of 0.08 ETH, with floor prices eventually peaking at roughly 152 ETH in early 2022, while monthly NFT sales volume hit $4.6 billion in January 2022.
The correction was severe, with trading volumes falling 97% by September 2022, but the technology continued evolving. NFTs expanded beyond speculative collectibles into ticketing, identity credentials, gaming assets and real-world asset tokenisation. ERC-721 remains the foundational standard powering these applications.
Digital Art and Collectibles
The original and most visible use case is digital art and collectibles. Artists deploy ERC-721 contracts to mint provably scarce digital works, and collectors verify authenticity and provenance directly on-chain. Established collections such as CryptoPunks and Art Blocks generative art continue to trade as digital artefacts with verifiable ownership histories.
Gaming
ERC-721 gives players true ownership of in-game items, including weapons, characters, land and cosmetics that exist independently of any single game server. Players can trade items on secondary markets or transfer them between compatible games. The standard gives each item a unique identity, which matters for items with distinct attributes, histories or upgrade levels.
Event Ticketing and Membership
NFT-based tickets solve counterfeiting through on-chain verification, with each ticket represented by a unique ERC-721 token and a verifiable owner. Smart contract logic can enforce transfer restrictions to prevent scalping, enable royalty payments on resales and provide post-event utility as digital memorabilia.
Real-World Asset Tokenization
ERC-721 tokens can represent ownership of physical assets, including real estate deeds, vehicle titles, fine art certificates and intellectual property licences. Each asset receives a unique token ID, and the ownership record provides a transparent, auditable chain of title. The RWA tokenisation market continues growing as regulatory frameworks mature.
Digital Identity and Credentials
Non-transferable ERC-721 tokens, sometimes called soulbound tokens, can serve as tamper-resistant credentials for diplomas, professional certifications and membership passes. The on-chain record provides verifiable provenance without depending on a centralised issuer remaining operational.
Why It Matters
ERC-721 established the foundational primitive for digital ownership on programmable blockchains. Its standard interface created a network effect: any ERC-721 token automatically works with any compatible wallet, marketplace or application. That composability enabled an ecosystem of NFT marketplaces, creator tools and DeFi integrations, such as NFT-collateralised lending, to emerge without bilateral agreements between projects.
The model influenced token standards on other chains, with Solana, BNB Chain and other EVM-compatible networks adopting ERC-721-compatible interfaces. Bitcoin's Ordinals protocol serves a similar purpose of enabling unique digital assets, despite its different architecture. Layer 2 solutions such as Spark reduce the cost of digital asset transfers, making token-based applications more practical for everyday use cases.
Reentrancy via safeTransferFrom
The onERC721Received callback that makes safeTransferFrom safe also creates a reentrancy vector by executing arbitrary code in the recipient's context when a contract receives a token. A malicious recipient contract can use this callback to re-enter the sending contract before the transfer fully completes, potentially manipulating state in unexpected ways. Contracts that mint or transfer ERC-721 tokens must follow the checks-effects-interactions pattern or use reentrancy guards.
Approval Risks
The setApprovalForAll function grants an operator blanket permission to transfer every token an address owns, which is how marketplaces operate but also creates a significant attack surface. Phishing attacks that trick users into signing setApprovalForAll transactions for malicious contracts remain one of the most common NFT theft vectors. Unlike per-token approvals, operator approvals persist until explicitly revoked.
Metadata Permanence
Most ERC-721 implementations store metadata off-chain, so the content associated with an NFT can disappear if the hosting service goes offline. IPFS provides content-addressed storage but requires pinning services to remain operational, while Arweave offers permanent storage at a one-time cost. Some collections store metadata fully on-chain as base64-encoded SVGs or JSON, but this approach is prohibitively expensive for high-resolution media.
Gas Costs for Large Collections
Deploying a large ERC-721 collection can be expensive, with individually minting 10,000 tokens costing between 500 million and 1.5 billion gas in total. Optimised implementations such as ERC-721A sharply reduce batch minting costs, but the standard itself does not include batch operations. ERC-1155, by contrast, natively supports batch minting and transfers.
The glossary entry is for informational purposes only and does not constitute financial or investment advice. You should always do your own research before using any protocol or technology.