I have a problem I haven't been able to figure out, as follows: Suppose I have a game running on the blockchain (a solidity/smart contract game) where there are a limited number of plots of land that people can purchase. Hidden in each plot of land are some resources and items - these are known to the game developer (me) a priori and are stored in an encrypted manner on IPFS or something similar. Game players who own these plots of land will have to explore the land in some fashion by taking various actions, and at the end of each action the smart contract should reveal to the player (A) whether any hidden item was found as a result of the player's action and (B) if found, what exactly is the item and what are all it's characteristics.

Most information I have seen online about encrypted storage of data on IPFS has been about how the player/user would store his/her own data in an encrypted manner. But in my case, I want the data to be hidden from all players and only accessible to the smart contract. Actually, even the smart contract should not be able to get complete access to the data - the smart contract should only be able to answer the question of whether the player's action has resulted in the hidden items being found. This suggests that what I really need is a layer over IPFS with functions that only the smart contract can access that can use the player's series of actions and encrypted data (which may have been updated by prior actions) to answer questions regarding the discovery of hidden items.

I understand that Chainlink might have some elements of the solution to this, but unfortunately Chainlink costs would be prohibitive for anyone making repeated actions - something like 0.1-0.2 LINK per request, which comes out to about $2-$5.

Has anyone else run into a problem like this? How might I go about solving it?

1 Answer 1


Take a look at Dark Forest's cryptographic fog of war.


It does not directly answer your question as it is not the smart contract decrypting data on IPFS (and I don't think a contract would be able to do so) but your description of hidden map items reminds me a lot of Dark Forest.

A core idea behind Dark Forest is the SNARK-secured cryptographic fog of war. In Dark Forest, players don’t submit the coordinates of planets they conquer to the core smart contract - rather, they submit commitments to their planet locations (by hashing the planet coordinates), along with zero-knowledge proofs that the hashes are valid. This keeps planet locations secret.

They use zero-knowledge so that the users can prove they know what's on the map without revealing what's on the map. To reveal areas of the map, you have to basically brute-force the regions, which acts like a proof-of-work to uncover features and has to be done locally by the users.

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.