NFT tokens are starting to become widely used. Our team believes that users should be able to interact with digital assets in a fun and interactive way. Mystery Boxes or lucky boxes are hugely popular with a vast majority of online and offline games using this model over selling items directly. We believe that Ethereum brings much needed transparency to this space and helps assure users that the outcome is generated randomly in a provably fair way.
How I built it
The MysteryBox Smart contract acts a bit like an auction where the seller are held into an escrow. Each buyer then pay the price to enter in the raffle. After a determined time (number of block defined by the seller/0, a random number based on the future block hash is generated. This decide who get what.
Challenges I ran into
Randomness is always tricky on a blockchain. We needed to shuffle the items but to avoid loop the shuffle is spread on each buy. One of our goal was to explore ERC1155 but there was not enough time. We still think this new standard should make the mystery boxes more appealing since the selection can be wider without incurring a high gas cost. On the other hand, the shuffling algorithm would need to be revisited.
Accomplishments that I'm proud of
The concept makes sense and we got a working version.
What's next for The Mystery Box
Exploring ERC1155 and different mechanisms, like betting to let the price evolve, etc...