I want to create a program (on the Ethereum Virtual Machine), that can access some data under certains condition (only if authorized). So the program checks the authorization, and then (eventually) accesses the data.

What if a dishonest node execute a different program that accesses the data without checking authorizations? Does Ethereum offer some protection against node that want to execute a program "alone"? Or should I implement something that allows accessing that data only if a large part of nodes achieve consensus?

I hope I explained it clear. Thank you

  • what do you mean by accessing data? reading data in your contract? – Roland Kofler Jul 25 '16 at 13:37

To make it clear: You do not have privacy in the blockchain.

You can store some data in a smart contract and then provide some access conditions. But that only limits the data that can be seen by calling the code of the smart contract.

The way blockchain works, at least for now, is that everyone who mines has every bit of information of the blockchain stored on their disk. So no one is stopping them from just going on disk and look for anything stored on the blockchain without using any function call or interacting with smart contracts.

There are some techniques that could be used to hide information in blockchain, but they are not really blockchain related. By default blockchain does not provide any privacy.

To answer the other question: If a node executes a different code then the one stored in the smart contract it will be detected by the network and it will not validate the execution.

If your data resides in the contract it can be read by every node without asking for permission. What Ethereum guarantees is only the state change that your contract describes is correct. Correct means that it was initiated by a transaction with enough gas and that the result of the execution is correctly published in the blockchain. This is guaranteed because every node executes the contract in order to mine a block correctly. So other nodes would see that the state-tree the attacker generates is not correct and reject the block as invalid.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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