NFT Box Breaks — How to use the unique properties of IPFS content addressing to sell NFTs before they are revealed
Since IPFS is a content addressed protocol, we know the location the NFT artwork and metadata will go to BEFORE it is minted
MysteryDrop is built on the same principals as collectible box breaks. Artists mint a collection of NFTs and sell ERC20 tokens which are redeemable for one of the NFTs randomly, after the images are revealed.
Using the MysteryDrop app artists can come together to create themed drops and host live streams to reveal their collections. Buyers can then work together to decide if they want to keep the collection intact, as an NFTX fund, or if they want to break it apart into individual pieces.
How It Works
They key innovation of MysteryDrop involves the order in which we mint NFTs. Since IPFS is a content addressed protocol, we know the location the NFT artwork and metadata will go to BEFORE it is minted. This means that we can actually mint an NFT first, without revealing the image.
First, we create the image for the NFT. Then we simulate an IPFS upload by calculating the CID, but not pinning the content. We then create the metadata JSON and similarly calculate the CID for that file.
Second, we take the CIDs and use the latest Rarible contracts on Rinkeby to mint the NFTs without using the UI. This allows us to see the NFTs on Rarible, but the image files are broken because the IPFS hashes can’t find the content.
Third, we create an NFTX vault & deposit our new NFTs into the vault, which creates NFTX XTokens. These are ERC20’s which are redeemable for an NFT in the vault, or can be traded on secondary markets.
We deposit these ERC20s into a Token Sale contract at a set price. People can then buy the tokens ahead of the unveiling.
Once we are ready to reveal, we run a script to pin the content. It is deployed to the IPFS CID’s that we previously calculated, and the buyers can enjoy the art!
We took full advantage of Austin’s scaffold-eth framework. It helped us deliver our project in record time.
- Mint NFTs
This script calculates the IPFS CIDs for the image & metadata, then mints the NFT using Rarible’s contracts
Notice the images are missing
2. Create NFTX Vault
3. Deploy Token Sale
4. Deposit XTokens into Token Sale
5. Sell XTokens on MysteryDrop
Source code: https://github.com/MysteryDrop/mystery-drop
What’s next for Mystery Drop
Mystery drop was built in 48 hours at the EthGlobal NFTHack Hackthon in March 2021. Learn more at the project page here: https://hack.ethglobal.co/showcase/mysterydrop-recnAaH5hHt2oH656
Stay tuned for our first mainnet drop in the coming weeks!
About the team
- @izikp on Clubhouse
Mark created & contributed the beautiful series that you’ll see in our demos.
“TX” by Mark Redito x Gian Ferrer
An exploration of moods and emotions through shapes, color, and texture. A visual of continuous flow.
Very much like blockchain systems that continue to validate and write transactions on an endless ledger, our thoughts and feelings keep moving, iterating, and evolving.
This collection visualizes these emotions.