NFTs and ERC-721: Unique Tokens, Metadata, Minting, IPFS and Marketplace Basics

Blockchain Developer 55 min min read Updated: Nov 17, 2026 Intermediate
NFTs and ERC-721: Unique Tokens, Metadata, Minting, IPFS and Marketplace Basics
Intermediate Topic 3 of 3

Fungible Versus Non-Fungible

Fungible (ERC-20)Non-fungible (ERC-721)
UnitsAll identicalEach token has a unique ID
Example100 rupee notesA concert ticket with a seat number
BalanceA numberA list of token IDs you own

What an NFT Really Stores

  • The chain stores who owns token ID N and a token URI (a link)
  • The link points to metadata JSON that describes the item and links to an image
  • Large files are not stored on-chain because it is too costly. They are usually on IPFS or similar storage

Metadata Example

json { "name": "Campus Badge #1", "description": "Awarded for finishing the blockchain course.", "image": "ipfs://EXAMPLE_CID/badge1.png", "attributes": [ { "trait_type": "Level", "value": "Beginner" } ] }

IPFS in One Line

IPFS addresses files by a hash of their content (CID), so the link changes if the file changes. You still need someone to pin the file so it stays available.

A Mintable NFT Contract

solidity // SPDX-License-Identifier: MIT pragma solidity ^0.8.24; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract CampusBadge is ERC721URIStorage, Ownable { uint256 private _nextId; constructor() ERC721("Campus Badge", "BADGE") Ownable(msg.sender) {} function mint(address to, string memory uri) external onlyOwner returns (uint256) { uint256 id = _nextId++; _safeMint(to, id); _setTokenURI(id, uri); return id; } }
  • _safeMint checks that a receiving contract can handle NFTs
  • ownerOf(id) tells the owner. transferFrom and safeTransferFrom move tokens
  • tokenURI(id) returns the metadata link

Related Standards

StandardUse
ERC-1155One contract with many token types, fungible and non-fungible. Good for games
ERC-2981Standard way to signal royalty information (marketplaces may or may not honor it)

Honest Notes

  • Owning an NFT usually means owning the token, not copyright of the artwork
  • If metadata sits on a normal web server that goes offline, the NFT may lose its image
  • Prices can be very volatile. This is a technology lesson, not investment advice

Useful Non-Art Uses

  • Event tickets and passes
  • Course completion certificates
  • Membership cards
  • In-game items
  • Proof of ownership for real-world assets (with legal support)

Practice

  1. Mint two badges and call ownerOf and tokenURI
  2. Why is the image usually not stored on-chain?
  3. What is the difference between ERC-721 and ERC-1155?

Conclusion

ERC-721 tokens are unique. The chain stores ownership and a URI, while the image and details live in metadata, usually on IPFS.

Quick Summary: NFT vs fungible; stored data; metadata; IPFS; contract; standards; notes; uses.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators