Glossary · Tokens

ERC-721 token standard

Published 28 Apr 2025 · Updated 2 Nov 2026 · 14 min read

ERC-721 is the Ethereum standard interface for non-fungible tokens, where one smart contract tracks distinct tokens, each with its own ID and owner. Wallets, marketplaces, and apps read and move them through shared calls. EIP-721 reached Final status in June 2018. Minting and burning are outside its scope, and metadata is optional.

  • ERC-721 approvals cover one token or all holdings, with setApprovalForAll a common phishing target.
  • safeTransferFrom checks receiving contracts, while transferFrom skips the NFT acceptance check.
  • NFT metadata usually lives off chain, where its contents can change or become unavailable.

How ERC-721 tracks ownership

An NFT ownership record maps each token ID to one owner inside a smart contract. On one chain, the contract address and ID identify that asset together. Each uint256 ID stays fixed, with no required numbering pattern. The token's owner, an approved address, or an operator can move it. The Transfer event records changes, including creation from the zero address and destruction to it. These ERC-721 event directions distinguish minting from burning.

Figure 1 · OpenZeppelin Contracts 5.7.0, page team runTest ownership and permissionsChoose Alice, a marketplace, or an attacker, then select a call, token, and recipient. Inspect ownership, permissions, events, errors, and gas.
Sender
Call
Token
Recipient
approve(Marketplace, 7) from Alice
Contract stateMinted
TokenOwnerApproved address#7AliceNone#8AliceNone
No operators approved yet.
Events and errors, newest first
mint(Alice, 8)Transfer(zero address → Alice, 8)Gas: about 51,700mint(Alice, 7)Transfer(zero address → Alice, 7)Gas: about 68,800

Pick a sender, a call, a token and a recipient, then send the transaction.

Alice starts with two tokens. Each creation emitted a Transfer event from the zero address.

The marketplace may move this one token. The owner's other tokens remain outside this permission.

The new operator can move every token the sender owns in this contract, not just the selected ID.

Ownership moved to the recipient, and the token's individual permission cleared without a separate Approval event.

The receiving contract returned 0x150b7a02 from onERC721Received, so the compatibility check passed and ownership changed.

transferFrom succeeded, but this contract cannot move the received NFT, leaving it stuck at that address.

The call failed with an OpenZeppelin error, such as ERC721InsufficientApproval. Ownership and permissions remain unchanged.

Rules, errors, and gas use OpenZeppelin Contracts 5.7.0, run by the page team on a local test chain.

The approve function names one address that may move a particular token. setApprovalForAll gives an operator access to all the owner's tokens in that contract. Every transfer clears the single-token approval. An authorized operator can also assign that permission to another address. Unlike an ERC-20 allowance, this permission has no spendable quantity. ERC-721 authorizes none or one for each token.

The transferFrom function leaves recipient compatibility to the caller, so an NFT can become permanently inaccessible. safeTransferFrom instead calls onERC721Received when the destination has code. Acceptance requires the magic value 0x150b7a02, not merely true, which older contracts could return without implementing the function. OpenZeppelin performs this callback after changing ownership state. The receiver can therefore call back before the surrounding application finishes. A missing function or wrong return value raises ERC721InvalidReceiver in this implementation. A receiver's own revert reason passes through.

ERC-721 functions and events

The Ethereum Request for Comments category includes application standards such as ERC-721. This interface requires nine functions and three events, alongside ERC-165 support. The two safeTransferFrom forms count separately, with one accepting extra data for the recipient. The ERC-165 check must use less than 30,000 gas.

Function or eventWhat it doesA rule from EIP-721
balanceOfWhat it doesCounts the NFTs held by a specified owner addressA rule from EIP-721Queries for the zero address must throw rather than return a balance
ownerOfWhat it doesReturns the current owner address for a specified token IDA rule from EIP-721Queries for an NFT that does not exist must throw
transferFromWhat it doesMoves one NFT without checking the recipient contract's receiving interfaceA rule from EIP-721The caller must be the owner, approved address, or authorized operator
safeTransferFromWhat it doesMoves one NFT and checks acceptance when the recipient has codeA rule from EIP-721A receiving contract must return 0x150b7a02 from onERC721Received
approveWhat it doesSets the single address authorized to move a particular tokenA rule from EIP-721Only the owner or an authorized operator may set this permission
setApprovalForAllWhat it doesEnables or disables an operator's control over all the caller's holdingsA rule from EIP-721The contract must support several operators for each owner
getApproved and isApprovedForAllWhat it doesReads the authorized address for one token or an owner's operator permissionA rule from EIP-721getApproved must throw when the queried NFT does not exist
Transfer eventWhat it doesRecords changes of ownership, including creation and destruction of NFTsA rule from EIP-721All three parameters are indexed, giving each log four topics
Approval and ApprovalForAll eventsWhat it doesRecords permissions for individual tokens and operators across an owner's holdingsA rule from EIP-721Successful approve and setApprovalForAll calls must emit their respective events

