Tutorialbeginner

    A Beginner’s Guide to ERC-20 and ERC-721 (Cryptocurrenc

    Explains the ERC-20 standard for fungible tokens and the ERC-721 standard for NFTs, how they work, and what they power on Ethereum.

    24 min read

    Updated 25 May 2026

    A Beginner’s Guide to ERC-20 and ERC-721 (Cryptocurrenc
    Level 1 · FoundationsNo prior crypto knowledge needed.
    Ethereum Basics
    1 to read first · 3 next steps
    # A Beginner’s Guide to ERC-20 and ERC-721 (Cryptocurrencies) Figure 1: Visual representation of ERC-20 transfer and approval processes. A user (sender) can directly transfer tokens or approve a dApp (spender) to transfer tokens on their behalf.

    ERC-721: The Standard for Unique Ownership

    ERC-721, in stark contrast to ERC-20, deals with *non-fungible* tokens. Each ERC-721 token has a unique ID and is distinct from every other token. Think of it like a deed to a house or a specific piece of artwork. Your Picasso isn't interchangeable with my Da Vinci, even if they're both valuable. This uniqueness is what makes ERC-721 ideal for representing digital collectibles, art, gaming assets, unique identifiers, and even tokenized real-world assets. Unlike ERC-20 where balances are tracked per address, ERC-721 tracks ownership of specific token IDs. So, instead of `balanceOf(address _owner)` returning a quantity, it tells you *how many* unique NFTs an address holds, and you can then query `ownerOf(uint256 _tokenId)` to find out *who owns a specific token ID*.

    Key Functions of an ERC-721 Token Contract:

    An ERC-721 contract *must* implement the following functions and emit events, many of which mirror ERC-20 but with crucial distinctions:
    1. name(): Returns the name of the NFT collection (e.g., "Bored Ape Yacht Club").
    2. symbol(): Returns the symbol of the collection (e.g., "BAYC").
    3. balanceOf(address _owner): Returns the number of ERC-721 tokens owned by _owner. Note: this is a *count* of unique tokens, not a quantity of fungible units.
    4. ownerOf(uint256 _tokenId): Returns the address of the owner of a specific token _tokenId. This is a critical function for verifying ownership.
    5. transferFrom(address _from, address _to, uint256 _tokenId): Transfers ownership of _tokenId from _from to _to. This is the primary transfer mechanism for ERC-721. Unlike ERC-20, there's no direct transfer function by the owner, only `transferFrom` (or its safer variants).
    6. approve(address _to, uint256 _tokenId): Grants approval for _to to manage (transfer) a specific _tokenId on behalf of the owner.
    7. getApproved(uint256 _tokenId): Returns the address approved for a specific _tokenId.
    8. setApprovalForAll(address _operator, bool _approved): Allows an owner to approve *all* of their tokens for an _operator (e.g., a marketplace like OpenSea).
    9. isApprovedForAll(address _owner, address _operator): Returns if _operator is approved for all of _owner's tokens.
    10. tokenURI(uint256 _tokenId): Returns a URI pointing to a JSON document that describes the token's metadata (e.g., name, description, image, traits). This is how wallets and marketplaces display relevant information about the NFT.

    Essential Events:

    1. Transfer(address indexed _from, address indexed _to, uint256 indexed _tokenId): Emitted when ownership of any NFT changes.
    2. Approval(address indexed _owner, address indexed _approved, uint256 indexed _tokenId): Emitted when an owner approves a specific NFT for another address.
    3. ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved): Emitted when an operator is approved or unapproved for all NFTs of an owner.
    Figure 2: The role of tokenURI in linking an ERC-721 token's on-chain ID to its off-chain metadata (image, attributes), typically stored on IPFS or similar decentralized storage.

    Beyond the Basics: ERC-1155 (Multi-Token Standard)

    While ERC-20 and ERC-721 are foundational, the ecosystem continually evolves. ERC-1155, proposed by Enjin, emerged to solve limitations of both. It allows a single smart contract to manage *multiple* types of tokens, both fungible and non-fungible. Imagine a game where swords (unique NFTs), gold coins (fungible tokens), and crafting materials (semi-fungible) can all be managed by one contract. This reduces deployment costs and complexity, and is seeing increasing adoption in gaming and multi-asset environments.

    Industry Ecosystem: Powering the Decentralized World

    The impact of ERC-20 and ERC-721 is hard to overstate. They didn't just facilitate the creation of tokens; they catalyzed entire industries and redefined how we interact with digital value. From DeFi's complex financial instruments to the explosive growth of NFTs, these standards are the unsung heroes.

    ERC-20's Dominance in Decentralized Finance (DeFi)

    When we talk about DeFi, we are, to a very large extent, talking about ERC-20 tokens. The entire DeFi ecosystem, with its current market cap often fluctuating around the $40-60 billion mark (according to recent CoinGecko data for the sector), is built on these fungible tokens. Consider the following: * Decentralized Exchanges (DEXs): Protocols like Uniswap, PancakeSwap, and SushiSwap allow users to trade ERC-20 tokens directly from their wallets. Their automated market maker (AMM) model would be inconceivable without the standardization ERC-20 provides. The 24-hour trading volume for DEXs often reaches billions, the vast majority being ERC-20 pairs. * Lending & Borrowing Protocols: Platforms like Aave and Compound enable users to lend and borrow ERC-20 tokens (stablecoins like USDC, Wrapped Bitcoin WBTC, or native governance tokens). These protocols rely on the standard `transferFrom` and `approve` functions to manage collateral and facilitate loans. * Stablecoins: The majority of stablecoins, dollar-pegged cryptocurrencies like USDT, USDC (issued by Centre, a consortium including Circle and Coinbase), and DAI (MakerDAO's decentralized stablecoin), are implemented as ERC-20 tokens. Their ubiquity makes them the liquidity providers for the entire crypto economy. * Wrapped Tokens: Even non-Ethereum assets like Bitcoin can participate in the Ethereum DeFi ecosystem by being "wrapped" into an ERC-20 token, such as Wrapped Bitcoin (WBTC). This bridges liquidity from other blockchains into Ethereum, further boosting the utility of ERC-20. Industry insiders often tell me that without ERC-20, DeFi simply wouldn't have flourished. "It streamlined everything," a lead developer at a major lending protocol once told me. "Before ERC-20, every new token was a custom integration nightmare. Afterward? It was plug and play. That's what enabled the rapid composability we see in DeFi today."

    ERC-721 and the NFT Explosion

    The sheer volume of innovation ignited by ERC-721 is staggering. The **NFT market alone saw transaction volumes consistently exceeding $1-2 billion per month** during its peak and continues to be a vibrant, albeit more mature, sector today. Here's a breakdown of its influence: * Digital Collectibles & Art: Projects like Bored Ape Yacht Club (BAYC) by Yuga Labs, CryptoPunks by Larva Labs (now also acquired by Yuga Labs), and Art Blocks have redefined digital art ownership. ERC-721 provides the irrefutable on-chain proof of authenticity and provenance. * Gaming: The Sandbox and Axie Infinity are prime examples of play-to-earn games where in-game assets (characters, land, items) are tokenized as ERC-721s, allowing true digital ownership and secondary markets. This fundamentally shifts the gaming economic model, giving players skin in the game. * Virtual Land: Platforms like Decentraland and The Sandbox allow users to buy, own, and develop virtual plots of land, all represented as ERC-721 tokens. This has created a vibrant virtual real estate market where plots have traded for millions of dollars. * Ticketing & Loyalty: While still emerging, the use of ERC-721 for verifiable event tickets or unique loyalty badges is promising. Imagine a concert ticket that can't be counterfeited and offers royalties to the artist on resale. Companies like Unlock Protocol are exploring these use cases. The competitive landscape is fierce. NFT marketplaces like OpenSea, Blur, and Rarible constantly innovate to attract users and provide better listing and trading experiences for ERC-721 assets. They are the storefronts for this new wave of digital ownership.

    Real-World Applications: Beyond the Hype

    The practical utility of ERC-20 and ERC-721 extends far beyond speculation and digital art. We're seeing these standards integrate into traditional industries, offering efficiency, transparency, and new business models.

    ERC-20 in Enterprise and Traditional Finance

    While largely seen as a consumer-facing phenomenon, ERC-20 tokens are slowly but surely seeping into enterprise solutions: * Supply Chain Management: Companies are exploring tokenizing goods at various stages of a supply chain. An ERC-20 token could represent 1 kg of coffee beans, for example. This makes tracking, auditing, and transferring ownership incredibly efficient. Imagine a pharmaceutical company ensuring the authenticity of a drug through a tokenized batch number. * Security Tokens: This is a massive potential area. Security tokens represent ownership in real-world assets like real estate, stocks, bonds, or even intellectual property. They are typically regulated and aim to combine the liquidity and transparency of blockchain with the legal framework of traditional securities. While often using modified ERC-20-like standards (like ERC-1400 due to compliance requirements), the underlying fungibility principle is the same. Firms like Polymath and Tokeny Solutions are major players here. * Payments and Remittances: Stablecoins, as mentioned earlier, are incredibly efficient for cross-border payments. Companies like Ripple (though not Ethereum-based) and Circle are actively pursuing this, leveraging the speed and lower costs of blockchain transactions compared to traditional banking rails. I remember speaking with a banking executive a few years back who was initially dismissive of crypto. "It's just internet money for tech geeks," he'd scoffed. But when I showed him how tokenized real estate could reduce settlement times from weeks to minutes, his eyes widened. "Now *that* has potential," he conceded. It's these efficiency gains that drive enterprise adoption, slow though it may be.

    ERC-721 for Digital Identity and Asset Management

    ERC-721's strength lies in its uniqueness, making it invaluable for proving ownership and identity: * Decentralized Identities (DIDs): Imagine your passport or driver's license as an NFT. Projects are exploring ERC-721 for verifiable credentials, where your identity documents could be unique NFTs tied to your blockchain address, giving you sovereign control over your personal data. Companies like SpruceID are at the forefront of this. * Certificates and Degrees: Education institutions could issue degrees and certificates as NFTs. This makes them verifiable, immutable, and easily shareable, fighting credential fraud. Graduating students could receive an ERC-721 token representing their diploma. * Real Estate Tokenization: Beyond security tokens, individual property deeds could be represented as ERC-771 NFTs. Imagine owning a specific apartment unit or a plot of land, with your ownership immutably recorded on the blockchain. This could streamline property transfers and eliminate intermediaries, though regulatory hurdles are significant here. Centrifuge, for example, is making strides in tokenizing real-world assets for DeFi. * Carbon Credits and Environmental Assets: ERC-721 can track unique carbon credits or other environmental assets, ensuring their authenticity and preventing double-counting. This brings unprecedented transparency to environmental markets, a critical need in the fight against climate change. Platforms like Toucan Protocol are active in this space. While the NFT market saw meteoric rises and corrections, the underlying technology of ERC-721 continues to find profound, less glamorous applications. It's a powerful tool for verifiable digital ownership, far exceeding its initial use case in digital art.

    Challenges, Evolution, and the Road Ahead

    No technology is without its challenges, and token standards are no exception. While ERC-20 and ERC-721 have been monumental successes, they face hurdles and continue to evolve.

    Scalability and Gas Fees

    The biggest challenge plaguing both standards on the main Ethereum network is scalability. High network congestion leads to exorbitant gas fees, particularly during periods of high demand (e.g., during an NFT mint or a DeFi liquidity crunch). This makes microtransactions impractical and prices out many users. I've personally paid hundreds of dollars in gas fees for simple operations, which is simply unsustainable for widespread adoption. Solutions are emerging: * Layer 2 Scaling Solutions: Technologies like Arbitrum, Optimism, zkSync, and Polygon (Polygon Labs) provide significant scalability by processing transactions off-chain and then settling them on the main Ethereum chain. Many ERC-20 and ERC-721 tokens now reside or are bridged to these Layer 2s, making them faster and cheaper to use. * Ethereum 2.0 (The Merge and Beyond): While the Merge transitioned Ethereum to Proof-of-Stake, future upgrades like danksharding aim to dramatically increase transaction throughput and reduce costs natively on the Ethereum mainnet. This is a multi-year roadmap, but the vision is clear.

    Interoperability Across Blockchains

    While ERC-20 and ERC-721 standardized tokens *on Ethereum*, a new challenge is interoperability *between* different blockchains (e.g., Ethereum-Solana, Ethereum-Polkadot). Assets are still largely siloed. Cross-chain bridges are becoming more common, but they introduce new security risks, as several high-profile bridge hacks have demonstrated. Projects like Cosmos and Polkadot are tackling this from different architectural angles.

    Expanding Use Cases and Evolving Standards

    The token standards themselves are not static. We've seen the emergence of new EIPs built upon or alongside ERC-20 and ERC-721 to address specific needs: * ERC-4626 (Tokenized Vault Standard): Designed to standardize yield-bearing vaults, making them composable and interoperable within DeFi. This reduces integration headaches for DeFi protocols. * ERC-6551 (Token Bound Accounts): Enables NFTs (ERC-721 tokens) to own other assets, including ERC-20 tokens or even other NFTs. Imagine a CryptoPunk that holds its own ETH, or a gaming character (Bored Ape Yacht Club's ecosystem, for example) that can literally hold its own gear or c within itself. This unlocks entirely new paradigms for digital identity and ownership for NFTs. * Soulbound Tokens (SBTs): Proposed by Vitalik Buterin, SBTs are non-transferable NFTs, tied permanently to an address. They could represent educational credentials, reputation, or membership. Imagine an unforgeable digital resume or proof of participation in a DAO. This is a significant conceptual shift from transferable NFTs. These ongoing developments demonstrate that the crypto ecosystem is incredibly dynamic. What's considered standard today might be part of a richer, more complex tapestry of token types tomorrow. The guiding principle remains the same: standardization drives innovation and adoption.

    Practical Guide: Getting Started with Tokens

    So, after all this technical and historical context, how does one actually interact with ERC-20 and ERC-721 tokens? It's surprisingly straightforward for the end-user, thanks to the very standardization we've been discussing!

    For ERC-20 Tokens (Fungible Assets)

    1. Choose a Wallet: You'll need a non-custodial wallet that supports Ethereum and ERC-20 tokens. Popular choices include MetaMask (browser extension/mobile app), Ledger or Trezor (hardware wallets for added security), or Trust Wallet (mobile). A common setup is a combination of MetaMask for daily dApp interaction and a Ledger for cold storage of significant assets.

      Wallet Security is Paramount!

      Always keep your seed phrase (recovery phrase) utterly private and secure. Never share it, never type it into suspicious websites. Losing your seed phrase means losing all your assets.
    2. Acquire ETH: Since all interactions on Ethereum (sending tokens, signing transactions) require gas, you'll need some Ethereum (ETH) in your wallet. You can buy ETH from exchanges like Coinbase, Binance, or Kraken and then withdraw it to your non-custodial wallet.
    3. Find ERC-20 Tokens: Discover tokens on sites like CoinGecko or CoinMarketCap. These sites provide token contract addresses, which you'll need to add custom tokens to your wallet if they don't appear automatically.
    4. Interact with dApps/DEXs: Connect your wallet to DeFi applications like Uniswap to swap tokens, Aave to lend/borrow, or various staking platforms. Your wallet will prompt you to approve spending limits (using `approve`) or confirm transfers (`transfer`).

    For ERC-721 Tokens (NFTs)

    1. Wallet Choice: The same Ethereum-compatible wallets (MetaMask, Ledger, Trust Wallet) typically support ERC-721 tokens, often displaying them visually within the wallet interface or through a connected marketplace.
    2. Acquire ETH (Again!): NFTs, especially on Ethereum mainnet, carry higher gas fees due to their unique data requirements. You'll need sufficient ETH for minting, buying, or transferring.
    3. Explore Marketplaces: Head to major NFT marketplaces like OpenSea, Blur, or Rarible. Connect your wallet to browse, bid on, or purchase NFTs.
    4. Minting vs. Secondary Market: You can acquire NFTs by "minting" them directly from a project (often during an initial launch) or by buying them on a secondary marketplace. Minting usually involves interacting directly with the project's smart contract, while secondary market purchases use the marketplace's contract (which in turn interacts with the NFT contract).
    5. Viewing and Managing: Most wallets and marketplaces will automatically display your NFTs. You can transfer them to other addresses using the marketplace interface or directly via your wallet if it supports an NFT transfer function.

    Cross-Chain NFT Bridging

    While most NFTs originate on Ethereum, increasingly, marketplaces and bridges allow you to move (or "wrap") NFTs to other chains like Polygon or Solana for lower fees. Be cautious and always use official bridges or trusted platforms for such operations.
    Understanding ERC-20 and ERC-721 is more than just academic; it's practically essential for navigating the modern crypto landscape. These standards are the bedrock upon which the decentralized future is being built, offering a glimpse into a world where digital assets are liquid, transparent, and owned truly by their users.

    Further reading

    Keep learning