Provide a password to see on-chain information only once


This Content is from Stack Overflow. Question asked by asmbaty

Consider the following scenario:

  1. User writes a message to the blockchain which is ciphered (encoded, hashed).
  2. User provides a code and using that code it’s possible to decipher what is written in the blockchain only once.
  3. The code doesn’t work for the second time, but the user can provide another code that helps someone to see the message again only once.
  4. It’s possible to provide as many one-time codes as possible.

Did I just describe a classic cryptography problem? How is it possible to achieve this using Solidity? Some parts of the algorithm can work off-chain but the original message must be on-chain.


This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?