Skip to main content
1 of 5
nick carraway
  • 1.1k
  • 1
  • 9
  • 23

Dude, you clearly stated in your question decryption, not encryption. You can use a signature function for this. Here's how:

  1. Post a signature to a blockchain. Nobody knows who signed this signature or what the data contains.
  2. Whenever you want to decrypt this signature, provide the address that signed it, as well as the data it contains. As long as the address you signed it with is new (i.e. randomly-generated), the data remains hidden until this time.
  3. Do the validation of the signature on-chain so your smart contracts can respond to a correctly decrypted value.

Because Web3 is constantly changing, look into the Open-Zeppelin SignatureBouncer.sol contracts, as well as their tests in Web3 for working Solidity/Javascript code.

nick carraway
  • 1.1k
  • 1
  • 9
  • 23