How contracts announce ERC-721 support

ERC-721 applications can ask which set of calls a token contract claims to support before interacting with it. ERC-165 provides this check through supportsInterface. Each function signature produces a four-byte selector, taken from the start of its keccak-256 hash. Combining those selectors with XOR gives the interface ID for that set of functions. Applications check core support and optional extensions separately, rather than treating them as one combined interface.

Figure 2 · Selectors from keccak-256, page team calculationCombine selectors into interface IDsTick functions or choose a preset to see individual selectors, their running XOR, and any matching interface ID.
Preset
ERC-721 core
Metadata extension
Enumerable extension
Receiver
ERC-165
Interface IDKnown interface ID0x70a08231 XOR 0x6352211e XOR 0xb88d4fde XOR 0x42842e0e XOR 0x23b872dd XOR 0x095ea7b3 XOR 0xa22cb465 XOR 0x081812fc XOR 0xe985e9c50x80ac58cdThis is the ID of ERC-721 core. An OpenZeppelin ERC721 contract answers supportsInterface(0x80ac58cd) with true.

All nine core functions combine to 0x80ac58cd. Both overloaded safeTransferFrom signatures contribute their own selectors.

The name, symbol, and tokenURI functions combine to 0x5b5e139f, identifying the optional token metadata interface rather than core ownership.

The totalSupply, tokenByIndex, and tokenOfOwnerByIndex functions combine to 0x780e9d63, identifying the optional interface for listing token IDs on chain.

The onERC721Received function produces 0x150b7a02, which also serves as the exact value required to accept a safe delivery.

The supportsInterface function alone produces 0x01ffc9a7. That value identifies ERC-165 itself, rather than any particular asset standard.

This selection matches no listed interface. Omitting safeTransferFrom(address,address,uint256) produces 0xc22876c3 instead of the core ID.

The page team computed selectors with keccak-256 and checked them against the IDs printed in EIP-721 and ERC-165.

The core ERC-721 ID is 0x80ac58cd. Its metadata extension is 0x5b5e139f, and its enumerable extension is 0x780e9d63. The receiver uses 0x150b7a02, while ERC-165 itself uses 0x01ffc9a7. A compliant response must be false for 0xffffffff. ERC-4906 differs because it defines events rather than functions. It uses the fixed interface ID 0x49064906 instead of a selector XOR.

ERC-721 metadata and its storage

Artwork and descriptive data are not part of the required token ownership interface. The optional metadata extension adds name, symbol, and tokenURI. EIP-721's JSON schema defines only name, description, and image. Fields such as attributes and animation_url follow marketplace conventions instead.

Where it livesWhat tokenURI returnsWho keeps the dataWhat can go wrong
HTTPS serverWhat tokenURI returnsHTTPS JSON file addressWho keeps the dataThe server operator hosts the referenced JSON and linked filesWhat can go wrongFiles can change or disappear without changing the token's ownership record
IPFSWhat tokenURI returnsipfs:// followed by a CIDWho keeps the dataParticipants retain copies through the IPFS storage network, including pinned dataWhat can go wrongUnpinned copies eventually disappear, and individual gateways can go offline
ArweaveWhat tokenURI returnsar:// followed by an identifierWho keeps the dataArweave stores the content referenced by the returned URIWhat can go wrongStorage location alone establishes neither authenticity nor rights to content
On-chain data URIWhat tokenURI returnsBase64 JSON data URIWho keeps the dataThe contract returns Base64 JSON directly through its data URIWhat can go wrongPutting all descriptive data on chain increases transaction gas costs

