Hide/Reveal Scheme with O1js, and attempting to use Acurast TEE Processors for Oracles
his is Proof of Concept Game that uilizes utilizes zero-knowledge proofs (ZKPs) implemented through O1js, a TypeScript library for zk-SNARK circuits. These ZKPs enable players to commit to strategies without revealing them, ensuring game-theoretic integrity. I also used O1js's new offchain storage API, allowing for efficient management of large game states without compromising on-chain efficiency or security. This offchain storage solution is pivotal in handling the complex, evolving nature of player strategies and game progression.
The game's unique feature is the incorporation of real-time weather data as a decisive factor in battle outcomes. I explored Acurast, a decentralized oracle network, to fetch and integrate this data. Acurast's architecture, built on Trusted Execution Environments (TEEs), allows for the secure, confidential, and verifiable acquisition and on-chain submission of weather data. This implementation creates a trustless bridge between off-chain real-world conditions and on-chain game mechanics.
Since I cannot upload pictures here- Here's a link to the architecure diagram of my project: https://github.com/enderNakamoto/battle_zkapp?tab=readme-ov-file#game-architecture
The main parts of the game are: