Loot GDC: Exploring the Potential of Onchain LootBoxes

A thorough retrospective on Loot GDC, our lootbox-inspired scavenger hunt quest across digital and physical space.

Loot GDC: Exploring the Potential of Onchain LootBoxes

Introduction

🚨 Two months and three weeks to GDC!

Our team had limited time to create a campaign that showcased our newest products for Game Developer Conference 2024. We had just a few months to plan the campaign, design it, develop it, test it, and go live. So what did we do?

We came up with the most absurd idea possible and proposed a scavenger hunt across digital and physical space.

In this game, participants could find items from various games, NFT art, redeemable tickets for physical prizes, coupons for local food vendors, tickets to events, and more! We wanted it to have anything and everything possible. And here’s how we did it.

Ideation

Our objectives were clear, promote onchain lootboxes and marketplaces in a dapp that highlights their potential. We considered several different experiences, from a spatial AR game where players can find artifacts and trade what they find to an art collecting game and our own version of a game of life.

Due to the time constraints and technical lift, we landed on an experience where users could collect lootboxes through QR codes and links, unlock raffle tickets for NFTs, and trade their tickets to increase their chances of winning the NFT they want.

🚨 One month and three weeks to GDC!

Designing

Once we agreed on the experience, the next step was to map out every user interactions and we used Figma to identify the user flow.

With the user flow in hand, we worked on sourcing content.

🚨 One month and two weeks to GDC!

Connecting the metaverse

Over several weeks, we presented the idea to potential partners. We sent teams this pitch deck outlining the campaign, the opportunities onchain lootboxes unlock, and how each could get started.

Within a few weeks, we had interest from over a dozen game studios and agreements from nine. In terms of loot, ChainSafe Gaming sweetened the pot with an Apple Vision Pro and 50 retro gaming consoles.

The final list of participating teams and items came down to:

Team Item Giveaway quantity Testnet NFTS Token ID
Chainsafe Gaming Apple Vision Pro 1 50 11
Chainsafe Gaming Retro Game Console 50 2,500 10
Parallel Planetfall Collector Pack 5 250 8
Nitro League Raijin Neostorm Car 200 10,000 7
Unioverse Krishah Olive Stiletto 50 2,500 0
Zogi Labs Iron Keys 10 500 3
Zogi Labs Wood Keys 10 500 2
Cosmik Battle Cosmik Battle Starter Pack 20 1,000 4
The Shore The Shore Game Copies 50 2,500 9
Hangry Animals Hangry Animals Membership Pass 5 250 6
Lovekravt Terminal1 Access Pass 50 2,500 5
Futlol Egge Defender 69 3,450 1
Total 469 23,450

Why so many testnet NFTs?

We limited each wallet to one claim every two minutes. Generally, it’s safe to assume that someone will exploit code whenever they can, so if someone ran a script, they could claim a box every two minutes, 30 an hour, 720 a day, and 5040 boxes a week.

Assuming three people figured out how to exploit the contract, that would leave us with under 10k boxes for an event with 40k attendees, all of our social followers, and the followers of our partners. To ensure we had enough content, we decided to mint 50 testnet raffle NFTs for every mainnet and physical prize we had.

Minting the prizes

We used our handy dandy NFT launchpad to mint the NFTs. With a few clicks, you can launch a collection.

For the lootbox campaign, we launched a collection called Loot GDC at the address

0xe5da744d3d418604e0f320835be2aef30c3ce0fc

More details in results section

Using the same dashboard, you can mint an NFT with custom properties.

We knew early on that we wanted to provide participants with a link to the website where they could learn more about the NFT they obtained, and if the studio had a booth at GDC, we wanted to direct the users to their booth to learn more about the game and find physical lootboxes to claim more loot. Each NFT had the custom properties, webURL, and GDC Booth.

Once we gathered all of the content from the teams, we minted all the prizes.

As we worked on sourcing content and prepping the NFTs, the engineering team was hard at work ensuring the dapp was executed perfectly.

Lootbox contracts

The foundation of the Chainsafe lootboxes and marketplaces is Solidity smart contracts. Both contracts were originally built with the web3.unity SDK in mind, but ultimately, if a program can interact with Solidity, it can use our smart contracts.

The lootboxes deployed for Loot GDC are comprised of two smart contracts. The first contract is known as the warehouse and is responsible for distributing lootboxes. The second contract handles the logic for packing lootboxes with rewards.

Developers can choose to distribute lootboxes directly to users, forgoing the need for a warehouse. In our Dapp, we wanted to pack a warehouse full of lootboxes so that users could come and claim them at any time.

To deploy the warehouse contract, we needed to whitelist the lootbox address to prevent unauthorized third parties from depositing content into the warehouse and create a constraint to prevent one user from claiming all of the boxes.

The constraint we chose was to limit claims from each wallet to once every 2 minutes. The warehouse contract required custom development, and we deployed the contract at the address

