Infinity Skies Using Chainlink VRF to Fairly Distribute Provably Rare Loot Boxes as In-Game NFTs
For those that might’ve missed our previous announcement, we from DreamFuel Games are working on a decentralized blockchain game known as Infinity Skies — a sandbox building virtual world in which players compete to create the most beautiful castle in the skies.
Randomness is a critical component to Infinity Skies, both to inject excitement via unpredictability and ensure a level playing field for all gamers. As such, we are excited to announce our live integration of Chainlink Verifiable Random Function (VRF) on the BSC mainnet. Chainlink VRF is a secure and verifiable on-chain randomness solution purpose-built for smart contracts, provides users with cryptographic proof that the generation of random numbers is tamper-proof and unbiased. Infinity Skies will use Chainlink VRF across multiple random-result mechanisms, with our initial integration focusing on provably random loot drops.
Custom Chainlink Armor created by The Infinity Skies Team
Why Infinity Skies Needs Chainlink VRF
As we move into the future, more and more digital landscapes will be transformed by smart contract-based blockchains. Due to the digital nature of games, they are on the forefront of this digital revolution. Infinity Skies is a digital, blockchain-based game that has fully decentralized in-game assets, ranging from sky plots to castle decorations and cosmetics. Non Fungible Tokens (NFTs) enable players to have full ownership over their in-game assets, allowing them to freely use and exchange them how they please outside of the platform.
One critical component of Infinity Skies and gaming in general is Random Number Generators (RNG), which can be a player’s curse or a player’s blessing (or both) since they determine a player’s luck to win big or small. Securing the RNG aspect of gaming will prove to be a major component to blockchain gaming, as faulty RNG allows users to unfairly obtain the rarest in-game assets, ultimately making the game untrustworthy. Chainlink VRF fills this gap and provides blockchain-based games with verifiably random numbers in a provably tamper-proof manner, making it a critical component for Infinity Skies and the future blockchain-based games as a whole.
Exploring Pilot Use Cases: Treasure Chests
In Infinity Skies, nearly all of the digital assets have over-arching rarities. These assets and their rarities take many shapes and forms: from “rare” character cosmetics to “common” drops, such as feast NFTs or wall and floor structures, or even extremely rare “divine” rarity statues from chests.
Varying rarities increase the desirability and collectibility of our NFTs, and lead to a more competitive user experience since players truly own them. It is important to us that all NFTs can be earned and rewarded via a fair distribution model where each user has a fair chance of obtaining a rare in-game item. A critical component of our loot distribution mechanisms include treasure chests.
There will be three treasure chests in the game’s first iteration: bronze, silver, and gold. Each chest will have loot distributions that vary in rarity, and players can obtain the chests by completing various in-game quests and adventures. The tentative loot distribution for a bronze chest is as follows:
- Common: 60%
- Uncommon: 29%
- Rare: 10%
- Epic: 1%
- Legendary: 0%
- Divine: 0%
- Astral: 0%
- Royal: 0%
As you can see in the example of a bronze chest, only rarities up to the “epic” rarity are able to be obtained. Respectively, with silver chests, “legendary” assets can be obtained, and with gold chests even the “divine” rarity has a very small probability of dropping.
Since loot is probabilistic and NFTs hold real value to players, it is imperative that the minting of loot cannot be ‘gamed’. Chainlink VRF provides the Infinity Skies’ smart-contract responsible for chest opening with direct access to a tamper-proof and auditable random number to determine outcomes when opening chests.
Future patches will prove to utilize Chainlink VRF in other more novel ways, including complex RNG-based crafting mechanisms and more!
Technical Details of the Integration
On a technical level, Chainlink VRF works by combining block data that is still unknown when the VRF request is initiated with the oracle node’s pre-committed private key to generate both a random number and a cryptographic proof. The smart contract will only accept the random number input if it has valid cryptographic proof, and a valid cryptographic proof can only be generated if the VRF process is tamper-proof. Since the cryptographic proof is published and verified on-chain before VRF is used, it is impossible for users, blockchain miners, and even our development team to tamper with the randomness process.
Infinity Skies’ smart contracts are set up to allow an individual player to open a chest ‘one at a time’. One at a time meaning an individual player must wait for the last request to open a chest to finish before being able to open another chest.
The process begins with a player-owned chest NFT with, for example, an ID 1. In this example, ID 1 represents the treasure chest NFT. This ID can be used to interact with the InfinitySkiesController contract in such a way that the chest can be ‘opened’. Players will obtain chests in multiple ways, but for the sake of this example we will assume said player has already obtained the chest. In the following paragraphs, we further dissect this example in more depth.
Phase 1: the player can open this chest by first turning in the chest, prompting a loading animation.
Phase 2: the InfinitySkiesController processes this transaction and requests a random number from the RNGConsumer Contract. The request process is instant. However, the random number response may take a few seconds.
Phase 3: as the controller waits for the response, a waiting animation will appear. Once a response has been received, the smart contract will emit an event. This event is what is used to update the UI and end the chest loading animation.
Phase 4: the chest can now be opened using the random number provided by Chainlink VRF.
****The mechanics within the contract for determining the result once given a number may prove to be a bit more complex. Still, the integration with Chainlink VRF is as simple as needing a trusted random number!
Chainlink has, without a doubt, proven itself to be the standard trusted oracle system for EVM-based smart contract developers. Additionally, Chainlink has superior tech and well-written documentation that enables developers to create and bring to market novel designs in a short amount of time. Thus, integrating Chainlink VRF was a straightforward decision for the DreamFuel Games development team.
“At Infinity Skies, we’re trying to decentralize as many aspects of the game as possible. Since our game heavily relies on treasure chests and the distribution of random NFTs, we wanted to guarantee that all of our randomness was generated in a provably secure and fair manner without bias for specific individuals or addresses. We could not trust centralized randomness solutions or the deterministic nature of smart contract logic to enable any meaningful randomness. We had to look for an injectable, verifiably random source. Chainlink VRF provides us with exactly what we need.” Marc Bruinsma, Co-Founder of Infinity Skies/DreamFuel Games.
Be sure to check out our demo today, connect your Metamask to Kovan testnet to test the functionality.
Chainlink is the most widely used and secure way to power universally connected smart contracts. With Chainlink, developers can connect any blockchain with high-quality data sources from other blockchains as well as real-world data. Managed by a global, decentralized community of hundreds of thousands of people, Chainlink is introducing a fairer model for contracts. Its network currently secures billions of dollars in value for smart contracts across the decentralized finance (DeFi), insurance and gaming ecosystems, among others.
Chainlink is trusted by hundreds of organizations to deliver definitive truth via secure, reliable data feeds. To learn more, visit chain.link, subscribe to the Chainlink newsletter, and follow @chainlink on Twitter.
About Infinity Skies
Infinity Skies revolves around four concepts of gameplay: Build, Adventure, Socialize and Trade. You build your castle on top of a floating island in the sky, using NFTs as your building blocks, every piece and component is your own property, rather than it being owned by us, some server or anything of the sorts.
Building in Infinity Skies works as follows, first you place down NFTs such as floors, walls, windows and doors to create a castle exterior structure; then once the exterior is to your liking you can start decorating! Everything regarding the building mechanics in the game is focused on giving you as much freedom and customizability as possible, and so we will be providing you with hundreds upon thousands of NFT decorations and furniture to really allow you to put an interior together that speaks to you!
Adventuring allows you to gain NFTs without having to put in any currency upfront, whilst gaining real-world value NFTs by playing a game that you simply enjoy! This is ideal for gamers who are on a tight budget and is part of our policy to appeal to every type of gamer.
Socializing and trading are integral to the design as well, as ultimately our socializing mechanics yield incredibly lucrative rewards incentivizing the building aspect of the game, which in turn drives the trading and adventuring gameplay. Read more about this on our previous announcement.
Visit us at infinityskies.io and make sure to follow us on the social media, such as our Twitter @Inf_Skies and other media linked below to stay up to date with the latest news and revelations about Infinity Skies!