I’m considering building a SafeChess app (similar to the email app) that lets two people play chess over the safe network. You don’t really need the security, but it could be fun and iron out a few architecture patterns.
I’m struggling with where I should put the logic that validates the players are playing legal moves? If I put it into the app, then potentially a player could create there own ‘evil’ version of the app that lets them play illegal moves. Normally you validate user input server side, but I don’t have a server!
I’m hoping to write the moves of the game to storage as they are played and then keep the game as a whole once finished.
I thought that the app could have two personas, one for playing and one as a third party ‘arbiter’ of games in progress.
When two players agree to play, they also agree upon an arbiter. When a move is made, it is written to appendable data and change permissions allocated to the arbiter. The arbiter checks the move and then changes the permissions to the opposing player, if the move is illegal, the arbiter would delete the last move and change the permissions back to the original player.
Also I’d like to do this in a ‘cheap’ way so that when we get SafeCoin it’s not going to cost $$$ just to play a simple game, so I’m interested in the data types to use (one structured data object vs appendable data with each move). It might be cool to define use a custom tag structured data type for chess games.
Does this make sense or is there a simpler way?
Let me know if you’d like SafeChess built.