当前位置:网站首页>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
边栏推荐
猜你喜欢

记一次服务部署失败问题排查

Share Creators萌芽人才培養計劃來了!

Optimal Transport系列1
![Od modify DLL and exe pop-up contents [OllyDbg]](/img/ff/7249e6e6644376ae048b23bf63b046.jpg)
Od modify DLL and exe pop-up contents [OllyDbg]

Sampling Area Lights

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

Optimal transport Series 1

PCB defect detection based on OpenCV and image subtraction

VMware vSphere 6.7 virtualization cloud management 12. Vcsa6.7 update vCenter server license

servlet【初识】
随机推荐
Restcloud ETL data realizes incremental data synchronization through timestamp
PCB defect detection based on OpenCV and image subtraction
js中的原型和原型链
RestCloud ETL WebService数据同步到本地
Mouse over effect 10
[applet project development -- JD mall] uni app commodity classification page (Part 2)
一文讲解发布者订阅者模式与观察者模式
MCU firmware packaging Script Software
Pychart software deployment gray unable to point
Example of Huawei operator level router configuration | example of configuring optionc mode cross domain LDP VPLS
最新接口自动化面试题
大橙子疯博客搬家通知
How do I hide div on Google maps- How to float a div over Google Maps?
A small document of JS method Encyclopedia
Densenet network paper learning notes
Cloud native annual technology inventory is released! Ride the wind and waves at the right time
【小程序项目开发-- 京东商城】uni-app之分类导航区域
Classic programming problem: finding the number of daffodils
Evaluation of the entry-level models of 5 mainstream smart speakers: apple, Xiaomi, Huawei, tmall, Xiaodu, who is better?
使用ipmitool配置X86服务器的BMC网络和用户信息