EIP-721 allows a mutable URI, so an NFT's description can change after creation. ERC-4906 provides update events for indexers, not a freeze mechanism. Storing a 66-character IPFS URI through ERC721URIStorage adds about 92,000 gas per token minted in the page team's test. In August 2026, IPFS reports rate limits for hotlinked and backend traffic on two public gateways. Keeping data available and keeping its contents fixed are separate concerns.

Comparing ERC-721, ERC-20, and ERC-1155

Asset models determine which questions an application can ask. The ERC-20 token standard tracks interchangeable quantities, ERC-721 tracks distinct token owners, and ERC-1155 tracks balances for each ID. Similar-looking actions can therefore involve different data, permissions, and transaction counts.

ERC-20ERC-721ERC-1155
What one contract holdsERC-20One fungible token with interchangeable unitsERC-721One collection of distinct tokensERC-1155Multiple token types with separate supplies
Ownership lookupERC-20Balances rather than individual ownersERC-721ownerOf for each individual token IDERC-1155balanceOf(owner, id) and balanceOfBatch
ApprovalsERC-20An allowance spent across multiple callsERC-721One token or all owner holdingsERC-1155All holdings through setApprovalForAll only
Batch transfersERC-20One call moves a fungible amountERC-721No batch transfer in the standardERC-1155Built-in safeBatchTransferFrom for multiple IDs
Receiver checkERC-20No standard receiver checkERC-721Only when using safeTransferFromERC-1155Required for contract recipients, including batches
Typical useERC-20Interchangeable units of one assetERC-721Collectibles with individual token ownership recordsERC-1155Mixed fungible and non-fungible items
Figure 3 · Gas measured by the page teamCompare costs for three tasksPick minting, sending, or marketplace permissions to compare measured gas across implementations and asset models, including both ERC-1155 configurations.
Task
Gas used for the taskGas, one run eachERC-20One mint callOne transferapprove, maximum amount34,22734,50146,678ERC-72110 mints in one transaction10 transactionssetApprovalForAll277,043427,32046,184ERC721Enumerable10 mints in one transaction10 transactionssetApprovalForAll1,177,215767,43046,206ERC-721AOne batch mint10 transactions, fresh batchsetApprovalForAll73,688644,72546,075ERC-1155, 10 IDsOne mintBatch of 10 IDsOne safeBatchTransferFromsetApprovalForAll264,642272,90346,184ERC-1155, 1 IDOne mint of 10 unitsOne safeTransferFromsetApprovalForAll33,35240,02446,184
Lowest33,352ERC-1155, 1 ID, one mint of 10 units
Highest1,177,215ERC721Enumerable, 10 mints in one transaction
Plain ERC-7218.3×Times the lowest figure for this task
Lowest34,501ERC-20, one transfer
Highest767,430ERC721Enumerable, 10 transactions
Plain ERC-72112.4×Times the lowest figure for this task
Lowest46,075ERC-721A, setApprovalForAll
Highest46,678ERC-20, approve, maximum amount
Plain ERC-7211.0×Times the lowest figure for this task

Ten plain ERC-721 mints cost 277,043 gas, compared with 73,688 for an ERC-721A batch in this test.

Sending ten distinct IDs costs 427,320 gas across ten ERC-721 transactions, versus 272,903 for one ERC-1155 batch.

Marketplace approval costs 46,678 gas for ERC-20, compared with 46,184 for both ERC-721 and ERC-1155.

The page team measured gas with OpenZeppelin 5.7.0 and ERC721A 4.3.0 on a local chain, including the 21,000 base cost.

The transaction gas costs reflect what each standard stores and how many transactions a task needs. The ERC-20 mint creates 100 units. Per-token storage makes ERC721Enumerable's existing-holder mint cost 146,038, against 51,659 for plain ERC-721. ERC-721A batches reduce mint writes, but the first transfer of a middle token from a fresh batch costs 90,345. ERC-1155 batches distinguish ten IDs from ten units of one ID. Those mints cost 264,642 and 33,352 respectively.

ERC-721 extensions and implementations

In November 2026, OpenZeppelin Contracts 5.7.0 is the newest GitHub release, while npm tags 5.6.1 as latest. Its ERC721 implementation uses custom errors and the _update hook. The options below add indexing, rentals, royalties, and other behavior. ERC-721A is an implementation, not an EIP.

