I'm reading several articles about privacy in ethereum smart contracts but still I don't understand how everything in the smart contract is visible to anyone?
What does this mean?
Ethereum Stack Exchange is a question and answer site for users of Ethereum, the decentralized application platform and smart contract enabled blockchain. It only takes a minute to sign up.
Sign up to join this communityI'm reading several articles about privacy in ethereum smart contracts but still I don't understand how everything in the smart contract is visible to anyone?
What does this mean?
On a public blockchain, all the transactions between accounts (externally controlled and smart contract) are public. You can browse each transaction of each block using tools such as EtherScan.
For example, on the picture below, you can see every data for a transaction to a smart contract (write operation) :
Moreover, you can call read only (constant
) operations for a smart contract if you have the ABI and the contract address.
pragma solidity ^0.4.0;
contract SimpleStorage {
uint storedData;
function set(uint x) public {
storedData = x;
}
function get() public constant returns (uint) {
return storedData;
}
}
Here anybody can call get()
to retrieve the value of storedData