Buidler DAO: Detailed explanation of multi-authority NFT management protocol EIP-5496
星球君的朋友们
2022-12-17 12:00
本文约3733字,阅读全文需要约15分钟
Exploring the practicality of NFT will become an important narrative in the future.

Original Author: Jason Chen

Original title: "Talk about the upcoming multi-authority NFT management protocol EIP-5496"

Note: There are many personal opinions in this article, which do not represent the official position. There may be bias and deficiencies. Welcome to exchange and discuss.

For the entire Web3 industry, I think everything that can reduce the entry barrier and cost for ordinary users is a good thing. For the NFT track, I think everything that can enhance liquidity and practicality is also a good thing.

before that forRentable NFT protocol 4907I also wrote a special article. I think the next narrative of NFT's development to the post-small picture era lies in the practical NFT that is closer to life scenes.

First of all, let’s talk about small pictures. It seems that many people regard small pictures as the original sin of NFT and mock NFT as small pictures, but I don’t think so. Small pictures must be immeasurable for crypto to enter the public eye. The role of impetus, you can't pick up the bowl to eat and put down the bowl to scold your mother.

Before that, crypto actually had a very high threshold for ordinary people to understand and participate. The colorful k-lines and the stimulating ups and downs determined that it was still a financial game for a small number of people, but after the appearance of NFT, at least the one posted on it A small picture is something that can be seen. Even if you don’t know finance and encryption, or mining and defi, you can at least judge whether the picture is good or not, and whether the community is interesting. The community culture brought by the small picture + avatar It has greatly lowered the threshold for ordinary users to understand and participate, and strongly promoted the participation of a large number of off-site personnel. Therefore, small pictures definitely have a great contribution to the popularization of crypto.

It is only because of the low liquidity of NFT that the zombie assets generated are much higher than tokens, which is why it is important to increase the liquidity of NFT. The second is that the asset attributes of NFT only release half of its value, because of its unique The imagination of the other half of the practical value brought by NFT (URI mount) is much larger than that of token, but the practical value has not been fully released so far, which depends on the infrastructure construction. Exploration of application scenarios. In addition, the improvement of practicality will also bring about the appreciation of its asset value. This is an effect of stepping on the left foot and stepping on the right foot 1+ 1>2. I don’t think it’s interesting to have an NFT with practicality and no asset transaction value. .

Behind the practicality of NFT is the empowerment of holders' rights and interests. At present, the most common empowerment is mostly concentrated in the process from asset verification to entering the community. It can also be seen that wearable NFT released by Adidas gradually appeared, or Some subscribable NFTs (our BuidlerDAO community is proposing), etc.

EIP-5496 in this article provides shared multiple permissions, and has entered the LastCall state and is about to pass the review. Here is a brief introduction to the EIP process. Its full name is Ethereum Improvement Proposal. Anyone can submit EIP and describe your Discover the shortcomings of Ethereum and give corresponding solutions. After the initial review, you will be given a serial number according to the sequence, and the life cycle shown in the figure below will be discussed and reviewed. EIP is divided into many types, including Core, Networking, Interface, ERC, Meta, and Informational. Each type solves different problems. For example, Core refers to the underlying content such as core consensus forks. The familiar ERC is an application-level Standard formulation, 20, 721, 3535, 4337 (account abstraction), 5192 (soul binding) all belong to this category, so ERC is also the closest and best understood layer to ordinary users. I usually like to read EIP. It is not only a history book of Ethereum, but also a book of prophecy. There may be huge opportunities behind each EIP. Reading EIP is also a grasp The direction of the market, I suggest that you pay more attention to it when you are freehttps://eips.ethereum.org/all

It believes that in addition to pictures and asset attributes, NFT has practicality and can be expanded in different scenarios. The rights and interests may exist on the chain such as voting rights, browsing rights, airdrop rights, etc., or off the chain such as shopping discounts and restaurant discounts. , the right to use airport VIP rooms, etc., in the eyes of EIP-5496, each NFT can contain multiple rights, and this right should have several optional features:

  • Verifiable: the rights and interests can be verified

  • Transferable: Equity can be transferred to others

  • Shareable: Benefits can be shared with multiple people

  • Expirable: rights can be set to expire

Because as an issuer, there may be many rights and interests empowerment of NFT, people who own NFT do not necessarily want to use their rights, and the traditional ERC 721 only records the ownership and transfer process of NFT, and the rights and interests of NFT are not recorded in the On the chain, EIP-5496 allows the project party to write the rights and interests into the chain and grant them to specific people, and the rights holder can independently manage each right, so that both the project party and the holder have the management ability of rights and interests, releasing NFT Value in the field of stake utility.

