Web2.5 vs Web3 Gaming
As much as the hottest NFT-enabled games were advertised as web3 games, most of them are not web3 games in the truest sense. The biggest blockchain games like Axie Infinity, the Sandbox and Cryptokitties are what we call web2.5 games, sitting somewhere between web2 and web3 games. In-game assets exist in the form of NFTs and currencies, allowing players to trade them outside of the game, but that’s it. The game logic, game state and game code exist on servers operated by the game developer. Should the game developer decide to shut down game operations, players will no longer be able to play the games.
A true web3 game has the entire game, including the source code, logic, state and assets written on the blockchain. This means players can initiate the game following the rules of the protocol at any time. To give an analogy, chess is an example of a protocol. It can be played anytime, anywhere between 2 players by following the rules of the game defined by the Fédération Internationale des Échecs, the governing body of the game. It can even be played by programs written by people, like the chess bot AlphaZero created by Google’s sibling DeepMind.
Limitations of Current Blockchain Technology
Why don’t developers build blockchain games on-chain then? Well it’s complicated, as there are many factors that determine if a game can be fully built on-chain.
The first problem is throughput. Games where outcomes are based on how fast a player can make a decision and execute it places immense stress on the blockchain. Think of a fast-paced first-player shooter game like CSGO, where actions are registered in milliseconds and can make a difference between winning and losing a gunfight. A block time of 12 seconds on Ethereum would make the game impossible to play competitively. So, it becomes unfeasible to build fast-paced games on-chain. Current blockchain infrastructure can only support on-chain games where move times are higher than block times.
The next problem is scalability. How many players can the game support without congesting the blockchain and causing gas prices to skyrocket? If every move made by a player constitutes a transaction to be posted to the blockchain, then there would be a limit to the number of players that can play the game concurrently on most layer 1 blockchains without moves failing to register due to block limit. The more complicated game mechanics are, the more transactions would be required to play the game. Thus, it’s infeasible to build on-chain games on most layer 1 blockchains.
Given these current infrastructure limitations, there exist a very small subset of games that can be executed well as a fully on-chain experience. But all hope is not lost yet — it is possible to build certain games on-chain using zero-knowledge.
The Solution — Fully On-chain Games Built Using Zero-Knowledge Proofs
With zero-knowledge proofs, games can be built on a rollup layer to take the load off the main layer 1 blockchain. Rollups can batch thousands of transactions together and submit them with a single validity proof. This means players can make more moves and play for a longer period of time before having to interact with the blockchain, reducing transaction costs and congestions on the main blockchain. This will only improve as rollups continue to develop and become more efficient, allowing for the development of more complex games.
Using zero-knowledge proofs in blockchain games also allows for the concealment of certain information. This opens up room for the development of incomplete information games, where strategies like deception and conditional coordination can be enabled. Incomplete information games are often rich in strategies and social dynamics, like what we see in games like poker.
So, what type of games can we build with zero-knowledge proofs?
Massive-Multiplayer Online Games (MMO)
Certain MMOs can be built on-chain using zero knowledge cryptography. The space-conquest MMO blockchain game Dark Forest belongs to this category. The core mechanic in Dark Forest is a zkSNARK secured cryptographic “fog of war”. Players begin the game on a home planet and explore the universe to conquer more planets and accumulate resources to win the game. The location of each player’s planet is secured by a hash which protects their location and prevents others from finding and attacking their planet by scouring the blockchain data. The only way to find another planet is to move your player from one location to another and explore the universe. Players’ moves are submitted as zk-proofs to ensure moves are valid.
What started out as a pie in the sky experiment by MIT student Brian Gu turned out to be the best example of a fully on-chain game we’ve seen so far. 2 years on, Dark Forest has a loyal community of players who find new ways to engage with the protocol and improve it. Members have developed various mods, plugins, DAOs and spin-offs to improve the experience of the game for others. Dark forest embodies the principles of web3 gaming and gives us a glimpse of what the future of what web3 gaming could look like.
Casino Games
Another genre of games that can be built using zkp are casino games like poker, where temporarily-private information like players’ hands are made available later on in the game, after certain moves. Each move in a game can be submitted as a zk-proof to ensure players have a valid hand without revealing their cards. Zkp can also be used to prove that games of chance are random. Since input and output moves can be kept secret with zkp, no player or third party can manipulate or forecast the outcome of a game.
Casino games are probably one of the genre of games that are timeless since there will always be gamblers and punters. Decentralizing online casinos using zkp improves the user experience by guaranteeing the same information is available to all players, decks are fair and whatever information needs to be hidden remains hidden.
Difficult, but Worthwhile
The road ahead is going to be long and faced with difficulties, but it is one we must walk. Creating a fun game isn’t easy. Integrating zkp into the build of a web3 game, even more so. But making true web3 games (those that are fully on-chain) has benefits beyond fun and entertainment. Games are an experimental ground without the high financial stakes involved in say a DeFi protocol. When games are fully on-chain, participants of the protocol can explore the source code and build on it, leading to new discoveries that can push infrastructure development forward. New ways of utilizing zkp can be discovered which can then be applied to other sectors of blockchain development. Therefore, we have to continue with these pie in the sky experiments like Dark Forest, to explore new territories, uncover the “fog of war” and push the frontiers of blockchain gaming further.