This question already has an answer here:
i am currently storing a secret (string) directly inside a smart contract. The idea is that the smart contract only allows authorized people to obtain the secret. The problem is that the smart contract is on the blockchain and everyone can simply decompile it.
What is the best practice to solve this issue?
As an example one could think of a bidding contract, which contains a secret (reward for the highest bidder). After a bidding round the secret can be obtained by the highest bidder. Is there a way to securely store the secret?
I'm mainly interested in a solution that does not contain a trusted third party.