#Gate 2025 Semi-Year Community Gala# voting is in progress! 🔥
Gate Square TOP 40 Creator Leaderboard is out
🙌 Vote to support your favorite creators: www.gate.com/activities/community-vote
Earn Votes by completing daily [Square] tasks. 30 delivered Votes = 1 lucky draw chance!
🎁 Win prizes like iPhone 16 Pro Max, Golden Bull Sculpture, Futures Voucher, and hot tokens.
The more you support, the higher your chances!
Vote to support creators now and win big!
https://www.gate.com/announcements/article/45974
ZKP+Fully On-Chain Game: The cornerstone of fair play
SocialFi's imitation has come out again and again, and the limelight of full-chain games among ChinaJoy has been overshadowed. During this time, I have been thinking about the potential path of the future Web3 Game, and the most promising ones are put first: ZKP (zero-knowledge proof) + Fully On-chain games.
! [ZKP+Fully On-Chain Game: The cornerstone of fair play] (https://cdn-img.panewslab.com/panews/images/bW1IVN098h.png)
I have been experiencing zBingo, a ZKP (zero-knowledge proof) full-chain game based on ZKP (zero-knowledge proof) in @Zypher_Games since the beginning of August, and 2048 and Depu are still under development, which is a very important turning point for fair play.
**Let's start with the conclusion: ZKP will definitely become an important infrastructure in the future in (1) strategy games with random attributes and (2) full-chain games with incomplete information disclosure. **
For the ZKP+Fully On-Chain game discussion, we divide it into two types:
(1) Full-chain games with incomplete information disclosure;
(2) Competitive games with random attributes.
Full-chain games such as Dark Forest, a strategy game named after the Dark Forest in "The Three-Body Problem", are also based on randomness, featuring Fully On-Chain Games (full-chain game) + MMORTS (massively multiplayer online real-time strategy game) + fog of war.
! [ZKP+Fully On-Chain Game: The cornerstone of fair play] (https://wp.technologyreview.com/wp-content/uploads/2022/11/5c4a4465-f781-4c11-a496-e372dafc3da4_1416x890-DKwiki.png)
The fog of war represents the full picture of the unknown, as a hidden information game, it is necessary to verify the calculation of secret information, and there are many points based on ZK design.
For full-chain games, its biggest feature is that all data and operations are stored on the chain, and the data completely exists on the transparent data layer, so privacy protection is a big problem - can't I attack your city, the opponent does not need to send scouts to monitor, only need to monitor the data on the chain to know all my information, right?
And Depp, Rima, or Bingo, poker this strategic board game with random number attributes is more needed, the first thing that should be done is full chain, plus ZKP empowerment. Otherwise, how can I believe the conscience of the dealer?
Perhaps in the process of playing some competitive games, after playing to a certain extent, you will suddenly find out, why are there fewer randomly dropped equipment and blood bottles? Why are the cards turned out getting worse and worse? It's probably not just a matter of luck. The future project party (bookmaker) may need to prove that it has not carried out black box operations.
For a competitive game with randomness, offline is directly randomly distributed through human hands or machines, and there is a saying called "ten bets and nine losses", which is not only the win rate setting of the game mechanism, but also has a certain insider operation.
The confidence level of online is even worse, as a competitive app without open source - we are almost certain that the project side will adjust the mechanism and probability according to the different games and ranks.
Therefore, in the future online competitive games with random distribution, the project team will not build ZKP (zero-knowledge proof) technology as its own important infrastructure to prove itself. I'm afraid it's hard to be convincing.
! [ZKP+Fully On-Chain Game: The cornerstone of fair play] (https://s.yimg.com/ny/api/res/1.2/qot3RMsIUVS5Ik5XISElpA--/YXBwaWQ9aGlnaGxhbmRlcjt3PTY0MDtoPTM2MA--/https://media.zenfs.com/zh-tw/setn.com.tw/4d6198b8a832c495bf5d79e844b304a2)
zkSNARK – the key to information hiding
Zero-knowledge proof technology has three characteristics: completeness, correctness and zero-knowledge, that is, the conclusion is proved without revealing any details. Its technical source can reflect simplicity, and in the context of homomorphic encryption, the difficulty of verification is much lower than the difficulty of generating proof.
In the structure of zero-knowledge proofs, two roles are involved: "prover" and "verifier". The prover creates proofs based on the knowledge entered by the system, and the verifier has the ability to confirm that the prover has truly evaluated the computation without knowing the input or recalculating himself.
! [ZKP+Fully On-Chain Game: The cornerstone of fair play] (https://cdn-img.panewslab.com/panews/images/YdWY78joxy.png)
ZKP is definitely not an alien concept. For example, Zk-Rollup, as an effective proof mechanism, proposes a new scheme for the scaling of Ethereum. Before everyone was busy airdropping the interactive zkSync, the core of which used ZK to package multiple operations into a proof, and complete most of the computing work off-chain.
Or SNARK in zkSNARK stands for "Succinct Non-Interactive Arguments of Knowledge", that is, concise non-interactive knowledge arguments. Among them: concise because the proof in zkSNARK is only a few hundred bytes, which makes it easy for the verifier to quickly check whether the proof is correct; Non-interactive proofs eliminate the need for verifiers to challenge the statements submitted by the prover.
We just mentioned that for a full-chain game, all data and operations are stored on-chain, and it is difficult to ensure privacy when the data exists completely on a transparent data layer. For example: randomly generated coordinates, the player's spawn point, the remaining hands in your hand, every card you play - all can be queried through on-chain data.
With zkSNARK technology, players can maintain their privacy while publicly submitting verifiable valid actions. In this way, participants no longer need to submit the specific operation information of their on-chain behavior directly to the chain, but only need to submit the promise of the operation behavior and a zero-knowledge proof with a valid hash, and they don't have to worry about others knowing their hole cards.
What are the needs for the privacy of incomplete information for full-chain games? Games such as chess and Chinese chess that do not require privacy at all, but only need to play strategy games, certainly do not require the technical bonus of ZKP.
! [ZKP+Fully On-Chain Game: The cornerstone of fair play] (https://cdn-img.panewslab.com/panews/images/R45CGN20FH.png)
But be careful with mahjong, incomplete strategy games – especially GameFi and Athletics.
So it's still necessary for the following three types of games:
(1) Full-chain games with partial information hiding requirements
(2) A full-chain game of card shapes that requires shuffling and drawing lots
(3) Full chain of asynchronous games
To add, asynchronous games refer to the implementation of non-real-time player game interaction mechanisms.
Example: Mechanics of Zypher Games' full-chain ZK+ game
For these three types of games, we will take the three existing game mechanisms in Zypher Games based on the self-developed zk-Game SDK to illustrate how to achieve the on-chain information asymmetry required for full-chain game development.
! [ZKP+Fully On-Chain Game: The cornerstone of fair play] (https://cdn-img.panewslab.com/panews/images/AeB836Xq9m.png)
Among them, full-chain asynchronous games can directly refer to Dark Forest. Zypher Games has also launched a general-purpose zero-knowledge game engine (UZKGE) to help develop full-chain card games, such as computational provability, scalability and concurrency, and on-chain data/information asymmetry.
zBingo: A full-chain game with partial information hiding requirements
Bingo seems to be popular in the West, so I've studied how to play this game for a long time.
The rules of the game are that first you will get a "randomly generated" card filled with 1~36 random numbers, of course, this generation is also based on ZK. The gameplay is relatively simple:
(1) At the beginning you will get a 5x5 grid card filled with random numbers between 1 and 36, the specific layout of this grid card is randomly generated and only you know.
(2) Once the matchmaking is complete, players take turns selecting numbers on their grid cards. The selected number is announced and tagged for any player with that number on the grid card.
(3) The first player to complete two lines (horizontal, vertical, or diagonal) wins the round.
! [ZKP+Fully On-Chain Game: The cornerstone of fair play] (https://cdn-img.panewslab.com/panews/images/9yQvR8Si8g.png)
In fact, the gameplay is quite simple, ** mainly talk about the mechanism, let's see where your gas is spent **.
(1) Generate a grid card composed of random numbers, so the first signature is used here;
(2) The encryption of the grid card requires the use of a one-time encryption key. Before the encrypted signature operation, you can generate a grid card at will, but it cannot be changed after the encryption is completed;
(3) Submit the encrypted grid card and enter the pairing process, which is the expense of the first gas fee;
(4) Matchmaking, which matches your opponent for you, which is the second gas fee payout;
(5) The next step is to gas out of each step, and every time you open a card, you have to pay the fee for this time;
(6) End, upload the certificate, and make the If operation judgment. The winner will receive a zBingo blind box, which can later open Zynizens NFTs.
I calculated that after two rounds of zBingo game, it cost a total of 0.0031 BNB, and the average gas fee to pay was about two yuan and four cents.
In fact, the gas to play this casual game is not low, mainly because the game on the whole chain needs gas at every step, so the follow-up is more expected to be upgraded by Cancun, lower fees and faster operations.
! [ZKP+Fully On-Chain Game: The cornerstone of fair play] (https://cdn-img.panewslab.com/panews/images/UzG6C2PcU9.png)
zACE: A card-shaped full-chain game that requires shuffling and drawing lots
Finally, let's talk about the design differences in the mechanism of full-chain games in the board and card class. zACE showed a zk-Game SDK based on Zypher Games for the development of card games that need to be shuffled and dealt, similar to Texas Hold'em.
! [ZKP+Fully On-Chain Game: The cornerstone of fair play] (https://cdn-img.panewslab.com/panews/images/xgh1o4nBAO.png)
In fact, the SDK realizes a high-performance, low-cost decentralized shuffle process through optimized wasm and precompiled contracts. Its on-chain randomness no longer requires traditional VRFs, realizes decentralization, and carries out fair shuffling and games.
*VRF, which refers to the validation random function. A verifiable random function (VRF) is a random number generator (RNG) that can verify randomness cryptographically. Many L1 blockchains, including Algorand, Cardano, Internet Computer, and Polkadot, use VRFs in consensus mechanisms to randomly select block nodes. *
! [ZKP+Fully On-Chain Game: The cornerstone of fair play] (https://cdn-img.panewslab.com/panews/images/Tab57uqv1Z.png)
However, due to the highly deterministic nature of blockchain networks, secure RNG random number generators are often not available on-chain.
There is a risk of being manipulated by miners or validators using on-chain block hashes to generate random numbers, and these individuals responsible for verification can choose to discard blocks that are unfavorable to themselves and regenerate random numbers until they are in their favor. This is why ZKP+ full chain is important.
Z2048: Full chain 2048
The developers of the Zypher Games platform are preparing to launch a game called Z2048, a full-chain game based on the popular casual sliding digital game 2048.
How to play: In the 4 * 4 square grid, there are two random numbers 2 on the initial plate, the player uses the arrow keys to move the numbers on the disk, so that the same numbers in the same direction are added and moved to the other side of the direction, and each time it moves, a 2 or 4 will be added at a random position on the disk;
Players end up with a number of 2048 and can choose to upload ZKP to end the game, or continue to challenge for a higher score. If the disk is completely stuck and cannot be moved, the game ends.
Platform NFTs can increase playtime and resurrection rights. In this game, ZKP is used to achieve scalability.
ZKP-Proved, where smart contracts don't require each step to be committed on-chain — which requires players to sign a transaction for each step — but instead bundle those steps together and generate zero-knowledge proofs.
This proof is then stored on the blockchain, providing cryptographic verification, ensuring that the outcome of the game is both immutable and fair, while maintaining the confidentiality of specific gameplay details. By combining traditional gameplay with state-of-the-art zero-knowledge proof (ZKP) technology and competitive elements.
! [ZKP+Fully On-Chain Game: The cornerstone of fair play] (https://cdn-img.panewslab.com/panews/images/0t0KD9B8tI.png)
UZKGE: Zero-knowledge game engine with a highly optimized Plonk library, which is a supplement to a rapidly expanding zero-knowledge (ZK) circuit library, crafted to meet the diverse needs of game developers.
! [ZKP+Fully On-Chain Game: The cornerstone of fair play] (https://cdn-img.panewslab.com/panews/images/qL4PD5tNkD.png)
These circuits facilitate complex calculations, ensure the integrity of game mechanics while protecting player privacy, and these cryptographic technologies enable game developers to verify critical game data without revealing potential details.