I am designing a system where some data needs to be hidden and the idea is to store it in an encrypted file. How can you allow nodes to interact with it through a smart contract without revealing the encryption key?


1 Answer 1


You can't.

I know this answer ins't good so let me explain. If a node must interact with a data they must know this data.

You have solution but without using smart contract or using smart contract for all except encryption. You can use an private node running a program decrypting data and make all must do. And ethereum address and private key is just asymetric encrypting algo key and private key so you can use address for encrypt data and private key for decrypt it.

PS: The question have already been asked : Store secret data in contract

  • Along with this being the right answer, another option to research is Oracles, where you can bring in your own data to a contract.
    – ReyHaynes
    Jan 29, 2018 at 15:17

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