Two players can bet an equal amount of money in crypto and play decentalized chess game.
The concept can be extended to multiple chains or tokens and later to any turn based game with a cost efficient on-chain decision making approach.
Figuring out how to create a turn based game where the winner is not decided by a central party but the players themselves. The game moves and result should be irrefutable, but at the same time should not be unrealistically costly in terms of gas fees. I ended up creating a hybrid solution using signed messages which are shared between each player.
At any point, the players can submit the last signed message received from the opponent along with their current move to start the timer for opponent to response to challenge. If challenged, both the game states are compared for a valid move from a neutral external API taking only the board states at each move. The API is called using chainlink and is not aware of which player made which move and is only called if a malicious message is submitted.
Understanding the logic, stack and implementing it in a short time was quite challenging but a lot of fun.
Discussion