当前位置:网站首页>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
边栏推荐
- The operation efficiency of the park is improved, and the application platform management of applet container technology is accelerated
- RestCloud ETL实践之无标识位实现增量数据同步
- Visual effects, picture to cartoon function
- 通信协议——分类及其特征介绍
- Sampling Area Lights
- 股票开账户如何优惠开户?还有,在线开户安全么?
- Example of Huawei operator level router configuration | example of configuring optionc mode cross domain LDP VPLS
- Cluster method synchronous execution framework suona
- Huawei operator level router configuration example | configuration static VPLS example
- Is it safe to open an account online in a small securities firm? Will my money be unsafe?
猜你喜欢

UE4渲染管线学习笔记

【机器学习】向量化计算 -- 机器学习路上必经路

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

PHP batch Excel to word

Detailed data governance knowledge system

Voici le programme de formation des talents de SHARE Creators!

Contrastive learning of Class-agnostic Activation Map for Weakly Supervised Object Localization and

【Qt】添加第三方库的知识补充
![Lavaweb [first understanding the solution of subsequent problems]](/img/8a/08cb2736c2c198d926dbe00c004c3f.png)
Lavaweb [first understanding the solution of subsequent problems]

Huawei operator level router configuration example | BGP VPLS and LDP VPLS interworking example
随机推荐
Add / delete / modify query summary insert/create/put/add/save/post, delete/drop/remove, update/modify/change, select/get/list/find
Mouse over effect V
PCB defect detection based on OpenCV and image subtraction
robots. Txt restrict search engine inclusion
Why are strings immutable in many programming languages? [repeated] - why are strings immutable in many programming languages? [duplicate]
【小程序项目开发-- 京东商城】uni-app之分类导航区域
Multithreaded printing
一文讲解发布者订阅者模式与观察者模式
旷世轻量化网络ShuffulNetV2学习笔记
园区运营效率提升,小程序容器技术加速应用平台化管理
在国内如何买港股的股?用什么平台安全一些?
如果在小券商办理网上开户安全吗?我的资金会不会不安全?
Analysis and solution of anr problems
调试定位导航遇到的问题总结
Pychart software deployment gray unable to point
Mouse over effect 10
Résumé des styles de développement d'applets Wechat
Xception学习笔记
Network address translation (NAT) technology
联想X86服务器重启管理控制器(XClarity Controller)或TSM的方法