1

I developed a maze game in Solidity with a treasure at a location in the game. Players send transactions to move. The first to find the treasure wins some ether.

Is there no solution to the problem that the treasure position will be visible to anybody who looks into the transactions input data? I know how to hide information submitted by players, like in a rock-paper-scissors game, by hashing the answers and providing the key when the game is finished. But I think that doesn't work here, as the information to hide is needed by the contract to check if a player is at the treasure's position and trigger the reward. Is there any way (even complex) to workaround this somehow, or is this game just not meant to be on the blockchain?

In case that helps, here is the code: https://github.com/jquentin/EtherMaze/blob/master/EtherMaze%20-%20Payable.sol

8
  • But next version will have zk-snarks..
    – Ismael
    Commented Sep 29, 2017 at 4:21
  • I am aware of that other question, but mine is more specific to this very situation where the information to hide is not information submitted by the player and later revealed. In which case we could require the player to hash the information. Commented Sep 29, 2017 at 5:00
  • And yes, there might be some new answers now. The other one is very old in blockchain time... Commented Sep 29, 2017 at 5:04
  • W/o looking at the contract, will it be multiplayer ? Should every check of going in the right direction be a transaction, or shall players only provide the right path in a transaction ?
    – n1cK
    Commented Sep 29, 2017 at 17:57
  • Multiplayer, yes. And 1 transaction per move. Obviously not a cheap way, the treasure must be worth it. But I'm asking technical feasibility, not business model :) Commented Sep 30, 2017 at 15:19

0