Consider the following scenario:
- User writes a message to the blockchain which is ciphered (encoded, hashed).
- User provides a
codeand using that code it's possible to decipher what is written in the blockchainonly once. - The
codedoesn't work for the second time, but the user can provideanother codethat helps someone to see the message againonly once. - It's possible to provide as many
one-timecodes 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.