← Back to Projects
NFT Platform Project
Build Digital Ownership Infrastructure
Problem Statement:
How do we create verifiable digital ownership and scarcity?
Learning Objectives
- Understand ERC-721 and ERC-1155 standards
- Implement proper metadata handling
- Store NFT data on IPFS
- Create marketplace functionality
NFT Standards Comparison
| Feature | ERC-721 | ERC-1155 |
| Token Type | Non-fungible only | Fungible + Non-fungible |
| Uniqueness | Each token unique | Multiple of same ID |
| Gas Efficiency | Higher per transfer | Lower (batch support) |
| Use Case | 1/1 Art, PFPs | Game items, editions |
Step-by-Step Guide
Phase 1: Basic ERC-721
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract MyNFT is ERC721, ERC721URIStorage, Ownable {
uint256 private _nextTokenId;
constructor() ERC721("My NFT", "MNFT") Ownable(msg.sender) {}
function mint(address to, string memory uri)
public onlyOwner returns (uint256) {
uint256 tokenId = _nextTokenId++;
_safeMint(to, tokenId);
_setTokenURI(tokenId, uri);
return tokenId;
}
}
Phase 2: Metadata Standard
{
"name": "Artwork #1",
"description": "A beautiful digital artwork",
"image": "ipfs://QmXxx.../image.png",
"attributes": [
{ "trait_type": "Background", "value": "Blue" },
{ "trait_type": "Rarity", "value": "Legendary" }
]
}
Phase 3: IPFS Storage
- Upload image to IPFS (get CID)
- Create metadata JSON with image CID
- Upload metadata to IPFS
- Set tokenURI to metadata CID
Phase 4: Marketplace
listNFT(nftContract, tokenId, price) - List for sale
buyNFT(listingId) - Purchase NFT
cancelListing(listingId) - Remove listing
Cryptoeconomics Analysis
| Question | Answer |
| PROBLEM | Prove digital ownership and scarcity |
| INCENTIVES | Creators earn royalties, collectors speculate |
| BENEFITS/COSTS | Verifiable provenance; gas costs, metadata risk |
| FAILURE MODE | Metadata loss, rug pulls, smart contract bugs |
| DESIGN CHOICES | On-chain vs off-chain metadata |
| ALTERNATIVES | Traditional digital rights management |
Implementation Checklist
- Deploy ERC-721 contract
- Mint test NFTs
- Upload images to IPFS
- Create metadata JSON files
- Deploy marketplace contract
- List NFTs for sale
- Add royalty support (ERC-2981)
Related Lessons
- L18: NFT Standards
- L21: NFT Technology
- L22: NFT Metadata & Storage
- L23: NFT Marketplaces
- L25-26: Digital Art & Gaming NFTs
Resources