NFT (Non-Fungible Token) is a unique digital asset where each token has a unique identifier and metadata, making them non-interchangeable.
NFT vs FT (Fungible Tokens)
shellFungible Tokens (FT): Non-Fungible Tokens (NFT): ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ │ 1 ETH │ =│ 1 ETH │ │CryptoPunk│ ≠│Bored Ape│ │ │ │ │ │ #1234 │ │ #5678 │ │Fungible │ │Same value│ │ Unique │ │ Unique │ └─────────┘ └─────────┘ └─────────┘ └─────────┘ FT Examples: BTC, ETH, USDC NFT Examples: Digital art, Game items, Domains
| Feature | FT | NFT |
|---|---|---|
| Fungibility | Interchangeable | Non-interchangeable |
| Uniqueness | No distinction | Each is unique |
| Use Case | Currency, Payment | Collectibles, Identity, Credentials |
| Standard | ERC-20 | ERC-721, ERC-1155 |
NFT Technical Standards
1. ERC-721 (Ethereum)
Characteristics: Each token is unique, suitable for unique assets.
solidity// ERC-721 Core Interface interface IERC721 { // Query balance function balanceOf(address owner) external view returns (uint256); // Query owner function ownerOf(uint256 tokenId) external view returns (address); // Transfer function transferFrom(address from, address to, uint256 tokenId) external; // Approve function approve(address to, uint256 tokenId) external; // Get metadata URI function tokenURI(uint256 tokenId) external view returns (string memory); }
Data Structure:
soliditymapping(uint256 => address) private _owners; // tokenId → owner mapping(address => uint256) private _balances; // owner → balance mapping(uint256 => address) private _tokenApprovals; // tokenId → approved
2. ERC-1155 (Multi-Token Standard)
Characteristics: One contract supports multiple token types (FT + NFT).
solidity// ERC-1155 Core Interface interface IERC1155 { // Query balance (supports multiple types) function balanceOf(address account, uint256 id) external view returns (uint256); // Batch transfer function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; }
Use Cases:
- Game items (various equipment)
- Ticketing systems
- Batch issuance
3. Standard Comparison
| Standard | Token Type | Gas Efficiency | Use Case |
|---|---|---|---|
| ERC-20 | Fungible | High | Currency, Points |
| ERC-721 | Non-fungible | Medium | Unique artwork |
| ERC-1155 | Hybrid | High | Gaming, Batch issuance |
NFT Metadata Storage
Storage Solutions Comparison
shellOn-chain Storage: ┌─────────────────────────────────────┐ │ Contract stores metadata directly │ │ • Name, description, attributes │ │ • Image Base64 encoded │ │ │ │ Pros: Permanent, fully decentralized│ │ Cons: Extremely high Gas costs │ └─────────────────────────────────────┘ Off-chain Storage: ┌─────────────────────────────────────┐ │ On-chain stores URI pointing to │ │ off-chain resources │ │ │ │ Option 1: Centralized Server │ │ https://example.com/nft/1.json │ │ ⚠️ Server down = NFT broken │ │ │ │ Option 2: IPFS (Recommended) │ │ ipfs://QmXxx.../1.json │ │ ✅ Decentralized, content-addressed│ │ │ │ Option 3: Arweave │ │ Permanent storage, one-time fee │ └─────────────────────────────────────┘
Metadata JSON Format
json{ "name": "CryptoPunk #1234", "description": "A unique CryptoPunk character", "image": "ipfs://QmXxx.../image.png", "attributes": [ { "trait_type": "Type", "value": "Female" }, { "trait_type": "Hair", "value": "Mohawk" }, { "trait_type": "Accessories", "value": "Earring" } ] }
NFT Minting Process
shellNFT Minting Process: 1. Prepare metadata Create image + JSON metadata file ↓ 2. Upload to IPFS Get content hash ↓ 3. Call contract mint function mint(address to, string memory uri) ↓ 4. Contract records • Auto-increment tokenId • Map owner • Store tokenURI ↓ 5. Trigger Transfer event Queryable on blockchain explorer
NFT Applications in Metaverse
1. Digital Identity (Avatar)
shellMetaverse Identity System: ┌─────────────────────────────────────┐ │ User Wallet Address │ │ 0x1234...abcd │ └──────────────┬──────────────────────┘ │ ┌──────────┼──────────┐ ↓ ↓ ↓ ┌───────┐ ┌───────┐ ┌───────┐ │Avatar │ │Badge │ │Achievement│ │ NFT │ │ NFT │ │ NFT │ │ │ │ │ │ │ │ • Appearance│ • VIP │ │ • Level │ │ • Clothing│ • Identity│ │ • Skills│ └───────┘ └───────┘ └───────┘
2. Virtual Real Estate
Representative Projects: Decentraland, The Sandbox
shellVirtual Real Estate Characteristics: • Unique coordinates (x, y) • Can build virtual structures • Can host virtual events • Can rent or sell • Value depends on location and traffic
3. Game Assets
Play-to-Earn Model:
shellTraditional Games: Blockchain Games: ┌─────────┐ ┌─────────┐ │Buy Skin │ │Buy NFT │ │Owned by │ │True │ │Company │ │Ownership│ │Cannot │ │Free to │ │Transfer │ │Trade │ │Game │ │Cross-game│ │Shutdown │ │Use │ │= Asset │ │Permanent│ │Gone │ │Storage │ └─────────┘ └─────────┘
4. Social Tokens & DAO
shellCommunity NFT Membership System: Level 1: Regular Member NFT ↓ Hold for 30 days Level 2: Active Member NFT ↓ Participate in governance Level 3: Core Contributor NFT ↓ Create proposals Level 4: Governance Committee NFT
NFT Market Mechanisms
Trading Models
| Model | Description | Representative Platform |
|---|---|---|
| Listing | Seller sets price, buyer purchases | OpenSea, Blur |
| Auction | English auction, Dutch auction | Foundation |
| Aggregator | Multi-platform price comparison | Gem, Genie |
| Royalties | Creator ongoing revenue | Standard 2.5-10% |
Royalty Mechanism
solidity// Royalty implementation example function transferFrom(address from, address to, uint256 tokenId) public { // Calculate royalty uint256 royaltyAmount = salePrice * royaltyPercentage / 10000; // Transfer to creator payable(creator).transfer(royaltyAmount); // Transfer to seller payable(from).transfer(salePrice - royaltyAmount); // Transfer NFT ownership _transfer(from, to, tokenId); }
NFT Development Trends
- Dynamic NFT (dNFT): Metadata changes based on conditions
- Soulbound Tokens (SBT): Non-transferable identity credentials
- Fractionalized NFT: Split high-value NFTs into smaller pieces
- Cross-chain NFT: Transfer between different blockchains
Interview Key Points
- Understand fundamental differences between NFT and FT
- Master differences between ERC-721 and ERC-1155
- Understand various metadata storage solutions
- Familiar with NFT minting process
- Master NFT application scenarios in metaverse
- Understand royalty mechanism implementation
- Understand NFT market development trends