What is ERC-721?
ERC-721 is the technical standard for non-fungible tokens (NFTs) on Ethereum. Unlike ERC-20 tokens (where every token is identical), each ERC-721 token is unique and has its own distinct token ID. This makes them perfect for representing ownership of digital art, collectibles, game items, real estate, and any other unique asset.
ERC-721 was proposed by William Entriken, Dieter Shirley, Jacob Evans, and Nastassia Sachs in January 2018 (EIP-721). It powered the 2021 NFT boom, enabling collections like CryptoPunks, Bored Ape Yacht Club, and NBA Top Shot.
The NFT market peaked at $17 billion in trading volume in 2021, with ERC-721 being the dominant standard.
How ERC-721 Differs from ERC-20
| Feature | ERC-20 (Fungible) | ERC-721 (Non-Fungible) |
|---|---|---|
| Token interchangeability | All tokens are identical | Each token is unique |
| Token ID | Not applicable | Each has a unique uint256 ID |
balanceOf | Returns total amount | Returns count of distinct tokens |
| Transfer | Any amount | One specific token ID at a time |
| Use case | Currency, governance | Art, collectibles, game items |
| Metadata | Minimal (name, symbol) | Rich (image, attributes, traits) |
The ERC-721 Interface
Core Functions
// Basic info
function name() public view returns (string) // "Bored Ape Yacht Club"
function symbol() public view returns (string) // "BAYC"
// Ownership
function ownerOf(uint256 tokenId) public view returns (address)
function balanceOf(address owner) public view returns (uint256)
// Transfer
function transferFrom(address from, address to, uint256 tokenId) public
function safeTransferFrom(address from, address to, uint256 tokenId) public
// Approvals
function approve(address to, uint256 tokenId) public
function getApproved(uint256 tokenId) public view returns (address)
function setApprovalForAll(address operator, bool approved) public
function isApprovedForAll(address owner, address operator) public view returns (bool)
Key Difference: safeTransferFrom
The safeTransferFrom function checks that the recipient is capable of handling NFTs (either a smart contract implementing onERC721Received, or a regular wallet). This prevents tokens from being accidentally sent to contracts that can’t manage them — a common cause of lost NFTs.
Token Metadata
The most important feature of ERC-721 is metadata — the JSON data describing each token’s appearance and attributes:
{
"name": "Bored Ape #1",
"description": "Bored Ape Yacht Club Collection",
"image": "ipfs://QmZkN.../1.png",
"attributes": [
{ "trait_type": "Fur", "value": "Golden Brown" },
{ "trait_type": "Eyes", "value": "Bored" },
{ "trait_type": "Mouth", "value": "Bored Unshaven" },
{ "trait_type": "Background", "value": "Orange" }
]
}
On-Chain vs Off-Chain Metadata
| Storage | How It Works | Pros | Cons |
|---|---|---|---|
| On-chain | Metadata stored in the contract | Permanent, immutable | Very expensive (gas costs) |
| IPFS | Metadata on decentralized storage | Cheaper, persistent | Can be slow, relies on IPFS pinning |
| Centralized | Metadata on AWS/regular server | Fast, easy | Server goes down → NFT has no image |
Most major collections use IPFS or Arweave for metadata storage. CryptoPunks and Art Blocks use on-chain storage (all image data is in the contract), making them truly permanent.
The ERC-721 Metadata Standard
function tokenURI(uint256 tokenId) public view returns (string)
This returns a URL pointing to the token’s metadata JSON. Marketplaces like OpenSea read this URI to display the NFT’s image, name, and attributes.
How NFTs Are Created (Minting)
Standard Minting
- Deploy contract: Creator deploys an ERC-721 contract with max supply (e.g., 10,000)
- Mint function: Users call
mint()and pay a mint price (e.g., 0.08 ETH) - Token ID assigned: Contract assigns the next sequential token ID
- Metadata generated: Random traits are assigned (fur, eyes, background, etc.)
- Transfer: NFT is sent to the minter’s address
Reveal Mechanism
To prevent front-running (minting the rarest NFTs first), many collections use a blind mint followed by a reveal:
- During mint: Token URIs are hidden or point to placeholder images
- After sellout: Creator commits a pre-determined hash to prove no manipulation
- Reveal: Token URIs are updated with actual metadata, randomized via the commit hash
Popular ERC-721 Collections
| Collection | Floor Price | Supply | Notable Features |
|---|---|---|---|
| CryptoPunks | 30-60 ETH | 10,000 | First major NFT collection (2017), on-chain art |
| Bored Ape Yacht Club | 10-20 ETH | 10,000 | Commercial rights for holders |
| Pudgy Penguins | 5-10 ETH | 8,888 | IP licensing, physical toys |
| Azuki | 5-10 ETH | 10,000 | Anime art style, Bean ecosystem |
| Doodles | 1-3 ETH | 10,000 | Colorful art, burn mechanics |
| Miladys | 2-5 ETH | 10,000 | Cult following, remilio spin-offs |
| Moonbirds | 0.5-2 ETH | 10,000 | Nesting mechanics (was popular, crashed) |
ERC-721 Extensions
| Extension | Purpose |
|---|---|
| ERC-721A (Azuki) | Batch minting — dramatically reduces gas for minting multiple NFTs |
| ERC-721Enumerable | On-chain enumeration of all tokens |
| ERC-4907 | Rentable NFTs (separate “user” from “owner”) |
| ERC-6551 | NFTs that own wallets (Token Bound Accounts) |
Frequently Asked Questions
Q: Can I create my own NFT collection? A: Yes. Use OpenZeppelin Wizard to generate an ERC-721 contract, or use no-code platforms like Manifold or Thirdweb. Deployment costs ~$50-200 on Ethereum, <$1 on L2s.
Q: What happens if the metadata server goes down? A: Your NFT still exists on-chain, but it may display as a blank image if the metadata/image is hosted on a centralized server. This is why IPFS/Arweave storage is preferred for permanence.
Q: Can an NFT be copied? A: Anyone can right-click and save the image, but they can’t replicate the on-chain ownership. The value of an NFT comes from verifiable provenance (proof of ownership and authenticity), not from the image itself.