0xE5933BEe06b833c8A091d971590F7a851977d3bD

More details in results section

To make it easy to deploy the lootbox contracts, our team updated the ChainSafe Gaming dashboard so that they could be deployed with a few clicks. We used this for the Loot GDC campaign.

Lootbox dashboard

Anyone can launch a lootbox via our add ons section in our gaming dashboard. To launch a lootbox:

  1. Click View Add-On and deploy a new loot box.
  2. Whitelist the address that currently holds the prize NFTs.
  3. Transfer prize NFTs and LINK tokens from your wallet to the loot box address.
  4. Manage how many rewards you want to distribute per box.
  5. Add the winner’s addresses to the loot box minting section, then mint and transfer—done!

I created this tutorial for the visual learners.

0:00
/5:36

Following the steps outlined above, we launched our lootbox contract at the address

0x38f1a82Aa1f9e60428611ac9e8cd6AD32cD21d11

More details in results section

With the smart contracts in place, our front-end engineers started crafting the user experience.

🚨 Three weeks to GDC!

Fine-tuning our vision

“The most profound technologies are those that disappear. They weave themselves into the fabric of everyday life until they are indistinguishable from it.” – Mark Weiser

We anticipated that most of our audience would know nothing about onchain interactions, and we wanted to keep it that way.

Authorization and processing transactions

We knew that Metamask and WalletConnect were not options because it would require too much education for the user to get started. We planned to use Web3Auth since most users are familiar with social logins. Web3Auth allows for wallet creation and login via Google, Facebook, Twitter, Discord, and Reddit.

Web3Auth makes for a great wallet solution, but we were faced with another challenge. To claim a lootbox, a user needs to process a transaction, and to process transactions, they need money.

Using Web3Auth meant we could not pre-seed wallets, so we would have to educate the user on testnet tokens, direct them to a faucet, and hope we held their attention long enough for them to return to the Dapp. Alternatively, we could have used a gasless service like Gelato, but the clock was ticking, and we were running out of time to implement more services.

We were fortunate, and we found the perfect solution at the perfect time.

Cometh is a wallet service that uses biometrics to create and log in to web3 wallets. It has built-in gasless transactions. With a little over three weeks left to GDC, we reached out to the Cometh team, let them know about the experience we were building, and asked if they would help us integrate their wallet solution.

As it turns out, the team was eager to contribute! After a few messages back and forth, the team hopped into our repository and integrated the wallet in under an hour. To put into perspective how much Cometh streamlined the user experience, here is a comparison of the standard Web3 experience vs using Cometh.

With Cometh's help, we streamlined the onboarding experience, but we also wondered how we could make it even better.

Nailing the lootbox experience

In the standard lootbox implementation, obtaining items from a lootbox requires three transactions.

  1. Claiming a lootbox.

Some users may obtain a lootbox and never open it. In many cases, users will gather several lootboxes and sell them on secondary marketplaces. Since no one knows what’s inside the lootbox, they can sell for higher prices than low-tier items in games, allowing the seller to profit more than they would from selling common items. Of course, the user risks selling a rare item and the buyer is hoping to buy the rare item at a discount.

  1. Opening a lootbox.

As odd as it sounds, there’s nothing actually inside the lootboxes. When a user tries to open the lootbox, the contract looks at all of the available rewards in the dashboard and uses Chainlink’s Verifiable Random Function (VRF) to choose the reward. The act of opening the lootbox is actually the act of choosing the reward.

  1. Claiming the loot.

Think of claiming the loot as reaching into the box and retrieving the item. Step one involved grabbing the lootbox, step two was Schrödinger revealing what's in the box, and step three is about reaching into the box and claiming the items.

We wanted to avoid explaining why there were three transactions and avoid reassuring the user that pressing a button over and over again is expected, so we reduced three transactions to one.

In our dapp, users would not be able to trade the boxes, so it was easy to eliminate step one. To eliminate step two, we removed the VRF call bypassing the need for another transaction to process. Instead, our app checked all of the available rewards, and our server generated a random number to choose the rewards. When a user pressed claim lootbox, the dapp jumped straight to step three and handed over the loot to the user.

🚨 Two weeks to GDC!

There’s the vision, and then there’s the reality

The Chainsafe Marketplace contracts were going live as the Lootbox Dapp was being developed.

Our engineering team quickly realized it would be impossible to integrate a marketplace into the dapp, so we reduced the scope and eliminated the need for trading. A product launch never goes as expected, and we all agreed it is much better to launch a quality experience than to try to deploy features last minute.

🚨 Three days GDC!

The experience

The dapp and online scavenger hunt were part of the experience, but we also wanted participants to find lootboxes around the GDC venue. During the weekend leading up to GDC, we put together physical lootboxes for our partners to place at their booths.

