Suppose there is a smart contract with a bidding function, and the bidder can send the bid price to the smart contract after encrypting it. When the auction is over, a trusted third party sends the decryption key to the smart contract, which uses the key to decrypt the cipher text and announce the results. My questions are:

  1. how to guarantee that the execution environment of the smart contract is secure, i.e., that the decryption key is not exposed during execution.
  2. how to guarantee the security of the decryption key during transmission, i.e., the decryption key will not be obtained by anyone except the smart contract and the trusted third parity.

1 Answer 1


In a public blockchain like Ethereum, you can't guarantee these. Your biggest issue is that once the trusted third party issues the transaction, anyone can see it and its contents (even before it's mined and executed). So the key is visible for everyone before execution and during execution.

Public blockchains like Ethereum simply aren't meant for secret data.

You can use various "commit and reveal" schemes, or some sort of smarter encryption scheme, but it all gets complicated. In the end, all data in the blockchain is freely available for everyone.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.