6

I was reading solidity Docs and everything made sense until I got to this:

enter image description here

What are external observers? Is it clients listening for events or is it anyone who has access to web3 api?

For example, who can access and modify uint private x = 255; except the contract it's in?

In other words, how can one get the value stored in a private state variable?

eth
  • 85,679
  • 53
  • 285
  • 406
manidos
  • 4,298
  • 3
  • 31
  • 55
  • Related: http://ethereum.stackexchange.com/questions/6547/solidity-functions-visibility – eth Nov 20 '16 at 01:38

1 Answers1

4

External observers are anyone who access to a block explorer, or is otherwise able to get blocks from the network and parse the data on the blockchain.

Note that they can only access data in your contract, they are not able to modify it.

So we can all find out the value of your uint private x. If I wrote a contract, the contract wouldn't directly be able to see what x was, because x would be a private variable in a different contract. But if my contract trusted me I could look up x myself and send it to my contract as a parameter...

Edmund Edgar
  • 16,897
  • 1
  • 29
  • 58