project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4

2048 ZKNoid

A 2048 game written in Protokit with the ZKNoid SDK for Mina that is almost ready for merging into the ZKNoid official repo!

2048 ZKNoid

Created At

ETHOnline 2024

Winner of

trophy

2nd place

Project Description

A 2048 game written in Protokit with the ZKNoid SDK for Mina that is almost ready for merging into the ZKNoid official repo

The 2048 game is often my go-to choice when exploring new blockchain gaming technologies because of its simplicity. However, ZKNoid currently lacks a 2048 game, pushing new users to engage with more complex games that might deter them from trying the product altogether. This highlights the IMPORTANCE of including the 2048 game in the platform.

I have developed the UI for the single-player mode and a runtime module that supports both single and multiplayer modes for 2048 game on Mina & ZKNoid.

The single-player mode follows the standard 2048 game rules. However, in multiplayer mode, I have introduced a new set of rules where the game ends when a player runs out of moves. In this mode, each player is responsible for placing new tiles on the opponent's board, aiming to fill the opponent's board as quickly as possible.

I utilized the session key feature of ZKNoid to enhance latency and overall gaming experience, incorporating lazy submission to Protokit in the background. A session key is assigned to the player's public key at the start of the game.

How it's Made

For the UI and runtime module development, I forked the ZKNoid repository, which provides various utilities for implementing a multiplayer matchmaking system, Mina token bridging, a session key system, and more. I developed a runtime module for both single-player and multiplayer modes of the 2048 game. For the UI, I focused on the single-player implementation, which includes session key integration.

I utilized the session key feature of ZKNoid to enhance latency and improve the overall gaming experience, leveraging lazy submission to Protokit in the background. A session key is assigned to the player's public key at the start of the game, optimizing performance throughout the gameplay.

Note that 2048 is not too simple. It involves nested loops and the challenge of a non-constant loop, which isn't directly supported in o1js.

background image mobile

Join the mailing list

Get the latest news and updates