1

My question is if I deploy a contract online, say for example, a contract that represents a loan between Mary and Peter. How much would someone see who tried to decode the block? Is it correct to say that any variable that is public would be visible in hex (so visible as text after decoding)? What about private variables? How about function code itself? Can you store data in the blockchain such that it is not readable?

1

A smart contract cannot store data in the blockchain in such a way that it is not readable.

The execution flow of every call to a smart contract function can always be seen by everyone. All variables (both public and private) can be read by anyone. All code can be read by anyone. Everything directly stored inside the blockchain is public.

The only way to store secret information in the blockchain is to encrypt it before passing it to the smart contract.

  • 1
    Ok, thanks for the feedback. However, I do have a follow-up question... If that is true, and all I have is a block hash (i.e. no ABI or otherwise knowledge of what is in there), how can I read the code and transactions contained in the block? Thanks again! – Philip Rutovitz May 10 '18 at 16:41
  • I second this questions. care to elaborate? – tylerism Aug 20 '18 at 14:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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