We are trying to build battleship style guessing game and on smartcontract storages/data are visible so people can easly cheat.Is there any work around for this ?

  • SE is a technical forum and questions must be technical in nature. This is not a technical question.
    – 0x10
    Commented Jul 5, 2022 at 6:18

1 Answer 1


You can use commit/reveal pattern, for turn based game it works well. Here a template in CameLIGO you would be able to adapt to your use case: https://github.com/ligolang/randomness-cameligo

  • I suppose we should summarize or quote from the link. However, I've noticed that the question says "battleship style guessing game" -- that's vague, but, it's not obvious to me how to implement it using commit/reveal.
    – Tom
    Commented Jul 7, 2022 at 22:22
  • You would start with: At the beginning of the game, each player commit its grid (actually 1 chest per box batched all togeter in a transaction); At each round, when a player announce a target square, the oponent reveal the relative chest
    – Thomas
    Commented Jul 8, 2022 at 15:49
  • Makes sense... then I guess we find out at the end (after chests forced open if necessary) whether a player cheated in their setup (say, grid with no ships on it) and can punish them?
    – Tom
    Commented Jul 9, 2022 at 17:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.