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

Dark Trek (ZKP)

Dark Trek merges RTS strategy with Dark Forest, hiding fleet paths for surprise tactics.

Dark Trek (ZKP)

Created At

ETHGlobal Trifecta - Zero Knowledge

Project Description

Dark Trek combines the strategy of classic RTS games with the creativity of Dark Forest. Players use fog of war to conceal fleet paths and surprise their enemies. Blockchain and zero-knowledge proofs (ZKP) ensure privacy, security, and a decentralized gaming experience, adding layers of strategy and unpredictability.

🚀 Features

  • Strategic Stealth: Hide your fleet's movements and use surprise tactics to gain the upper hand.
  • Commit-Reveal Mechanism: Conceal and reveal fleet paths for added strategic depth and privacy.
  • Decentralized & Secure: Built on blockchain and ZKP for transparency and privacy-preserving gameplay.
  • Dynamic Gameplay: Plan ambushes, intercept attacks, or adjust strategies on the fly.

🌟 Why It's Challenging

Building Dark Trek presented several unique challenges:

  • Commit-Reveal Paths:

    • Using ZKP to prove the validity of hidden fleet paths.
    • Ensuring the integrity of hidden routes and their reveal at the right time.
  • Performance Optimization:

    • Reducing circuit constraints to fit under 100k for fast proof generation and efficient gameplay.
    • Ensuring seamless interaction with blockchain networks.
  • Gameplay Design:

    • Creating a fluid experience for players to design, commit, and reveal paths.
    • Developing a game environment where strategy and surprise are paramount.

🚧 Challenges

We identified Griffin Permutation as a potential alternative to MiMC/Poseidon hashes to reduce constraints, and tweaked it to fit our specific scenario. However, we faced challenges in efficiently mapping hashes to the bit array within Bloom Filter constraints.

To address this, we attempted to use VDF (Verifiable Delay Function) to delay the search process. Unfortunately, the Sloth Scheme didn’t prove suitable for the field, resulting in limited progress.

🚀 Future Improvements

  • Further optimize constraints for Bloom Filter hashes while ensuring security.
  • Integrate VDF to limit search capabilities, maintaining small constraint sizes for better performance and scalability.

How it's Made

Technology Stack

  • Noir: High-level language for zk-SNARKs, used to write secure and privacy-preserving circuits.
  • Circom: ZKP circuit development.
  • Circomlib: Libraries for building ZKP circuits.
  • SnarkJS: In-browser proof generation.
  • React: Front-end development.
  • Solidity: Smart contract programming language.
  • Typechain: Automating the connection between contracts and the front-end.

Development Workflow

  1. Circuit Design and Integration:

    • Circom circuits encode game rules and generate Solidity verifiers.
    • The verifier interacts with the core game contract deployed on blockchain networks.
  2. Front-End and Proofs:

    • Circom-generated WASM files enable in-browser proof generation via SnarkJS.
    • React handles the dynamic UI for fleet path design and gameplay interaction.
  3. Blockchain Interaction:

    • Typechain automates smart contract connections to the front-end.
    • Web3.js ensures secure and seamless blockchain communication.
background image mobile

Join the mailing list

Get the latest news and updates