Disclaimer: I know that client-side is always to be held with suspicion, but I'm trying to conceive of a way to verify the success or failure of javascript-based mini-games.
Mini-games to add fun to client-side game
Here is an example scenario:
I implement a javascript-dependent picture-sliding game for various pictures.
You know the type:
So that would be a javascript game that would be served from my website.
How to check success
I then want to set up a verification scheme to verify that the game has been completed, the browser would ping the website with a verification code or scheme to say "hey, I'm done, and the javascript mini-game is complete".
There are two ways that I can think of to make the verification work.
One is a "replay" scheme, e.g. each of the moves that the user does would be concatenated and sent to the server, which would have a system for verifying that the end result was indeed a valid solved state.
The other is a "summary" verification code, for example if each of the numbers is assigned a random letter client-side, the final sliding puzzle state would result in a word-code like asdfaseasewadsfwef when read from left to right, top to bottom, which can be sent to the server upon completion to receive a pass/fail grade of success. Obviously that isn't checking the intermediary steps, just the final result, but it'd probably be a lot faster and less resource-intensive, and would probably prevent a bit more abuse than just a GET request with a "go" parameter.
I don't have a huge, high bar for 100% secure communication in this case because I just want to add fun, and give some minor/non-overwhelming benefits from the mini-games, not build a fort-knox system. And if someone is smart enough to hack up a solution to the mini-games to automate them, I won't be excessively broken up about it.
Techniques?
So with that in mind, are these two approaches valid? Are there other approaches to try with this? Any examples in the wild that I could learn from?