NFTs, Tokens, and ERC Standards
This lesson covers how Ethereum standardizes different kinds of assets, so that wallets, exchanges, and applications can all interoperate with a new token or NFT collection without custom, one-off integration work for every new asset that gets created.
Why standards matter. Without a shared standard, every new token would need every wallet, exchange, and application that wants to support it to write custom code specifically for that token's unique interface. ERC (Ethereum Request for Comment) standards solve this by defining a common set of functions every compliant token must implement, so that any wallet or application that already supports the standard automatically supports any new token built to it, with zero additional integration work. This is itself a concrete instance of the composability property covered in the DeFi lesson: a shared standard is what makes a new token instantly usable across an entire existing ecosystem of wallets and applications, rather than requiring its own bespoke infrastructure.
ERC-20: fungible tokens. ERC-20 is the standard for fungible tokens — assets where every unit is interchangeable with every other unit, the same way one dollar bill is interchangeable with any other dollar bill. Stablecoins, governance tokens, and most tokens traded on decentralized exchanges are ERC-20 tokens. The standard defines functions like transfer (move a specified amount from the sender to a recipient), balanceOf (check an address's balance), and approve (grant another address or contract permission to move a specified amount on the holder's behalf, as covered in Module 4's lesson on using ETH safely).
ERC-721: non-fungible tokens. ERC-721 is the standard for NFTs — unique, individually identified assets where each token has its own distinct identity, unlike ERC-20's interchangeable units. NFTs are used for digital art, collectibles, event tickets, in-game items, and increasingly for identity or membership credentials. The standard defines functions like ownerOf (given a specific token ID, return its current owner) and transferFrom (move a specific, uniquely identified token from one owner to another) — notice the contrast with ERC-20's transfer, which moves an amount rather than a specific identified item.
ERC-1155: a hybrid standard. ERC-1155 allows a single contract to manage both fungible and non-fungible items efficiently within one deployment — useful, for example, for a game that needs both interchangeable in-game currency (fungible) and unique collectible items (non-fungible) without deploying and maintaining two entirely separate contracts. A further practical benefit of ERC-1155 is batch operations: it allows transferring several different token types in a single transaction, which can meaningfully reduce the total gas cost compared to performing several separate ERC-20 or ERC-721 transfers one at a time.
What an NFT actually stores, and what it typically doesn't. It's worth being precise about what an ERC-721 token contains on-chain: typically just a token ID and a pointer, called a metadata URI, to where the token's descriptive data (name, image, attributes) actually lives. For many NFT collections, that underlying image or file is stored off-chain, on a traditional web server or a decentralized storage network, rather than directly inside the blockchain itself — the blockchain record is the verifiable proof of ownership and the pointer, not necessarily the full underlying file. This distinction matters when evaluating an NFT project's durability: a pointer to off-chain storage that disappears means the metadata could become inaccessible even though the ownership record itself remains intact on-chain.
Why the distinction matters beyond terminology. Understanding whether an asset is fungible or non-fungible tells you directly how it can be used and valued. Fungible tokens can be meaningfully priced per unit and traded in bulk against a liquidity pool, as covered in the DeFi lesson. Non-fungible tokens must be valued and traded individually, since no two are interchangeable by definition — even within the "same collection," each token typically carries its own specific attributes, history, and market value.
Worked Example
Look at a verified ERC-20 contract and a verified ERC-721 contract side by side on a block explorer. The ERC-20 contract's code will include a transfer(address to, uint256 amount) function — moving an amount, with no concept of individual item identity. The ERC-721 contract's code will include a transferFrom(address from, address to, uint256 tokenId) function — moving one specific, uniquely identified token. This single difference in function signature reflects the entire conceptual distinction between fungible and non-fungible assets. Looking further at the ERC-721 contract's tokenURI function for a specific token ID also shows directly where that token's metadata actually points to, confirming whether it's stored on-chain or off-chain.
Exercise
Find one ERC-20 token and one ERC-721 (NFT) collection on a block explorer. Write one sentence for each explaining what makes it fungible or non-fungible, based on what you see in its contract's functions or its metadata.
Recap
- ERC standards let wallets and applications support any new compliant token automatically, without custom integration for each one, which is composability applied directly to tokens.
- ERC-20 governs fungible tokens (interchangeable units, like stablecoins); ERC-721 governs non-fungible tokens (unique, individually identified assets, like most NFTs); ERC-1155 allows a single contract to manage both and supports efficient batch transfers.
- Whether an asset is fungible or non-fungible directly determines how it can be traded and valued — in bulk against a pool, versus individually by specific item — and many NFTs point to off-chain metadata rather than storing the full underlying file on-chain.