At present, if the project party wants to empower NFT holders with multi-level rights and interests, it is to airdrop multiple types of NFTs. For example, an airline airdrops a series of NFTs to Crypto Punk holders and endows them with rights and interests, attracting them to join Airline members, but the new airdropped NFT is not bound to its main NFT, so if the Crypto Punk main NFT is transferred, the airdropped NFT will continue to enjoy the rights and interests in the hands of the original owner, while the new main NFT holder cannot Automatically enjoy rights and interests, so EIP-5496 can bind rights and interests to the underlying main NFT, and allow users to independently manage permissions.

The most difficult part of the protocol is how to support and expand more complex business scenarios as simple as possible. It requires elegance and restraint, rather than blindly pursuing power and awesomeness, so next we implement it through its technology Let’s take a look at what EIP-5496 has done and what its design principles are. There are many codes and I will extract some core content to explain to you.

First of all, it will ID all the rights and interests in the contract. Before that, I thought that the process of setting rights and interests is to directly write the rights and interests of NFT into the contract. For example, an NFT has 3 rights and interests, it does not pass string text In the form of writing [can be discounted] [can use products] [can get airdrops], but directly set the equity ID of the NFT to 1, 2, 3, yes, there are 3 equity in the contract, and It does not directly write the content of rights and interests, which is what I think is elegant and restrained as a protocol. The benefits of rights and interests ID are:

1. As an agreement, I only need you to set up several rights and interests, and what is the ID of each right. As for the specific rights and interests, it is left to the outside of the contract to be determined on the chain, just like a computer with 3 USB ports. It can be used to plug in a USB flash drive or a mouse, and the user can decide what to plug in.

2. Equity ID will be very convenient for verifying rights and interests. For example, a product requires NFT holders to use it only if they have the rights to "use the product". Then when the user opens the product, a logic needs to be written in the product code To verify whether the user holds the NFT and has the corresponding permissions, it is necessary to do a verbatim match of the permission name, even if one word is missing. "Products that can be used" and "Products that can be used" are two completely different codes. permission, but if it is IDized, it is only necessary to verify whether the current NFT has the "2" permission.

3. The content of rights and interests changes frequently. Put the rights and interests content off the chain, and only put the number of rights and interests IDs on the chain. If the project party changes the rights and interests, it will not cost gas.

However, the same problem brought about by the ID of rights and interests is that it is impossible to intuitively see what rights and interests this NFT has. There are only ID numbers of 1, 2, and 3, and third-party products are required to set up a rights content separately. And the query function to index to the corresponding ID.

For specific rights and interests data management, it uses two structures for double-layer nesting. First, PrivilegeRecord is defined, which stores the user address and expiration time, and then PrivilegeStorage is defined, which stores the latest expiration Time, and use mapping to bind the benefit ID and PrivilegeRecord.

The _setPrivilegeTotal function is used to set the total number of privileges. This number will be used in the process of empowerment, that is, there are only 3 quantities, and the ID must be less than 3 when empowering.

The figure below shows the core code for setting rights and interests. When setting permissions first, you need to pass in 4 parameters, the NFT tokenid to be set, the permission ID to be set, the user address to be empowered, and the permission expiration time. When granting rights, three verification conditions are required, namely, whether the text has authority, whether the expiration time is greater than 30 days, and whether the rights and interests ID is within the scope of the total rights and interests. The reason why the agreement’s time limit for rights and interests must exceed 30 days is still It's rather strange, I don't know why such a personalized restriction is added as an agreement. Logically speaking, this restriction should be left to the project party to decide.

PrivilegeBook is also a mapping data type used to manage the empowerment of each NFT. In the code, the privilegeBook is set to set someone with a certain interest in an NFT as the authorized user address, and then update the expiration time .

The following figure is also a very core interface for judging whether a user holds corresponding rights and interests. This interface will be used as a key way for other third-party products to verify rights and interests. It can be seen that three parameters tokenId, rights and interests id and user address are passed in. First, judge the current Whether the rights and interests are still within the validity period, the latest expiration time is obtained here to determine whether it is greater than the timestamp of the current block. If there is a validity period, it is checked whether the user of the corresponding authority ID of the current tokenid is the incoming user address.

The figure below shows the latest expiration time of the rights and interests of obtaining an NFT.

The above is the content of EIP-5496. Overall, I think it has made a contribution to NFT in terms of practicality, but it also has its own limitations. Through the above code analysis, we can see that its permission granularity has reached a certain level. A specific NFT level, that is, tokenid as the unit, maybe I haven’t studied it thoroughly, but if I want to set permissions for a certain batch of NFTs or even the entire collection, it is very troublesome. If there are 10,000 NFTs, I need to set it. 10,000 times, I don’t know how the proposer considered this issue, and everyone is welcome to exchange and discuss.

In short, as mentioned at the beginning of the article, NFT has passed the stage of PFP, what will start the next narrative, and the innovation of infrastructure and upper-layer applications will bring the next incremental user influx after breaking the circle. Personal opinion, there are deficiencies and biases, does not represent the position of any organization, does not constitute any investment advice, welcome to exchange and discuss.

Original link

Original link

星球君的朋友们
作者文库