Aligned Hackathon Spotlight Vol. 1: A Framework for ZK Gaming
Welcome to the first post in a series showcasing the winners of the inaugural Aligned Builders Hackathon. Each article will highlight innovative use cases for ZK technology enabled by Aligned's Proof Verification Layer.
The hackathon projects ranged from ZK-enabled games and private voting apps to light client bridging solutions, demonstrating the versatility of zkVMs in building ZK-powered applications. Aligned handles verification in a cost-effective, scalable way—solving the bottleneck of high EVM verification costs. Leveraging Aligned's 90% reduction in verification costs, our hackathon encouraged developers to build new ZK applications.
Our developer community continues to grow, with over 288 members in our Telegram group. Join us to stay updated on technical developments and future hackathons!
We're kicking off the series with our first-place winner: ZKGameKit, an impressive solo project by Nishant. His submission combines a proof-of-concept game with a library for building verifiable games using Aligned and zkVMs. Special thanks to Nishant for contributing his research to this article!
Web3 gaming: a space to watch
Gaming represents an exciting area within crypto where blockchain technology enables new innovative game development approaches. NFTs can make in-game assets like skins and items portable, enabling new economies and markets both within and across games. The use of standardized, open protocols allows games to interconnect, expanding gameplay experiences beyond single titles.
However, running games entirely onchain presents significant challenges. Games need real-time state updates, especially in multiplayer environments. Many also require hidden information—such as fog of war in strategy games or concealed cards in poker—which conflicts with the public nature of blockchain data.
Zero-knowledge (ZK) proofs offer elegant solutions to these challenges. They can allow players to prove their actions and states without revealing sensitive information, enabling fair gameplay while preserving privacy. This technology can support features like hidden player positions in strategy games and scalable, decentralized game logic. ZK lets developers move computation off-chain while maintaining onchain verifiability, expanding blockchain's capabilities.
A great example is Dark Forest, a real-time strategy game built on Ethereum by the 0xParc team. Using ZK-SNARKs, Dark Forest conceals both the universe and players' in-game information as they explore and conquer the game world.
ZK-rollups are also becoming hubs for ZK-powered games and virtual worlds, supported by innovative developer tools like DojoEngine on StarkNet (by Cartridge), which provides a powerful toolchain for provable applications. With new developer tools like ZKGameKit and advances in proving technologies, developers and enthusiasts can more quickly overcome the difficulties of using ZK to experiment with new game designs.
ZK in gaming: new tools for privacy, fairness, and scalability
Zero-knowledge proofs can solve key challenges in onchain games by letting players verify achievements and rule compliance without exposing sensitive information. This can enable fairer gameplay while broadening what onchain games can accomplish. Some key use cases include:
Verifiable gameplay
- Prove speedrun completions, puzzle solutions, or boss defeats without exposing strategies.
- Validate multiplayer results and ensure compliance with rules in strategy and PvP games.
Fairness in randomness without reliance on 3rd-party oracles
- Verifiable randomness for dice rolls, loot boxes, gacha systems, or random encounters.
- Provably fair shuffling and drawing in card games.
Privacy-preserving mechanics
- Hidden resources and private game states for strategy, trading card, and territory-control games.
- Prove eligibility for mature content or regional events without exposing personal data.
Player-centric ecosystems
- Skill-based matchmaking with private matchmaking rating (MMR).
- Decentralized governance and player-driven economies with privacy.
ZK proofs enable fairness, transparency, and privacy in gaming mechanics and decentralized systems. As tools like ZKGameKit and DojoEngine make integrations more accessible, the future of ZK-enhanced onchain gaming shows tremendous promise in transforming how games are built, played, and governed.
During our hackathon, we encouraged developers to experiment with zkVMs to build provable games that could be verified onchain. Since zkVMs can prove arbitrary code execution, a game running in a zkVM can generate a proof of a player's results. This proof can then be verified and posted onchain (using Aligned) to create a verifiable, permissionless leaderboard. There's no need to trust a third party—the results live on Ethereum for anyone to use in downstream logic or leaderboards. For example, anyone could award tokens or onchain credentials to the top players in a given time period.
While several hackathon projects explored this concept, Nishant took it a step further by creating a library of reusable components that simplifies using zkVMs and Aligned for other developers building verifiable games.
ZKGameKit: Developer Infrastructure for Building ZK-Verified Games and Frontends
Now let's dive into how ZKGameKit works and how to use it to create your own game!
Creating games that use ZK is challenging! Like developing other dApps, it requires developers to work with a variety of technologies:
Technical complexity
- Requiring a deep understanding of zero-knowledge proofs and their intricacies (note that the use of zkVMs helps address this issue)
- Navigating the complexities of blockchain integration for seamless functionality.
- Overcoming the difficulties of coordinating multiple interconnected services.
- Addressing the steep learning curve associated with state management in decentralized environments.
Development overhead
- The cost of verifying proofs onchain (this is where Aligned comes in)
- Managing dynamic, real-time game states in a decentralized context.
- Ensuring secure and efficient proof generation during gameplay.
- Coordinating between various services and ensuring interoperability.
- Tackling the time-intensive setup and integration process for ZK technology.
Blockchain Integration
- Establishing interactions with verification services.
- Managing on-chain transactions while ensuring reliability and security.
- Handling wallet connections for smooth player interactions.
- Optimizing gas costs and understanding blockchain-specific constraints.
With these challenges in mind, this project aimed to provide a secure, well-documented framework that helps developers build these games more quickly.
ZKGameKit solves several of the problems associated with building verifiable games using zkVMs and Aligned:
Streamlining development
The platform accelerates game development with a range of pre-built solutions:
- A pre-configured backend for seamless game state management.
- A ready-to-use ZK verification pipeline for effortless integration.
- Real-time updates powered by Socket.IO for dynamic gameplay.
- A modular architecture designed for easy customization and scalability.
Aligned integration
The integration with Aligned simplifies complex processes by offering:
- An easy-to-implement proof verification flow.
- Automated management of batch transactions to streamline operations.
- Built-in transaction handling for reduced development overhead.
- Gas optimization strategies to minimize costs and improve efficiency.
Reusable components
Reusable tools and templates lets developers move faster:
- Game-agnostic backend services that work across various game types.
- Flexible frontend templates for quick and easy UI customization.
- Standardized verification patterns that simplify ZK proof implementation.
- Fully customizable game logic to fit unique project requirements.
Developer Experience
The platform is designed with developers in mind, ensuring ease of use and efficiency:
- Comprehensive documentation for a clear and guided onboarding process.
- A working example implementation to accelerate learning and experimentation.
- Standardized patterns for consistency and best practices in development.
- A quick setup process to reduce the time required to get started.
Building a similar framework from scratch is time-consuming—based on our hackers' experience, it can take weeks to learn how to use ZK proof generation, integrate with Aligned for verification, and implement complex state management systems (depending on their level experience, of course). This demands coordination across multiple services, plus expertise in smart contracts and blockchain technology, creating substantial overhead. However, the ZKGameKit framework helps make this process accessible—even developers and enthusiasts with minimal backend knowledge can quickly build verifiable games by taking advantage of pre-built tools, reusable components, and optimized workflows.
How to get started?
- Clone the template.
- Customize the game logic.
- Modify verification parameters.
- Build your frontend.
- Deploy with minimal blockchain knowledge!
Block-Nonce serves as both a proof of concept and a template, demonstrating how to create ZK-verified games without any deep cryptographic expertise. Leveraging ZKGameKit as a starting point, devs can spend more time focused on crafting fun and engaging gaming experiences, effectively abstracting away some technical complexities. This is a great example of how zkVMs are making ZK more accessible to developers, and of how Aligned brings down verification costs so these applications become economically feasible to bring to market.
Further Development Plans
- NPM package for easier integration
- Multiplayer games
- CLI tool for project setup
- Beyond grid games & additional templates
- Developer community support
Reach out to Nishant if you’re interested in using or contributing to ZKGameKit, and check out these links to learn more:
Check out our Aligned Builders Hackathon on Devfolio to learn more about the submitted projects, and follow our socials and blog for more articles like this.
Let’s keep the conversation going; we’d love to hear what you think!
Stay tuned: 🐦 Twitter | 🗨️ Telegram | 👾 Discord | 🌐 Website | 📝 Manifesto