This repo contains a general-purpose recursive scheme for turn-based games built on the Mina blockchain. A demo implementation of the game tic-tac-toe is also presented to showcase a simple application of this general scheme, which can be extended to games like checkers, chess, battleships...
The tictactoe game was originally implemented using lookup tables, as can be seen in commit d390035. The idea behind was verifying that every state transition in the board was part of a precommitted list, which was computed using the generateTables()
function. It was lately scratched due to limited lookup support from o1js, and only used for the final proof settled onchain, as seen on the TicTacToe
smart contract, verifying that the board state is either a win state or a draw state, as precommitted to, generated by the generateTables()
function.
Lookups are implemented using the following PR. A working example, LookupTest
and the corresponding tests are provided.
Built during ETHGlobal Istanbul 🇹🇷 2023 Hackathon.