An article to understand the NFT transaction protocol ERC721P: code is law

The NFT issued by the ERC721P protocol will have corresponding collateral, de-neutralizing the transaction protocol and arbitrage space, which can solve the NFT liquidity problem.

Original title: “ERC721P Jingzhe Edition: Code is Law”

Written by: PandaDAO

The full name of ERC721P is ERC721 Panda. This protocol belongs to the decentralized Swap protocol of NFT, developed by the PandaDAO community and conducted by SlowMist for security audit. Before and after Jingzhe in 2022, the team discussed internally about community NFTs. At that time, the idea of ​​ERC721P was not yet formed, and the picture of NFTs was far from what it is today, but fate is so ingenious that we have NFTs born at that time. The idea of ​​​​is like the solar term of Jing Zhe, which wakes up the animals that have been living in hibernation for a whole winter; at the same time, we also hope that the name means the end of the cold winter in the crypto market. So we named the first version Jingzhe to commemorate our past days and look forward to the future days of the community.

In the design phase, we hope to ignore the direct intervention of individuals or a specific organization on the contract, and follow the rules of the blockchain “Code is Law”. Because we believe that any great thing is not affected by individuals or small groups of organizations, but the underlying code determines its life cycle and its upper limit in the future.

ERC721P was originally used by Random Panda Club (hereinafter referred to as RPC), and it is also the first official NFT project of the community. Random Panda Club is called Random Panda Club in Chinese. The birth of all good things is often random, and not all processes are deliberately arranged, just like God has thrown huge dice. Like the birth of the earth, the origin of life and the infinite possibilities of web3. Just as 01 binary created the entire Internet world, panda’s black and white creates more possibilities.

ERC721P: Decentralized NFT Swap Protocol

Initially, 50,000 $PANDA will be anchored to each NFT of RPC. Simply put, each RPC can be exchanged for 50,000 $PANDA, and 50,000 $PANDA can also be exchanged for 1 RPC. The PandaDAO community will implement a fixed-price repurchase of $0.005 for the Tokens circulating in the market, which means that each RPC can be exchanged for a minimum of $250. With the increase of contract interaction and the increase of handling fees, the anchoring of NFT Prices will also increase.

Because of this design, there is also room for arbitrage in the NFT market. When the price of NFT in the open market is lower than the ETH equivalent of the anchor price. Arbitrageurs can buy NFTs, exchange them for $PANDA, and then exchange them for stablecoins.

Arbitrage process when the NFT price is lower than the anchor price

If the market price of NFT is higher than the contract anchor price, there are also NFT works in the LP pool. Then arbitrageurs can buy $PANDA, exchange it for NFT, and then sell it in the open market to achieve arbitrage. However, because the LP pool has a minimum limit of 1000 NFTs, if there are less than 1001 NFTs in the LP pool, the arbitrage condition cannot be completed.

When the NFT market price is higher than the anchor price and there are excess NFTs in the LP pool

ERC721P also has a mechanism that each Swap requires a handling fee of 7.5% of the anchor price. Half of the handling fee will go into the contract to increase the anchor price of NFT, and the other half of the handling fee will go into the community treasury to be used for NFT. Continuous operations, such as ChainLink’s oracle renewal, project airdrops, etc. With the emergence of this mechanism, the later the NFT holder withdraws, the more tokens are returned, and the higher the return. In the same way, when there are NFTs in the pool that can be swapped out, the earlier the swap, the less Tokens are needed. The detailed formula is as follows:

NFT exchange $PANDA formula

But ERC721P also has a clever design that is the rebirth of NFT, which is to use NFT to exchange NFT. Assuming your NFT is low in rarity, or you are tired of your NFT, then you can randomly swap your NFT for another NFT. Because the permutation is random, maybe you’ll get a 1/1 piece, or maybe you’ll get a less rare piece. And in future planning, we plan to add blue-chip NFTs such as BAYC, Doodles, Azuki, etc. to the pool, that is, users can exchange RPC NFTs for other blue-chip works. The protocol update is expected to be launched in version 2.0. The rebirth contract is the same as the Swap contract. Half of the 7.5% handling fee goes to the community treasury and half goes to the LP mining pool, thereby raising the anchor price of NFT. That is, the sooner the replacement is done, the less it will cost. The detailed formula is as follows:

The formula for the impact of NFT rebirth on the NFT anchor price

The mechanism of this contract is that, regardless of the NFT market, the PandaDAO community treasury is the strongest backing for RPC holders, satisfying the benign exit of all RPC holders, and will not affect the market price of RPC NFTs.

Problems solved by ERC721P

1. Liquidity issues

Poor liquidity is a problem that has existed since the birth of NFT, especially when the floor price plummeted, the liquidity of NFT almost dried up. Although the bottom price can solve this problem to a certain extent, when the NFT floor price is much higher than the bottom price , the liquidity of NFT will still be close to exhaustion;

