Key Takeaways:

  • Randomness in games falls into one of two categories: input or output
  • Blockchain based games have the potential to expand the gaming market into the trillions, particularly by issuing economic rewards via input randomness
  • Blockchain gaming rewards are scarce, immutable assets that can trade in secondary markets and may soon be used across multiple different games
  • Current randomness solutions are highly limited and not suited to secure the value they will create
  • Chainlink VRF is purpose-built to generate a source of randomness for blockchain games that users can independently verify is authentic

Introduction

Though it’s so ubiquitous it can often go unnoticed, randomness is a crucial element in many games used to create fun and immersive player experiences. Operating at a high level on an Input and Output continuum, randomness is deployed by game developers to either create the conditions on which a player will act (input randomness) or to manipulate the outcome of a player’s actions (output randomness). According to developer and theorist Jesse Schell, the combination of these types of randomness will, in tandem with structured game elements, ideally induce in the player a state of “pleasure with surprises” -- Schell’s definition of “fun.”

Today, randomness is almost completely unavailable to blockchain game developers. The lack of secure randomness solutions is especially acute given that, as the field of blockchain-based gaming grows and expands, the importance of randomness will not be limited to the creation of complex and dynamic gaming experiences. Instead, randomness in blockchain games will become an increasingly powerful economic force for both developers and players. One of the great promises of blockchain-based gaming is the potential to better monetize player time and in-game actions relative to legacy titles. This will be achieved through a variety of methods, including the tokenization of in-game assets, the creation of ‘metaverses’ to expand the usability of those assets, and the provable scarcity of game assets, among others.

As such, for blockchain-based games to compete with traditional gaming, developers need an unbiased random number generation (RNG) solution built for secure use in smart contracts. Until recently, developers who wish to introduce random elements into a blockchain game faced a difficult choice: use a centralized off-chain randomness solution, or use an on-chain randomness function that may be exposed to a variety of attack vectors. Because of these drawbacks, randomness solutions like Chainlink VRF (Verifiable Randomness Function) will be crucial tools as blockchain games work to revolutionize the space.

This article examines how randomness is used in games, the economic impact of in-game randomness and other player activity, the projected economic importance of randomness in blockchain-based gaming, and how Chainlink VRF goes beyond the limitations of current randomness solutions.  

Randomness In Games

In his 2005 book A Theory of Fun for Game Design, developer Raph Koster describes a pitfall endemic in boring games: what he calls “the mastery problem.”

According to Koster, “fun” is a byproduct of recognizing patterns, solving puzzles, and learning lessons -- all to the end of eventually achieving mastery over a set of information. While even pre-language children can learn to play and enjoy a game like Tic-Tac-Toe due to the simplicity of its rules and patterns, more cognitively developed players quickly grow bored for the same reasons; they become masters of the game too easily. Therefore, one key function of randomness in games is to expand the dynamism of player actions and environments -- preventing mastery from becoming too quickly attained and better rewarding continued engagement.

This is achieved through two types of randomness: input and output. Input randomness occurs in a game prior to a player taking action -- some examples include a dealer giving a player a hand of cards, a random monster ‘spawning’ as a player enters a game area, or a game map procedurally generating its environment. In all instances this randomness stunts player mastery by altering the particulars of a game scenario. Instead of being able to memorize the step-by-step strategy to obtain optimal performance, a player must instead learn the broader game mechanics -- hypothetically leading to a longer, more challenging, and more rewarding game experience.

Output randomness, on the other hand, manipulates the effects of a player’s actions or otherwise injects ‘noise’ into the outcome. This type of randomness can include a percentage chance to win a battle in a strategy game; the flop, turn, and river in Texas Holdem; or a dice roll to determine if a player passes a skill check. Output randomness prevents games from having fully arbitrary outcomes -- it impedes mastery by forcing players to learn additional risk-management strategies, as well as how to recover from unlikely but potentially catastrophic losses.

How Input and Output randomness affect in-game blockchain gaming scenarios
How Input and Output randomnes affect in-game scenarios

All of these examples of randomness either currently appear in blockchain-based games, or are poised to as the space develops. However, there is a particular form of input randomness that has outsized importance from an economic perspective for blockchain game developers and players: input randomness used to determine player rewards. This can include the opening of loot boxes, the crafting of items, and the distribution of prizes for achieving certain in-game milestones.

