78 points · by posternut · 10y ago · 39 comments
link to their github repo for ethereum chess: https://github.com/ise-ethereum/on-chain-chess
They say
> For checkmate and stalemate, to verify the condition all possible moves have to be calculated and verified, which is unfeasible on the blockchain.
But "all possible moves" is only one-move deep. We're generally talking a couple dozen possible moves at most. If the system can't calculate a couple dozen possible moves, how is all the basic move logic being done "on chain," as they say?
They could have simply adopted blitz chess rules, where the goal is to capture the opponent king, and leaving your king in check is not illegal, to avoid all this extra computation...
I wonder if it's cheaper to verify a proof of checkmate that someone else computes. I'm not sure exactly what such a proof would look like, but there are lots of problems where finding a proof is hard, but verifying one is easy. Then you could make the checkmating player prove that it's checkmate and provide that proof along with their final move, and the contract could just verify it.
I was going to make a counter-argument but then I realized that this system doesn't normally enumerate legal moves, simply verify legality of moves that are actually played, which is a crucial distinction here.
Thanks for making this observation; I found it a pretty subtle point!
Those are not blitz chess rules. The goal of blitz is still checkmate, not capturing the opponent's king. USCF, FIDE, WBCA all agree, leaving a king in check is an illegal move and loses the game as soon as it is pointed out.
Isn't checkmate a very constrained 2-ply search? If you have a 1-ply search that suffices to check that kings are not left in check, isn't the checkmate simply using that search for each of the maximum 9 board positions (including current one) that the king can occupy? I must be missing something about blockchain computation because the article says this:
"In order to verify a checkmate, Grau wrote, all possible moves must be calculated and verified, which he and his peers found was not feasible on the blockchain."
This could allow for player error, but to prevent that you simply have client-side code perform the steps.
You'd probably need a second button that instigates the stalemate procedure if both players have pressed it because that's a much more complex problem.
[1]: https://en.wikipedia.org/wiki/Threefold_repetition [2]: https://en.wikipedia.org/wiki/Fifty-move_rule
Fide Rules 5.2 (B)
The game is drawn when a position has arisen in which neither player can checkmate the opponent’s king with any series of legal moves. The game is said to end in a ‘dead position’. This immediately ends the game, provided that the move producing the position was legal. (See Article 9.6)