ExtensionWhat it addsStatusTrade-off or limit
ERC721EnumerableWhat it addsLists every token ID and each owner's holdings directly on chainStatusOptional EIP-721 extension, 2018Trade-off or limitAdds substantial gas overhead and forbids batch minting in OpenZeppelin
ERC-2309What it addsSignals a consecutive token ID range through one ConsecutiveTransfer eventStatusFinal, created 2019Trade-off or limitTransfer must not also be emitted for the same operation
ERC-721AWhat it addsReduces batch mint storage writes to three regardless of quantityStatusImplementation, v4.3.0 March 2024Trade-off or limitStill emits an individual Transfer event for every minted token
ERC-2981What it addsReturns a royalty recipient and amount through royaltyInfoStatusFinal, created 2020Trade-off or limitPayment remains voluntary and depends on the marketplace handling the sale
ERC-4906What it addsSignals changed metadata through MetadataUpdate and BatchMetadataUpdate eventsStatusFinal, created 2022Trade-off or limitNotifies indexers of metadata changes but does not prevent those changes
ERC-4907What it addsSeparates a temporary user role from ownership with an expiryStatusFinal, created 2022Trade-off or limitThe user may use the NFT but cannot transfer it
ERC-5192What it addsDefines minimal soulbound token behavior through the locked statusStatusFinal, created 2022Trade-off or limitEvery transfer function must throw whenever locked(tokenId) returns true
ERC-6551What it addsGives each NFT a smart contract account through a registryStatusReview, not final, created 2023Trade-off or limitSending an NFT to its own token bound account locks its assets

What ERC-721 does not protect against

Shared interfaces make integrations possible, not transactions safe. ERC-721 does not prevent front-running, where searchers can reach a popular NFT drop or mispriced listing first. That behavior falls under maximal extractable value. The following limits concern permissions, execution, and off-chain claims.

Approval phishing

setApprovalForAll exposes all of an owner's tokens in that contract to an operator. Scam Sniffer reports $494 million in drainer losses during 2024 across all asset types, not just NFTs.

Signed listing phishing

Fake marketplace emails can solicit harmful listing signatures. A 20 February 2022 incident affected 28 accounts. SlowMist notes that stolen signatures cannot be revoked through sites such as Revoke.

Receiver callback reentrancy

onERC721Received can reenter unfinished application logic. Omni Protocol lost about $1.4 million on 10 July 2022 through functions lacking reentrancy locks. Omni reported that only internal testing funds were affected.

Tokens at unchecked destinations

A transferFrom call to a contract with neither onERC721Received nor a function to move the token succeeds, and the token stays there. OpenZeppelin's safeTransferFrom would revert with ERC721InvalidReceiver.

Mutable or missing content

An unchanged token owner record cannot guarantee an unchanged image. OpenZeppelin's guide warns that a game developer could change the underlying metadata and, with it, the rules of the game.

Copies and token rights

Names and symbols can be copied. Holding an NFT grants no automatic asset rights or copyright. ERC-2981 payments remain voluntary, including transactions through an NFT aggregator.

How ERC-721 developed over time

The Ethereum Improvement Proposal records a shared interface, while libraries and later ERCs extend its behavior. This timeline separates the original standard's development from changes in implementation, so later features are not mistaken for core requirements.

  1. September 2017

    The original proposal opens

    Dieter Shirley opens GitHub issue #721, titled "ERC: Non-fungible Token Standard". The proposal concerns assets that need separate ownership records.

  2. November 2017

    CryptoKitties launches on Ethereum

    Axiom Zen launches CryptoKitties on 28 November 2017. EIP-721 later lists the project as compatible with an earlier version of the standard.

  3. January 2018

    The interface documents arrive

    ERC-165 is created on 23 January 2018. EIP-721 follows on 24 January 2018, authored by William Entriken, Dieter Shirley, Jacob Evans, and Nastassia Sachs.

  4. June 2018

    ERC-721 reaches Final status

    The standard reaches Final status on 21 June 2018. ERC-1155 is created on 17 June 2018, introducing a separate interface for multiple asset types.

  5. October 2019

    Consecutive event reporting arrives

    ERC-2309 is created on 8 October 2019. It defines a range event for consecutive IDs, rather than requiring an individual event for every item.

  6. January 2022

    Azuki uses batch minting

    Azuki uses ERC-721A for its 12 January 2022 sale of 8,700 tokens. The implementation reduces storage writes while retaining individual ownership-change logs.

  7. October 2023

    Library internals change shape

    OpenZeppelin Contracts 5.0 arrives on 5 October 2023. It replaces revert strings with custom errors and replaces two movement hooks with the internal _update function.

  8. July 2026

    Cross-chain bridge contracts arrive

    OpenZeppelin Contracts 5.7.0 is released on 29 July 2026. The release adds bridge contracts for cross-chain ERC-721 transfers, extending the library beyond its existing ownership implementation.

