Provide a password to see on-chain information only once

Viewed 13

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.

0 Answers
Related