2. The issue of collection value

At present, the handling fee of NFT in circulation is entered into the trading market and the wallet of the project party. As an NFT Holder, in addition to earning the selling price difference, there is no income in the flow of NFT, which is not in line with the long-term the holder’s expectations;

3. Aesthetic fatigue and playability issues

After users buy NFT, they often use it as an avatar. You will choose a PFP you like as an avatar when you buy it, but people’s aesthetics will change, and it is human nature to like the new and dislike the old; on the other hand, hold a PFP for a long time. If it weren’t for the price hike, it would be a relatively boring thing.

ERC721P was born to solve these problems. On the one hand, by anchoring the price, it forms an arbitrage space, which indirectly affects the liquidity of NFT, and can also prevent the NFT in hand from returning to zero. The LP design based on ERC721P can continuously increase the anchor price, no matter if someone withdraws, joins, or even replaces, most of the rights and interests will be transferred to long-term holders. Because the ERC721P protocol also has the function of rebirth, while increasing the playability, it also increases the randomness of NFT.

Logic diagram of ERC721P for NFT and Token exchange

Oracle random number

In ERC721P, the replacement of NFT with Token and the rebirth of NFT are both random. So random numbers are very important to this contract. Here we use the random number interface provided by the ChainLink oracle (Chainlink VRF 2.0). Before the block takes effect, no one knows what random number will be obtained, and this mechanism can prevent random number attacks on the chain.

However, in practice, we found that the logic execution of fulfillRandomWords of Chainlink VRF is very complicated, which will increase the failure rate of callback execution. At the same time, because the gas fee of Chainlink callback execution cannot be accurately predicted when the random request is issued, it is necessary to minimize the The gas consumption in the callback; so we finally decided to only store the random value in the callback, and the NFT transfor after the random value is determined will be executed by the user at the end.

Although we have simplified the processing logic of Chainlink callback to the greatest extent, it cannot be ruled out that in extreme cases, VRF may fail in a large area; once this happens, the treasury multi-signature will open the bottom line of random value generation: Commit Reveal, in this scheme, the random value generation will only depend on the random salt submitted by the user, and the miner’s packaging hash. Within a limited block, it is almost impossible for the random value of this scheme to do evil.

The failure probability of VRF’s large-scale callback is extremely low, but we still have to consider a few failures. If you fail to perform the callback of VRF during rebirth or purchase, then you can file a complaint with the treasury and submit an on-chain proof ; After the treasury check, it will allow you to generate a random value of compensation through Commit Reveal by adding a whitelist.

NFT re-protocol operation logic

The future of ERC721P

Based on this protocol, we can ensure that no matter what the market is, the NFT issued by the ERC721P protocol will have corresponding collateral and cannot be returned to zero, thus solving the NFT bubble crisis. The de-neutralized Swap protocol and arbitrage space can solve the liquidity problem of NFT. In addition to this, there is the issue of NFT theft. If your NFT is stolen, when the exchange intercepts the NFT transaction. Then hackers can choose to replace ERC721P with other NFTs. As a stolen user, you can contact the community to exchange your original NFT with the anchor price or other low-quality NFT to recover your losses as much as possible.

After playing NFTs for a long time, you find that there are a bunch of “zeroing” pictures in your backpack that can no longer be sold, but they used to be alive. If 721P can be reborn, what about them?

Since liquidity is a common problem for NFTs, maybe you also want to make the entire NFTs flow again, including those that are about to be born…

Of course, it still has a lot of room for development. As one of the initiators of ERC721P, I don’t know how it will go in the future, and everything will be decided by time. What we need to do is to build a perfect contract, no matter how the market changes, how the community changes, or even how the entire Internet changes, it can run all the time, relying on code to constrain everything and avoid personal interference and modification of the core logic. Follow the rules of blockchain “code is law”, not “person is law”.

Related Posts

DAOctor, co-founder of DAOrayaki: The two common factors in running a DAO well are building and practicing a decentralized collaboration mechanism and attaching importance to governance丨GWEI 2022 – Singapore

On July 14th, the first “Global Web3 Eco Innovation Summit – Singapore” (GWEI 2022 – Global Web3 Eco Innovation Summit -Singapore) was held at the Marina Bay Sands Convention and Exhibition Center in Singapore. Co-hosted by Fintech Node (SUSS NiFT) and Babbitt’s…
Read More

Devrims Web Hosting Review: Read the full review

About Devrims Web Hosting Devrims Web Hosting is a product-based technology company that reimagines how a true managed cloud hosting platform should work. Through our robust engineering, they have built a robust, scalable, secure and flexible managed cloud hosting platform for enterprises,…
Read More