0

When I set an attribute to private it's not accessible from outside, but everyone who runs a node can still see it.

Someone told me to use encryption to hide attribute values, but how should this work, would not everyone also see than the key I used to encrypt my data? Is there a default way to handle this in Solidity?

  • The solution there is also to encrypt the data. But how to do it? If I do it from outside the blockchain I need to store the keys by myself, what would destroy the intention of the blockchain, because I could lose the key or it get stolen. If I store it in the blockchain you have the problem I mentioned above. How to do it, is there a way in Solidity? –  Jan 07 '18 at 19:25
  • Also related (basically the same): https://ethereum.stackexchange.com/questions/1286/what-are-effective-techniques-to-encrypt-decrypt-data-stored-in-a-smart-contract – Richard Horrocks Jan 07 '18 at 19:45
  • And: https://ethereum.stackexchange.com/questions/2624/private-info-on-ethereum?noredirect=1&lq=1 – Richard Horrocks Jan 07 '18 at 19:45
  • @user7014175 AFAIK the easy solution is not to store private data in a contract. You can use an oracle to process private data outside your contract. A possible alternative is to use zksnarks but it is very recent and the libraries are developing. – Ismael Jan 07 '18 at 19:54

0 Answers0