当前位置:网站首页>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
边栏推荐
- 基于Pytorch完整的训练一个神经网络并进行验证
- VMware vSphere 6.7 virtualization cloud management 12. Vcsa6.7 update vCenter server license
- Youmeng (a good helper for real-time monitoring of software exceptions: crash) access tutorial (the easiest tutorial for Xiaobai with some foundation)
- MnasNet学习笔记
- 鼠标悬停效果二
- 彻底解决Lost connection to MySQL server at ‘reading initial communication packet
- 性能测试常见面试题
- Communication protocol -- Classification and characteristics Introduction
- robots. Txt restrict search engine inclusion
- [applet project development -- JD mall] uni app commodity classification page (first)
猜你喜欢
随机推荐
Xception learning notes
Complete training and verification of a neural network based on pytorch
7_ Openresty installation
Mouse over effect II
使用ipmitool配置X86服务器的BMC网络和用户信息
Od modify DLL and exe pop-up contents [OllyDbg]
LeetCode_栈_困难_227.基本计算器(不含乘除)
PTA 1016
Const and the secret of pointers
Share Creators萌芽人才培养计划来了!
The operation efficiency of the park is improved, and the application platform management of applet container technology is accelerated
记一次服务部署失败问题排查
Mouse over effect 8
Densenet network paper learning notes
鼠标悬停效果五
robots. Txt restrict search engine inclusion
Xception学习笔记
UE4渲染管线学习笔记
Mouse over effect 10
大橙子疯博客搬家通知
![[applet project development -- Jingdong Mall] classified navigation area of uni app](/img/cb/b0b79444dc90980cd2220ff9e68549.png)






