Inspiration and What it does

Our solution addresses two critical pain points in current on-chain gaming:

  1. Cost Efficiency: On-chain gaming can be prohibitively expensive. To tackle this, we've adopted zero-knowledge proofs (zkp) to prove the entire evolution of the game. This significantly reduces costs while ensuring the game remains verifiable and fair.

  2. Enhanced Gameplay: Building upon the foundation of Conway's Game of Life, we've introduced two-player competitive versions and incorporated AI agents. This introduces exciting gameplay dynamics, including player-versus-AI matches, with NFT rewards upon victory.

By addressing these issues, our on-chain game not only becomes more accessible due to reduced costs but also offers richer and more engaging gameplay experiences.

How we built it and Challenges we ran into

Reducing On-Chain Costs

  • We explored various solutions to reduce the on-chain costs of the game.
  • Initially, we considered using circom to write circuits and generate SNARK proofs. However, this approach proved to be too limited in scalability, supporting only simple game logic.
  • Another idea was to write the entire game in Solidity and put it in a rollup. However, this approach posed challenges in rendering the game frame to the frontend for display, especially without emitting all data in events, which incurred high costs.
  • Ultimately, we opted to use a ZK coprocessor(zkgraph) to provide proofs of the computational process, publishing the ZKP on-chain for verification. Additionally, we encoded the game board as unit256, with each end bit of the canvas not displaying, significantly reducing costs.

AI Model Selection

  • We conducted extensive trials in selecting the appropriate AI model for the game.
  • Initially, we explored reinforcement learning approaches like Q-learning but found them impractical due to the game's complexity and large search space, leading to high training costs.
  • We ultimately adopted the Minimax search algorithm, which seamlessly integrates with existing technology frameworks and provides rapid feedback on gameplay experience.

Accomplishments that we're proud of

  • Successfully addressing critical pain points in on-chain gaming, including cost efficiency and gameplay enhancements.
  • Implementing zero-knowledge proofs (zkp) to significantly reduce on-chain costs while ensuring game verifiability and fairness.
  • Introducing innovative gameplay dynamics with two-player competitive versions, AI agents, and NFT rewards.
  • Developing a scalable and efficient solution with the zkLife-Game of Life zkgraph Version.

What we learned

  • Overcame challenges in AI model selection, ultimately adopting the Minimax search algorithm for enhanced gameplay.
  • Gained insights into zero-knowledge proofs and their application in on-chain gaming.
  • Learned to integrate advanced features while maintaining scalability and cost-efficiency.

What's next for zkLife-Game of Life zkgraph Version

  • Expansion of gameplay features and modes to offer even more engaging experiences for players.
  • Exploration of additional use cases for zero-knowledge proofs within the game ecosystem, potentially extending to other games and applications.

Built With

Share this project:

Updates