Dev Dispatch #02: Building the Genesis Guardian Unboxing
By Nayef Zarrour, Web3 Operations Lead
You might recall in Dev Blog Ep. 08: Genesis Guardian NFT Airdrop, we shared our vision for creating a collection of one-of-a-kind Guardians that would be unique, playable characters in our game. One of the bigger decisions from that blog post exclaimed “a AAA NFT doesn’t just get airdropped into a holder’s wallet. Rather, it’s “unboxed” into their wallet through a digital sensory experience that’s unique to their specific NFT(s)…This meant reevaluating and reprioritizing our entire development pipeline.”
The unboxing experience is finally here and this week’s Dev Dispatch dives into the various blockchain integrations that made it all seamless for our community. We’ll explore why five different candy machines were necessary, the business decisions behind the numerous token airdrops, and the simulations we created to ensure that the entire site was secure and safe. Not sure what that all means? No worries, we’re going to break it all down in simple terms.
It has to be seamless for the holders
Creating a digital unboxing experience gave us the opportunity to showcase each Guardian, its three unique attachments, and its custom “cattoos.” It also gave us the opportunity to give our community more than just the NFT, with participants also getting airdropped wallpaper art and tokens that grant them access to the Nyan Heroes merch store (coming soon)!
We needed to decide how we were going to get the artwork in holders’ hands. We evaluated several ways, including a direct download on the site, adding URL links to the images within the metadata of the NFT itself, and as tokens that get sent directly to each holder’s wallet. Each method came with benefits and drawbacks that were debated extensively. After the debate dust settled, we chose to airdrop the images directly into each holder’s wallet as tokens. This approach guarantees that each holder will receive their wallpaper art immediately after minting their NFT without any extra effort on their part. Additionally, this approach created a consistent user experience across the entire unboxing as the Guardian Mint tokens to unlock a Genesis Guardian and the Nyan merch tokens were also going to be airdropped the same way.
All of these files and data needed a permanent home
The NFTs would live on the Solana blockchain, but what about the wallpaper art and metadata attached to NFTs? We needed to find a secure, immutable (unchangeable), and permanent home for them. Maddy, one of our brilliant blockchain developers, suggested we use Arweave. Arweave is a decentralized data storage solution that seeks to store files permanently across a distributed network of computers. One of the benefits to using this service for our Genesis Guardian drop was the image files and metadata would forever be accessible through traditional web browsers — no special tools, wallets, or blockchain services needed.
Another benefit to using Arweave was Bundlr, a layer 2 part of the Arweave ecosystem that allowed us to rapidly and easily upload all 90GB of images and data. This enabled us to separate the data into smaller parts, minimize our upload time, and review the uploaded files as soon as it was complete to ensure their accuracy.
Using Bundlr was a no-brainer as it also supports Metaplex. Metaplex is a collection of tools and smart contracts for developers designed to make the process of creating and launching NFTs easier. With over 19 million NFTs minted using their tools (including some of the most popular NFTs in the web3 space), they are undoubtedly one of the largest and most secure NFT standards and protocols in existence. For the Genesis Guardian NFT creation and minting, we used Metaplex’s developer tool called Sugar: Candy Machine CLI as the foundation.
What is a Candy Machine and why are there five of them?
According to the Metaplex website, “the Metaplex Protocol’s Candy Machine is the leading minting and distribution program for fair NFT collection launches on Solana. It allows creators to bring their asset metadata on-chain, configure mints with anti-botting protection, and exchanges SOL for randomized NFTs like a traditional candy machine.” In other words, the Candy Machine is the mechanism that allows holders of a Guardian Mint Token to securely and randomly mint a Genesis Guardian on the Solana blockchain.
As promised in Dev Blog Ep. 08, holders of Genesis Nyans would be given the opportunity to mint a Genesis Guardian of the same rarity as their NFT. For example, if a holder had a rare Genesis Nyan NFT, their Genesis Guardian was guaranteed to also be rare. In order to accomplish this, we had to design and create a network of five independent Candy Machines — one for each rarity. In order to operate a Candy Machine and begin the process of minting a Genesis Guardian, a holder would be required to have a Solana SPL token of an equivalent rarity. Therefore, the “uncommon” Candy Machine could only be operated using an uncommon SPL token. Which leads us to our next challenge: creating five unique SPL tokens that can be airdropped to Genesis Nyan NFT holders that qualify.
How do the airdrops work?
First, we had to airdrop Guardian Mint tokens that allowed Genesis Nyan NFT holders to participate in the minting process. In order to ensure qualifying holders correctly minted a Genesis Guardian of the same rarity as their Genesis Nyan NFT, we created a unique SPL token for each rarity: common, uncommon, rare, ultra rare, and legendary. These SPL tokens would be airdropped to holders that qualify prior to the mint launch. To qualify, holders needed to have a Genesis Nyan NFT in their wallet at the time of the snapshot. This process was simple and straightforward, albeit a little time consuming given our Genesis Nyan collection has 11,111 NFTs.
Next, we needed to build a service that airdropped the two wallpaper art tokens and one merch token to the holder immediately during the mint process. In total, this was another 33,333 tokens (11,111 for desktop wallpaper art, 11,111 for mobile wallpaper art, and 11,111 merch to kens) that needed to be airdropped. The mechanism to airdrop these tokens is divided into two parts. The first part is a webjob that monitors our Candy Machine transactions while the other is the airdrop tool that actually sends the tokens to holders’ wallets.
During this process, the webjob continuously listens to every transaction that involves our Candy Machine addresses. Once it identifies a transaction has occurred, it relays the unique transaction signature to the airdrop tool. The airdrop tool then validates the transaction, extracts all necessary data from the transaction (such as the NFT name and ID), and then finds a corresponding token address for it. Once a match is identified, three transfer instructions are created–one for each token–and combined into a single, executable transaction. If successful, the holder will receive all three tokens in a single transaction.
To ensure that all holders were guaranteed to get their wallpaper and merch tokens, we built a backup airdrop tool that continuously monitors the airdrop transactions and forces a retry until the transaction is confirmed. In the event of any network outages or unforeseen complications, this service ensures that all holders will get their tokens.
Security! Security! Security!
We had to decide which wallets to include in the unboxing experience. We chose to only support Phantom and Solflare as they have proven time and time again that they are the most popular and secure Solana-based wallets. If you are holding your Guardian Mint token in another Solana-based wallet, you must send that token to a Phantom or Solflare wallet in order to participate.
The final step to ensuring we were ready for launch was testing the security of our site and blockchain integration. In order to provide an amazing experience for our community, we must guarantee that it’s also a safe experience. For this process, we hired an independent security firm to review our code base and simulate various scenarios of high load and penetrative attacks. Our blockchain and engineering team worked closely with the security firm to identify vulnerabilities and ensure we had sufficient server load to support increased traffic to the site. After a week of testing and some typical back-and-forth, we were given the green light to launch. LFG!
Finally ready! Can we duplicate everything for a private mint?
With the technical portions resolved, it was time to think about how we wanted to launch the unboxing of the Genesis Guardians. Since each of our team members are Genesis Nyan NFT holders (they get them gifted after their 90th day), we wanted to give them first access to mint their Genesis Guardians as a reward for bringing this vision to life. We also wanted to let the world know what we were up to before the snapshot date, so we reached out to some of our amazing Nyan Heroes family members including @CAGYJAN, @SOLBuckets, Yield Guild Games, and PATHDAO to spread the word, all who were stoked to create content for us. We also wanted to test the entire experience with a soft launch before opening it to the public, just to make sure all the bugs were worked out (we’re glad we did!). It became clear that we would have two launches: a private mint and a public mint.
Creating a private mint meant replicating our entire build, including everything described above, in a new environment. This is where another one of our brilliant blockchain developers, Jesper, came in clutch. Jesper was able to replicate our environments and ensure that the private mint website was safe, secure, and restricted to only the correct people–no bad actors allowed!
Are we sure they’re still HODLing?
Once we identified all of the people and partners that we wanted to participate in the private mint, we had to verify that each were, in fact, still Genesis Nyan NFT holders. This was a manual process where each participant was asked to share their public wallet address with our team so we can verify that they still held the Genesis Nyans. To our delight (and without surprise!), everyone was still HODLing and bullish on the project, crypto winter be damned!
If you’ve made it through this far, you’re a real one. I hope you enjoyed diving into the technical details of our Genesis Guardian drop! More importantly, we hope you enjoy this unboxing experience and love your Guardian! We are so grateful for all of the people and partners that worked very hard to make this happen. Stay tuned to see what we do for the second Genesis Guardian drop, coming soon(ish)!