Aavegotchi is a DeFi-enabled crypto collectibles game developed by Pixelcraft Studios that allows players to stake non-fungible token (NFT) avatars with interest-generating aTokens and interact with the Aavegotchi metaverse. Aavegotchi combines Decentralized Finance (DeFi) and NFTs to create a financially-incentivized gaming experience.
Aavegotchi is an NFT collectibles game that uses Aave’s interest-bearing aTokens as DeFi collateral to mint NFT avatars. Players aim to increase the value of their Aavegotchi NFTs by “farming rarity” in various gamified ways on-chain.
Aavegotchi needed a provably fair and tamper-proof way to determine the composition of newly minted NFT avatars and distribute rare attributes to existing avatars through on-chain raffles.
Non-Fungible Tokens (NFTs) have generated a massive uptick of interest, both from creators launching NFTs to monetize their one-of-a-kind crypto collectibles and enthusiasts buying NFTs for personal and financial interests. The large majority of first-generation NFTs centered around the idea of using a blockchain’s persistent, immutable ledger to launch and track verifiably unique tokenized assets. While some first-generation NFTs went on to sell for millions of dollars, many others failed to gain traction. Some termed this waning of consumer interest as the NFT “scarcity meme”, where an NFT was only perceived to have value because of its rarity. Users’ interest quickly faded once they realized all they owned was a static digital image.
In January 2021, Aavegotchi launched on the Ethereum mainnet, with the vision of providing users a new blockchain-based “rarity farming metagame” powered by dynamic, DeFi-enabled NFTs. Aavegotchis, inspired by the handheld pet Tamagotchis of yesteryear, are digital avatars with varying rarity that players are incentivized to nurture and level up. They can be minted by staking Aave’s interest-generating aTokens, as well as earned, upgraded, and purchased through various gamified elements and secondary markets.
Obtain a secure source of randomness that’s not subject to on-chain attacks like block reorgs from miners, or the opaqueness of off-chain RNG data providers.
Access a transparent source of randomness that provides verifiable proof that the RNG process is unbiased and tamper-proof.
Call the randomness function at high frequency while minimizing on-chain transaction costs, ensuring users have a seamless experience when interacting with the Aavegotchi metaverse.
One of the foundational elements of Aavegotchi’s game mechanics is randomness, which is critical for minting every new Aavegotchi avatar and updating existing NFTs using raffle-based distributions of rare attributes. However, building a financially gamified and entropy-filled universe required Aavegotchi to have a high-frequency and provably fair source of randomness that no entity can predict or manipulate to obtain the rarest NFTs. The team developing the Aavegotchi platform needed a low-cost Random Number Generator (RNG) that is open-source and verifiable, meaning any user can confirm the integrity of the RNG.
A random number generator (RNG) is the most common way to produce entropy. It uses a seed value to generate a random number based upon some predefined parameters (e.g, 1-1,000). The random number is then used as an input to produce an outcome according to a preset list of possibilities. While it may seem easy on the surface, generating randomness in a way that’s verifiably tamper-proof and unpredictable is a complex computer science problem.
On-chain RNG techniques—random numbers derived from blockchain activity like a block hash—have vulnerabilities that can be exploited by miners. Most notably, miners can reorder transactions within blocks to alter the random number input and achieve a more favorable outcome. Alternatively, off-chain RNG solutions—random numbers derived from a data provider’s API—are opaque and offer no real proof that the data provider can’t tamper with the RNG process and/or frontrun transactions based on the random input they supply. Both on-chain and off-chain RNG approaches have serious limitations that would undermine the security of Aavegotchi’s overall game design, especially as Aavegotchis rise in value and malicious actors have greater incentive to manipulate NFT minting and attribution.
In addition to RNG source considerations, layer-1 blockchains like Ethereum were currently not practical from a cost perspective to support high volume games like Aavegotchi without severely limiting the user experience. Users are unlikely to participate in the Aavegotchi universe if they have to make substantial on-chain payments every time they interact with their Aavegotchi, ultimately reducing the element of competition and unpredictability that makes games exciting and financially rewarding.
Chainlink Verifiable Function (VRF) is an RNG service performed by Chainlink oracles using a hybrid on-chain/off-chain architecture. Chainlink VRF works by combining block data that is still unknown when the request is made with the oracle node's pre-committed private key to generate both a random number and a cryptographic proof off-chain. The cryptographic proof is generated off-chain in a low-cost manner but verified on-chain to confirm the integrity of the off-chain RNG process.
The Aavegotchi smart contract will only accept the random number if it has an associated cryptographic proof, and the cryptographic proof can only be generated by Chainlink VRF if the process is fully tamper-proof. Thus, Aavegotchi users receive extremely high assurances that every source of entropy supplied by Chainlink VRF is provably fair and unbiased, as neither the oracle node, external entities, nor Aavegotchi developers can predict or influence random outputs to their own advantage.
Importantly, Chainlink is a blockchain agnostic protocol, meaning its oracle solutions can be natively integrated on various blockchain networks. This flexibility of design allowed Chainlink VRF to launch directly on Polygon—a highly scalable, low-cost layer-2 sidechain aggregator. Aavegotchi was able to leverage Chainlink VRF on Polygon without dependencies on any other blockchains, ultimately enabling Aavegotchi to call Chainlink VRF for a thousandth of the cost required on Ethereum’s layer-1 blockchain.
Aavegotchi has already called Chainlink VRF tens of thousands of times to mint 10,000 NFTs. This includes leveraging Chainlink VRF several times for its mainnet raffles, where one lucky user out of 16,000 participants won a god-like LINK-cube NFT, the most powerful item in the game, all without any discrepancies in the raffle's integrity.
By introducing verifiable randomness, Aavegotchi has pioneered a new game design that they dub as a “rarity farming meta-game.” This metagame is a competition between users trying to farm the rarest Aavegotchis, either by minting a new one right out of the portal, leveling up existing NFTs by winning raffles and other games, or buying Aavegotchi NFTs and wearable upgrades sold on secondary markets. Thus, not only are Aavegotchi rare NFTs, but they are “farmable” through a no-loss game that’s backed by real interest-generating assets—combining DeFi, NFTs, decentralized gaming, and real-world inputs to create an unparalleled player experience.