当前位置:网站首页>Metadata in NFT
Metadata in NFT
2022-07-01 02:56:00 【Chen Hao loves to think】
What is metadata ?
Metadata is the data of data . That might be a bit of a detour , Take an example to understand . An article has a title 、 author 、 Release time 、 Tags and so on , This data is the metadata of the article .
Look at a more intuitive example , We use OpenSea Medium One NFT For example :

The picture on the left is the actual data , The metadata describing it looks like this , It's a json File format :
{
"name":"#1125",
"symbol":"SC",
"description":"Soul Café is a collection of 3333 randomly generated, unique and diverse women existing as NFTs on the Ethereum Blockchain.",
"external_url":"https://soulcafe.io",
"image":"https://arweave.net/l7lcr2Z45bVerur-8hO4OoOfd5HoJbvdnW_uVaxMn_g"
}
The metadata contains the name of the image 、 Symbol 、 Description information 、 Links to external websites and pictures . The most important thing is the picture link , The corresponding picture behind this link is the girl image on the left of the above figure , What ordinary users can directly feel is it , You can Click here Access the picture .
stay ERC721 The standard specifies ERC721 Metadata extension , Used to describe ERC721 In itself [3]:
/// @title ERC-721 Non-Fungible Token Standard, optional metadata extension
/// @dev See https://eips.ethereum.org/EIPS/eip-721
/// Note: the ERC-165 identifier for this interface is 0x5b5e139f.
interface ERC721Metadata /* is ERC721 */ {
/// @notice A descriptive name for a collection of NFTs in this contract
function name() external view returns (string _name);
/// @notice An abbreviated name for NFTs in this contract
function symbol() external view returns (string _symbol);
/// @notice A distinct Uniform Resource Identifier (URI) for a given asset.
/// @dev Throws if `_tokenId` is not a valid NFT. URIs are defined in RFC
/// 3986. The URI may point to a JSON file that conforms to the "ERC721
/// Metadata JSON Schema".
function tokenURI(uint256 _tokenId) external view returns (string);
}
accord with ERC721 A standard contract is a set of NFT Set . As in the above figure NFT Take girls' pictures for example , The set it belongs to is Soul Cafe Official .Soul Cafe Official It is through ERC721 Metadata extension name Function to get . Each in the set NFT Each has its own identifier tokenId And the corresponding point json Format metadata “ link ” tokenURI.
We can see this on the details page NFT Girl pictures tokenId by 1125:

take 1125 Enter in the query interface , You can get the corresponding tokenURI 了 :

This results in a string of links that may look strange to you in format :ipfs://QmT11YwPGdUv1ZVvEQ9tU7gH5Q3jWpDovMsT5NpQQec6VD/1125.json . This is actually IPFS Link to agreement , With our usual Baidu Links https://www.baidu.com similar , Baidu's link is in https start , The browser can easily recognize the link , And help you open Baidu website . And then ipfs At the beginning IPFS Protocol Links , It also needs special IPFS Tools to open , In order to let the browser directly recognize , We can manually turn it into https In the form of , So you get https://ipfs.io/ipfs/QmT11YwPGdUv1ZVvEQ9tU7gH5Q3jWpDovMsT5NpQQec6VD/1125.json , After opening, you will find that it is similar to the one shown above NFT Metadata of girl pictures json The content of the document is the same , But what I show in the article is the formatted and simplified version .
The role of metadata
Cost savings . Because every whole node of Ethereum must hold a complete backup of the blockchain , So the cost of blockchain storage like Ethereum is high , take NFT The cost of storing all the data in the chain will be very high . The conventional approach is to store the original data chain ( for example IPFS), Only its metadata is stored on the chain . This can reduce the storage overhead on the chain , cost reduction .
Enrich NFT In itself . Metadata describes information about the original data , Therefore, the raw data can be enriched for other purposes . For example, for some NFT For game cards , Its metadata often contains levels 、 rarity 、 Quality and other attributes .
Record how to find the original data . In a narrow sense, it is a link to an image .
Metadata storage
tokenURI It can be http、ipfs、ar And so on . Different agreements , Different storage methods [1].
http Protocols mean that metadata is stored in centralized services , When you find your favorite NFT When metadata of is stored in this way , It needs to be remembered : Even if you have the NFT, Its metadata can also be modified by the centralized organization that maintains the link at any time . You need to have full confidence that the agency will not act against you .
ipfs Protocol means that metadata is stored in distributed storage IPFS in . The protocol follows content addressing , The simple understanding is , alike ipfs The content obtained by opening the link of the protocol any number of times is consistent , So you don't have to worry about buying NFT after ,NFT Metadata of may be tampered with by some organization . It is worth noting that ,IPFS The protocol only promises content addressing , The data stored on it does not necessarily last forever .
ar Deal with the ipfs similar , The main difference is ar The protocol is based on Arweave Block chaining , And commitment Store your data forever at a low price , You don't have to worry about buying NFT after , Although metadata cannot be modified by centralized organizations , But the metadata is lost [4].
Use IPFS Store the sample :Rarible: Example of uploading & using Metadata with IPFS
Reference resources
[1] OpenSea: Metadata Standards
[2] Rarible: Ethereum Metadata
[3] EIP-721
[4] Arweave Wiki
边栏推荐
- 通信协议——分类及其特征介绍
- 股票开户安全吗?上海股票开户步骤。
- Huawei operator level router configuration example | BGP VPLS and LDP VPLS interworking example
- Dell server restart Idrac method
- robots. Txt restrict search engine inclusion
- 鼠标悬停效果二
- Here comes the share creators budding talent training program!
- 鼠标悬停效果六
- 鼠标悬停效果九
- Thread Detach
猜你喜欢

产业互联网中,「小」程序有「大」作为

Visual effects, picture to cartoon function

Proxy support and SNI routing of pulsar

Dell server restart Idrac method

单片机 MCU 固件打包脚本软件

Huawei operator level router configuration example | BGP VPLS and LDP VPLS interworking example

RestCloud ETL实践之无标识位实现增量数据同步

STM32 - DS18B20 temperature sampling of first-line protocol

Multithreaded printing

Youmeng (a good helper for real-time monitoring of software exceptions: crash) access tutorial (the easiest tutorial for Xiaobai with some foundation)
随机推荐
Restcloud ETL practice to realize incremental data synchronization without identification bit
园区运营效率提升,小程序容器技术加速应用平台化管理
How to buy Hong Kong shares in China? What platform is safer?
js 找出两个数组中的重复元素
Mnasnet learning notes
JS to find duplicate elements in two arrays
UE4渲染管线学习笔记
Contrastive learning of Class-agnostic Activation Map for Weakly Supervised Object Localization and
鼠标悬停效果五
import tensorflow. contrib. Slim as slim error
IEDA 右键源码文件菜单简介
JS anti shake and throttling
单片机 MCU 固件打包脚本软件
Use ipmitool to configure BMC network and user information of X86 server
Saving images of different depths in opencv
Restcloud ETL WebService data synchronization to local
Mouse over effect 8
[exsi] transfer files between hosts
Mouse over effect IV
Classic programming problem: finding the number of daffodils