Unlike other forms, which are deployed to impede or complicate player progress towards mastery, this type of randomness rewards players along their path. “Reward randomness” is also unique in that the in-game rewards can often be bought and sold on secondary markets, adding a layer of profit incentive on top of a game’s base level of fun. This type of randomness is poised to become a crucial cog in the forthcoming blockchain-based gaming economy.  

Economic Impact of Reward Randomness

A report from the gaming research firm NewZoo anticipates a nearly $160 billion total gaming market in 2020, with the potential for that market to surpass $200 billion annually by 2023. Of that, the purchase of in-game avatar ‘skins,’ item bundles, and additional content currently accounts for $50 billion yearly -- nearly a third of the entire market. How much of this virtual goods market comes from random distribution tools like ‘loot boxes’ -- randomized in-game items or skin bundles -- is unclear, but likely accounts for a significant portion.

Blockchain-based games are already expanding this market. Three of the most popular games and collectibles projects, CryptoKitties, Gods Unchained, and My Crypto Heroes respectively earned $7 million, $4.2 million, and $1.5 million in their first year of existence, and players earned over $20 million trading game assets on the secondary market.  

CryptoKitties, the popular NFT-backed collectibles

Hironao Kunimitsu, head of the Blockchain Contents Association, recently stated that he believes the blockchain gaming market could eventually grow larger than the GDP of Japan -- currently estimated at $4.7 trillion. This will be accomplished primarily through the tokenization of randomly distributed in-game items as NFTs (Non-Fungible Tokens). As we discussed in our previous deep-dive 16 Ways to Create Dynamic Non-Fungible Tokens (NFT) Using Chainlink Oracles, a Non-Fungible Token (NFT) is a cryptographically secured token existing on the blockchain that represents ownership of something unique.

One primary source of value for blockchain game items backed as NFTs is provable ownership and immutability. In legacy games ownership of items can be revoked, the stats and appearance of items can be manipulated, and if the game ceases to exist the item disappears as well. Tokenization with NFTs mitigates all of these drawbacks: NFTs cryptographically secure ownership of items; the metadata associated with an NFT is impossible to manipulate unless expressly permissioned; and because it is stored on a blockchain, an NFT game item can outlive the game that generated it.

Additionally, this capacity of an NFT to exist outside of its origin game creates a new use case called a Metaverse. A Metaverse is a linked network of interoperable games where NFT-backed items can be used in each distinct game “universe.” For instance, an armored vest generated in a fantasy game that grants a player increased protection from attacks can also be used in a sci-fi game with the same effects. By allowing an NFT game item to provide utility in multiple games, developers can hypothetically increase the value of the item.

Finally, NFT-backed game items also allow for greater liquidity and transparency in secondary markets. Already organizations like Fair Games are seeking to track the rate at which games randomly generate NFTs against the market price for the generated assets, and subsequently provide this information to players. This will allow players to pick which games they wish to play based on their chances of better monetizing their time with NFT winnings, as well as providing assurances that NFT items are provably scarce through the fundamentally public nature of the blockchain.

Already an impressive economic force, experts believe that the superior utility yielded by tokenizing in-game reward randomness prizes has the potential to expand the virtual goods space by orders of magnitude. However, with this increase in value comes a proportional need for a randomness solution that can provide the space with security, reliability, and provably-fair assurances.

Limitations of Current Randomness Solutions

Just like how users wouldn't trust a DeFi protocol with a single, manipulable oracle, users will soon come to reject video games that fail to provide security guarantees concerning their source of randomness.  Especially in any game environment where real-world value could be at stake, the need for a secure, reliable, and provably fair solution increases. This need is especially acute when it comes to NFTs issued as random rewards, given both the prevalence of issuance and the potential value this type of randomness generates.

In the case of centralized solutions, the source of randomness is at risk of being manipulated by the controlling party: the developers. This could be done in order to allocate the best and most valuable NFTs to themselves or to preferred parties. Additionally, in the case of trusted developers there is still a lack of transparency that might cause a player community to grow suspicious of even the most well-intentioned teams. Randomness by nature allows for long-tail, low probability events; unusual runs of luck by one player are an inevitable phenomenon in a long enough time frame. When a community sees that a single player has gotten a glut of rare or valuable items, the lack of transparency in centralized solutions will naturally lead them to doubt that the items were distributed in a fair manner.  

