当前位置:网站首页>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
边栏推荐
- ipmitool下载地址和编译安装时可能出现的问题
- Mouse over effect 9
- Pulsar geo replication/ disaster recovery / regional replication
- mybati sql 语句打印
- Here comes the share creators budding talent training program!
- 股票开户安全吗?上海股票开户步骤。
- lavaweb【初识后续问题的解决】
- STM32 - DS18B20 temperature sampling of first-line protocol
- 咱就是说 随便整几千个表情包为我所用一下
- Mnasnet learning notes
猜你喜欢
Servlet [first introduction]
旷世轻量化网络ShuffulNetV2学习笔记
servlet【初识】
Detailed explanation of pointer array and array pointer (comprehensive knowledge points)
[applet project development -- Jingdong Mall] user defined search component of uni app (Part 1)
Gartner研究:在中国,混合云的采用已成为主流趋势
UE4 rendering pipeline learning notes
[exsi] transfer files between hosts
彻底解决Lost connection to MySQL server at ‘reading initial communication packet
最新接口自动化面试题
随机推荐
lavaweb【初识后续问题的解决】
Why are strings immutable in many programming languages? [repeated] - why are strings immutable in many programming languages? [duplicate]
旷世轻量化网络ShuffulNetV2学习笔记
PTA 1017
Mouse over effect 9
Mouse over effect 8
Dell server restart Idrac method
How do I hide div on Google maps- How to float a div over Google Maps?
Ipmitool download address and possible problems during compilation and installation
MnasNet学习笔记
go: finding module for package
鼠标悬停效果二
Use ipmitool to configure BMC network and user information of X86 server
[PR # 5 A] two way running (state pressure DP)
鼠标悬停效果三
Evaluation of the entry-level models of 5 mainstream smart speakers: apple, Xiaomi, Huawei, tmall, Xiaodu, who is better?
联想X86服务器重启管理控制器(XClarity Controller)或TSM的方法
Analysis and solution of anr problems
php批量excel转word
Share Creators萌芽人才培養計劃來了!