ERC721b

From BiblePay Wiki
Revision as of 11:39, 17 March 2024 by Admin (talk | contribs) (Created page with "'''Improving the ERC-721 Spec (ERC-721b) ''' '''Reason: ''' Enhancing the functionality, security, and convenience of NFTs for use on the BiblePay blockchain. '''Current...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Improving the ERC-721 Spec (ERC-721b)

Reason:

Enhancing the functionality, security, and convenience of NFTs for use on the BiblePay blockchain.


Current limitations with ERC-721:


  • Normal NFTs do not support Orphans because they can be re-sold to successive owners (bad in the sense of having a risk of deceiving or cheating the successive user out of the original relationship, and bad morally in the sense that you are reselling a sponsored orphan that you originally committed to). The solution is a Soul Bound NFT; an NFT that cannot be resold, and has a special designation on it allowing us to characterize the NFT as an orphan in showrooms.
  • NFTs cannot be deleted, they live forever. This is a positive trait, however for NFTs that are botched, they will just take more and more precious space in showrooms. The ERC solution is to transfer the NFT to the 0x0DEAD address, thereby filtering it out of active results.
  • NFTs do not protect valuable content. The original ERC721 spec allows anyone with view access to read the json payload and therefore download the contents of every file in the json. Yes, the intrinsic value of the NFT is based on the rarity, but it would be an improvement to be able to encrypt or hide a Treasure Chest that is only revealed to the Owner (IE the purchaser receives this ability after buying). This could be used for license activations, high resolution images, longer videos, crypto rewards, keys etc that are not revealed in the promotional NFT.
  • NFTs provide require a very high level of trust to the marketplace operator. The normal flow in buying an nft goes like this: You sign the rights off of your entire collection to OpenSea when you list *any* of your NFTs in that collection; the listing price is enforced at their UI level. There is no deterministic custodial account in the ERC721 NFT that holds the funds that proves that a user paid. Instead funds flow from the buyer to OpenSea (IE custodian), then you receive an email asking you to approve the transaction, and then the funds flow from OpenSea to your ERC wallet. This is on the minor end of our problems, but begs for an alternative deterministic solution.
  • The ERC721 spec does not allow for a minimum buy it now price to be set and for autonomous transactions to occur (goes hand in hand with point 4).
  • The ERC721 spec does not allow for a switch that would make the art "marketable" vs "non marketable". This is just a nice to have that would allow the owner to take something off the market temporarily, or hide an NFT without sending it to the dead address. Maybe its something they are holding on to and deciding on.



Solution (Enhancing the ERC-721 spec to ERC-721b):


  • Modify the ERC721 spec (the OpenZeppelin Solidity contract ERC721.sol) with new enhancements, naming it ERC721b. Derive a BiblePay class for BBP use of the contract,
and release the contract opensource when it goes to prod.


  • Add a public object to the solidity contract that tracks the following objects in maps, on the chain:
 UserBalances
 TreasureChest
 IsDeleted
 IsMarketable
 IsSoulBound
 BuyItNowAmount
  • Make it so the owner of an NFT, or the authorized NFT operator (permission given by owner in a marketplace) can update an NFTs IsDeleted, IsMarketable, IsSoulBound, and BuyItNow status just by interacting with the contract and paying gas.
  • Make it so the minting platform can set the TreasureChest URL that points to the TreasureChest JSON contents in a secure way, that can only be retrieved by the Owner of the NFT.
 The GetTreasureChest method will be protected by the _IsApprovedOrOwner() permission of the NFT, effectively making it impossible for a non-owner to call for the contents until they become the owner.
 The contents of the TreasureChest will be created upon minting, obfuscated to a uint256 private URL json file, stored in the BBP sidechain as a link, and set as a private property on the NFT at mint.
  • Make it so that users can deposit offers into the NFT contract securely, and if they decide to not purchase, they can withdraw from the NFT thereby their native currency is safe (minus gas fees).
  • Make it so that if a user has deposited more than the buy it now amount and an NFT is "marketable" and the user decides to BuyItNow, the NFT contract will automatically send the BuyItNow amount to the

last owner, reduce the balance of the purchaser by the buy it now amount, and transfer the NFT to the new owner in a deterministic fashion so the steps cannot fail or leave the NFT and payment in an unknown state. The new owner will have access to the TreasureChest function, and ability to Edit the BBP fields if they decide to make the nft marketable again.

  • Soul Bound NFTs however, cannot be made marketable again. The SoulBound designation will allow the front end to display Orphans in a friendly way (different captions and sponsor process).
  • If IsDeleted is set to true, the NFT will be hidden (but still exists on the blockchain).
  • If a random user deposits ARB to an ERC721b contract, that balance will be credited to the sending address. The balance will be withdrawable by the original sender, if they call the "Withdraw" function on the contract.

This is the same facility that will allow us to deterministically offer autonomous sales in the marketplace.

  • The ERC721b spec is backwards compatible with ERC721, meaning these same minted NFTs can be set up for sale on OpenSea or other marketplaces.

However, OpenSea will not honor the Deleted flag, or the BuyItNowAmount, or the SoulBound, it will be up to the user to set up the sale in the classic manner. It is discouraged to list a single NFT in multiple places, however if the NFT is sold in one marketplace it will dissapear from ownership in another since it ties back to the same NFT object on the chain.