For the digital scavenger hunt, we planned to use short.io to generate temporary masked URLs. The URLs would only be available for a limited time, forcing participants to seek out links wherever they pop up, whether in a Twitter post, article, Discord server, Twitter space, or anywhere else our partners placed their links.

As we prepped to announce the launch of the dapp, we quickly discovered that short.io wraps the site in an iframe, making it impossible for devices to generate wallets and interact with the dapp. After a mad scramble with our partners, we decided to drop short.io and announce the launch of Loot GDC.

🚨 We're live at GDC!

After two months of hard work, we unveiled our Lootbox Dapp at GDC, and it was a hit! Everyone who opened a lootbox loved the experience. Best of all, users had no idea that with two presses of a button, they created a wallet and processed a transaction to claim a lootbox. Whether a participant found a link online or a lootbox around GDC, this is what they saw.

The results

The beauty of onchain interactions is that all of the data is public. By reviewing our smart contracts, you can retrace when each contract was launched, view the tests we ran, and verify that all of the prizes we promised were available in our lootboxes.

Data

The first draft of this article included links to view the data for all of the smart contracts on the Mumbai explorer but Mumbai was officially deprecated on April 13th 2024.

Fortunately, we were able to download the raw data for the NFT collection before the explorer was wiped. Unfortunately, we were unable to download the lootbox and warehouse data.

https://drive.google.com/file/d/1qggXou9UEXcl6EiwvzLpdrSztNXN4dPb/view?usp=sharing

Here is a review of the contracts we launched and how to make sense of the NFT collection data.

  1. NFT collection
0xe5da744d3d418604e0f320835be2aef30c3ce0fc

You can view the NFTs that we minted and transferred to the lootbox contract in the spreadsheet by referencing rows 2-13. By cross-referencing our prize table from earlier and our launchpad gif, you can verify that each prize was minted and included in the lootbox.

A simple way to check the data for a specific NFT is to download the data and filter for the token ID you are interested in.

  1. Lootboxes
0x38f1a82Aa1f9e60428611ac9e8cd6AD32cD21d11

In rows 2-13, you can see that the NFTs were transferred from our developer wallet to the lootbox contract. In the rest of the rows you can verify that the NFTs were sent from the lootbox contract to the wallets that were claiming the NFTs via our dapp.

We were able to capture this screenshot, which shows when the final NFTs were added to the lootboxes, when the lootboxes were minted, and that no additional changes were made until six days after the campaign launched.

Here is a breakdown of the methods and their descriptions to help you better understand the lootbox data in the image.

  1. Warehouse
0xE5933BEe06b833c8A091d971590F7a851977d3bD

When the Mumbai explorer was working, you were able to view all of the interactions between the lootbox and the warehouse. Unfortunately, the CSV file only covers the NFT collection interactions.

By reviewing the data and filtering for token ID 11, you can find that Apple Vision Pro was minted and transferred to the lootboxes, but no one was able to unlock it.

Prize distribution

Due to privacy concerns, we cannot share the raw data of the email submissions, but we can share that we had 78 email submissions. After removing the duplicates, we found that we received 65 unique email addresses.

To qualify for the prizes, users needed to submit their emails because this is the only way to contact the winners. So, only 65 users qualified for prizes. We are still working with our partners to distribute rewards and will be working with the winners to obtain their prizes over the next few weeks.

Reflecting on Loot GDC

The development experience was the adventure of a lifetime, and the ChainSafe team flawlessly executed the Loot GDC app. We formed partnerships with game studios that had never heard of us, and by the end of the campaign, some signed on as clients referred others as clients, and are working with us on co-marketing opportunities.

For users, it was an experience they had never seen before. Many created wallets, obtained NFTs, and embraced the adventure of searching for loot without knowing they had just been onboarded to web3.

Here are some of the online responses to our lootbox experience.

“Hello and thank you again for the interesting time at GDC! Finding those physical lootboxes and seeing how seamless the experience could be was enlightening, and could definitely be useful for future developments should I do more live game dev in the future.” - Matthew L.
“The lootbox experience was super easy to do. A huge shout out to the genius that made it that easy. Great team btw!” - David S.
“I was telling my friend about Chain Safe - it was so quick, I couldn't believe it.” - Lucy G.

We have a ton of loot left over from the campaign and will continue to work with partners to onboard players to the future of gaming.

Credits and gratitude 🙏

I joined Chainsafe Gaming in January, and the Loot GDC experience was my first big challenge. Thanks to Ria Riaz for encouraging me to reach for the stars and entrusting me with creating the experience for one of our most important events of the year. Thanks to Martin Maurer for highlighting the importance of our work, acting as a mentor, and inspiring me on a daily basis.

Thanks to Cindy Chau and Serena Ho for ensuring the stellar design aspects. Also, thanks to Ivan Rubido, Tanmoy Anjan, and Oleksii Matiiasevych from our engineering team. It is a blessing to work with some of the most talented people in the world, who make the most complex work seem like practice problems.