乐闻世界logo
搜索文章和话题

What is NFT? Detailed Explanation of Non-Fungible Token Standards, Metadata Storage, and Metaverse Application Scenarios

3月7日 19:47

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)

shell
Fungible 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
FeatureFTNFT
FungibilityInterchangeableNon-interchangeable
UniquenessNo distinctionEach is unique
Use CaseCurrency, PaymentCollectibles, Identity, Credentials
StandardERC-20ERC-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:

solidity
mapping(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

StandardToken TypeGas EfficiencyUse Case
ERC-20FungibleHighCurrency, Points
ERC-721Non-fungibleMediumUnique artwork
ERC-1155HybridHighGaming, Batch issuance

NFT Metadata Storage

Storage Solutions Comparison

shell
On-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

shell
NFT 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)

shell
Metaverse 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

shell
Virtual 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:

shell
Traditional 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

shell
Community 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

ModelDescriptionRepresentative Platform
ListingSeller sets price, buyer purchasesOpenSea, Blur
AuctionEnglish auction, Dutch auctionFoundation
AggregatorMulti-platform price comparisonGem, Genie
RoyaltiesCreator ongoing revenueStandard 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); }
  1. Dynamic NFT (dNFT): Metadata changes based on conditions
  2. Soulbound Tokens (SBT): Non-transferable identity credentials
  3. Fractionalized NFT: Split high-value NFTs into smaller pieces
  4. 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
标签:Blockchain