From BiblePay Wiki
Jump to: navigation, search

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


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 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.

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:
  • 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. This is an important consideration however, as in the SEO discussion we find it important to maintain both a native NFT showroom and a public (external marketplace) for maximum traffic.

SEO Strategy

  • The initial strategy for release is to create 3 new NFT contracts that capture our broad categories: Christian (God focused NFTs), General (Any other NFT or product or item), Orphan (An orphan to be sponsored for an amount of time as an NFT).
  • The categories derived by each contract drive a 'collection', and therefore the showroom caption (Orphan,Christian, General).
  • The collections can be viewed on OpenSea for external traffic. Those collections can be purchased with ETH inside the opensea marketplace.
  • The collections can be rendered by the BiblePay gallery engine for external HTML static content that leads to Unchained, but cannot be purchased unless the user logs in to unchained.
  • The collections can be rendered by BiblePay gallery as a logged in user, allowing actual BuyItNow with BBP or ARB.
  • In summary, this gives us (2) external SEO sources that we do not have now (OpenSea and our 'marketing' domain that is not released yet that hosts static content that leads to unchained. It also provides (2) ways to purchase an NFT: OpenSea with credit card/ethereum, Or BBP with BBP/ARB.
  • When buying an NFT through OpenSea, the deterministic BuyItNow function will not be called, but instead they will act as custodian and complete the sale.
  • When buying an NFT through BBP, the deterministic BuyItNow will be called, and the NFT will transfer autonomously.