Read only return values from a Solidity function

micedamiceda Member Posts: 2
My understanding is that any write operations to a contract are executed through a transaction which automatically verifies the authenticity of the sender. However, read options can technically be called by anyone that may happen to know the address of the contract. Is that correct? Is it safe to assume then that it's the developers responsibility to protect read operations if you want to prevent "unauthorized" reads? I just want to make sure I'm not missing something?


  • maxxflyermaxxflyer Member Posts: 30
    there is no way to prevent unauthorized reads. everything is totally transparent. unless you crypt datas with an external password, kept externally, not on the blockchain, otherwise it will be visible by anyone
  • tcimolitcimoli Cagliari - ItalyMember Posts: 35
    It seems to me, that if you want to protect the access, you could make the field private and create a getter for it. In this way, the getter could control the sender of the message.
Sign In or Register to comment.