On-chain solutions using blockhash are also limited in the amount of value they can reliably secure. Once a game has become successful enough to incentivize bad actors, they have an attack vector to do so through a biasable input like blockhash. Our introductory post to VRF laid out the particulars of such an attack:

“For instance, suppose a contract makes decisions based on the parity of the last bit in the hash of the block at a certain height. This looks like a 50/50 outcome, but consider that a miner (or coalition of miners) who produces one third of the blocks on average may decide to throw out winning blocks for which the last bit of the blockhash is one, forgoing the block reward of approximately 2-3 ETH. In this case, the miner could bias the zero outcome from a reliable 50% likelihood to a 2/3rds likelihood, leading to the loss of user funds from any smart contract relying on this method of randomness generation.”

Otherwise successful blockchain game launches in the past have been attacked using similar methods, leaving teams faced with a choice to either allow the value of their NFTs to become diluted, or to pay a ransom to the attackers.

Chainlink VRF for RNG brings verifiable randomness to Ethereum dApps
The basics on how Chainlink VRF works

An ideal randomness solution for blockchain gaming would overcome these roadblocks by being both provably fair and on-chain verifiable, as well as being secure against exploitation or tampering. One example of a randomness solution possessing these properties is Chainlink VRF. Chainlink VRF generates on-chain randomness that cannot be manipulated by any node operator, miner, or user. It's backed by a cryptographic proof that anyone can verify on the blockchain as an authentic source of randomness.

Chainlink VRF works in five steps:

  1. A user submits a seed to a smart contract application
  2. The application submits a Chainlink VRF request using the provided seed
  3. A Chainlink node operator generates randomness and publishes cryptographic proof of the generation on-chain
  4. The response is verified on-chain
  5. The smart contract application executes based on the verified random data.

This architecture protects smart contracts from using randomness that has been manipulated. Additionally, as the product matures Chainlink VRF will become even more secure. Currently, if a node operator wishes to affect the outcome of a random number, they have a method to do so in the form of a “withholding attack.” While node operators cannot tamper with randomness, they have the ability to not submit a random calculation all. In the future, this will be mitigated by using multiple oracles with staked collateral submitting answers via threshold signatures. This will allow for the security guarantees of Chainlink VRF to strengthen in line with the increasing value secured by the blockchain video game market.

Currently, a wide variety of projects are implementing Chainlink VRF for the production and distribution of random rewards. These include: PoolTogether, who will be distributing savings rewards on their gamified platform; Polyient Games, who will be distributing NFT rewards to holders of their Founders Tokens; Cargo, who will use Chainlink VRF to allow for randomized NFT features on their minting platform; FaceGolf, who will use VRF to determine the outcome of matches and prizes won; The Six Dragons, whose crafting feature comes with a randomized risk/reward payoff; WildCards, a Harberger-taxed NFT charity project which will use VRF to mint new NFTS; and Texel, who will use VRF to determine the genetic characteristics of their collectible tulips.

The ecosystem of blockchain gaming projects using Chainlink VRF continues to grow.
The ecosystem of blockchain gaming projects using Chainlink VRF continues to grow.

As the space matures and the economic  importance of secure randomness grows more evident, we anticipate more teams will have to evaluate the need for security guarantees like the ones provided by Chainlink VRF.

Conclusion

Blockchain video games are among the most promising use cases in the space, possessing the potential to not merely improve player experience via increased transparency and provable ownership of game assets, but also to fundamentally redefine gaming by allowing players to better monetize their in-game time and skill. While it’s already an impressive economic force, these transformations would significantly expand the gaming industry as a whole.

In order for the space to reach these lofty goals, however, developers and players need security guarantees and infrastructure that can support the increased amount of value they will create. Randomness in games will transition from being primarily a tool to create better gaming experiences and instead become an important channel through which value is created and distributed. Chainlink VRF is a randomness function developed specifically for smart contract applications, one which can rise to the demands this new economy will create.

If you are a smart contract developer and want to take advantage of the Chainlink VRF feature, visit our developer documentation, and join the technical discussion on Discord. If you want to schedule a call to discuss the integration more in-depth, reach out here.

Learn more by visiting the Chainlink website or following us on Twitter or Reddit.