Decisions for an ERC-721 product

We build NFT contracts around product rules, not just an ERC-721 interface label. Our NFT smart contract development covers ERC-721 and ERC-1155, minting controls, royalty logic, proxy upgrades, and decentralized storage integration. The choices below define how the product behaves beyond basic compatibility. They also identify what marketplaces and indexers need to observe.

PixelPlex case icon

PixelPlex was founded in 2007 and has worked in blockchain since 2013. In our Savage marketplace project from 2021, we built a Polygon marketplace for high-resolution video. Its ERC-721 token contract uses OpenZeppelin Contracts. Files and data were published to the blockchain and IPFS through Pinata.

  1. Base contract and extensions

    We choose the base implementation and extensions alongside product rules. Minting limits, allowlists, and upgradeable proxy patterns define additional product behavior.
  2. Metadata hosting and updates

    Metadata hosting decisions cover storage location, URI mutability, and JSON fields. Update events tell indexers when descriptive content changes.
  3. Permissions and marketplace flows

    Marketplace integration defines when single-item permissions or collection-wide operator access are needed. Signature flows must distinguish listing authorization from contract permissions.
  4. Recipients and callbacks

    Receiver checks and reentrancy guards address different boundaries. We plan both, since a correct magic value does not make surrounding application logic safe.
  5. Events and indexing

    Indexing design accounts for individual Transfer logs and ConsecutiveTransfer ranges. ERC-2309 requires using one event form rather than emitting both for the same operation.

Discuss the requirements behind your NFT product

We can discuss the contract behavior, storage choices, and marketplace integration your project needs to define.

Discuss your requirements

ERC-721 FAQ

What is ERC-721 in simple terms?

ERC-721 is a shared interface for tracking distinct assets and moving them between owners. Each token ID has its own ownership record, rather than representing interchangeable units. Collectibles are one example. Second-level .eth names in the Ethereum Name Service follow ERC-721, while wrapped names use ERC-1155.

How does ERC-721 differ from ERC-20?

ERC-20 tracks interchangeable units, while ERC-721 tracks individual token IDs with distinct owners. An ERC-20 spending allowance can be used across several operations. ERC-721 instead authorizes movement of one item or gives an operator control over all of an owner's holdings. It defines no decimals.

How does ERC-721 differ from ERC-1155?

ERC-1155 can combine fungible and non-fungible types within one contract. It tracks balances per ID and supports batches, rather than providing ownerOf. ERC-721 identifies an individual owner for each token ID. These different data models change ownership queries and transaction structure.

Does ERC-721 work only on Ethereum?

ERC-721 contracts also run on EVM-compatible chains such as Polygon and Base, not just the Ethereum network. NFT activity on Solana and Bitcoin does not use ERC-721. The terms NFT and ERC-721 therefore do not describe the same thing.

Where are an NFT's image and data stored?

An NFT contract's tokenURI can point to external metadata JSON or return a data URI. That JSON can reference an image stored elsewhere. OpenZeppelin's default tokenURI joins a base URI and the token ID, with an empty default. An NFT's image need not live on chain.

Does ERC-721 token ownership include artwork rights or copyright?

ERC-721 token ownership grants no automatic rights to the artwork or its copyright. The US Copyright Office and USPTO report from March 2024 states that nothing inherent to a token transfers associated asset rights. The blockchain's ownership record and ownership of the underlying artwork therefore describe different things.

What happens after transferFrom sends an NFT to a contract?

An NFT sent with transferFrom can become stuck if the receiving contract cannot release it. In ERC-721, the unchecked call does not test onERC721Received. In contrast, safeTransferFrom requires a receiving contract to return the expected magic value or the operation fails.
Sources (35)

Get updates about blockchain, technologies and our company

We will process the personal data you provide in accordance with our Privacy policy. You can unsubscribe or change your preferences at any time by clicking the link in any email.

Follow us on social networks and don't miss the latest tech news

  • facebook
  • X
  • linkedin
  • instagram
Stay tuned and add value to your feed