How secured are private data stored on blockchain?












2














I'm quite new in Ethereum world and I'm still little bit confused about this:
If I store any data on blockchain, is it readable from anyone? Let's say I have this is Solidity:



...
string private myVerySecretText;

function getText() external returns(string){
require(msg.sender == something);
return myVerySecretText;
}
...


If I'm the user that match the require statement, I can access the data, but is there some possiblity to read this data from anyone else? I know that the whole blockchain is public, so is there possible to read somehow even the private data? And can anyone read the code from my smartcontract when is deployed on a blockchain?










share|improve this question







New contributor




Banana Cake is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    2














    I'm quite new in Ethereum world and I'm still little bit confused about this:
    If I store any data on blockchain, is it readable from anyone? Let's say I have this is Solidity:



    ...
    string private myVerySecretText;

    function getText() external returns(string){
    require(msg.sender == something);
    return myVerySecretText;
    }
    ...


    If I'm the user that match the require statement, I can access the data, but is there some possiblity to read this data from anyone else? I know that the whole blockchain is public, so is there possible to read somehow even the private data? And can anyone read the code from my smartcontract when is deployed on a blockchain?










    share|improve this question







    New contributor




    Banana Cake is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      2












      2








      2







      I'm quite new in Ethereum world and I'm still little bit confused about this:
      If I store any data on blockchain, is it readable from anyone? Let's say I have this is Solidity:



      ...
      string private myVerySecretText;

      function getText() external returns(string){
      require(msg.sender == something);
      return myVerySecretText;
      }
      ...


      If I'm the user that match the require statement, I can access the data, but is there some possiblity to read this data from anyone else? I know that the whole blockchain is public, so is there possible to read somehow even the private data? And can anyone read the code from my smartcontract when is deployed on a blockchain?










      share|improve this question







      New contributor




      Banana Cake is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I'm quite new in Ethereum world and I'm still little bit confused about this:
      If I store any data on blockchain, is it readable from anyone? Let's say I have this is Solidity:



      ...
      string private myVerySecretText;

      function getText() external returns(string){
      require(msg.sender == something);
      return myVerySecretText;
      }
      ...


      If I'm the user that match the require statement, I can access the data, but is there some possiblity to read this data from anyone else? I know that the whole blockchain is public, so is there possible to read somehow even the private data? And can anyone read the code from my smartcontract when is deployed on a blockchain?







      blockchain security private






      share|improve this question







      New contributor




      Banana Cake is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      Banana Cake is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      Banana Cake is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 7 hours ago









      Banana Cake

      111




      111




      New contributor




      Banana Cake is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Banana Cake is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Banana Cake is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          1 Answer
          1






          active

          oldest

          votes


















          2














          All the data in the Blockchain is public. The "public" keyword creates a getter for the variable, (a function that return the value). When you make it private the getter is not created but you can access the storage of the contract. web3 allows you to read the storage using:



          web3.getStorageAt(address, position)


          see this for more info



          Hope this helps






          share|improve this answer





















          • Thank you. And are the data readable after the getStorageAt function or is it in some format/ data type that is not readable and can't be transferred to a readable form? I'm asking because I want to store there some private data and I'm not sure if is necessary to use some encryption or I can just let it be only as it is..
            – Banana Cake
            3 hours ago












          • web3 will return a number in hexadecimal. If the information is private you should encrypt it. If this answered your question please accept the answer.
            – Jaime
            2 hours ago













          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "642"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });






          Banana Cake is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fethereum.stackexchange.com%2fquestions%2f65096%2fhow-secured-are-private-data-stored-on-blockchain%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          All the data in the Blockchain is public. The "public" keyword creates a getter for the variable, (a function that return the value). When you make it private the getter is not created but you can access the storage of the contract. web3 allows you to read the storage using:



          web3.getStorageAt(address, position)


          see this for more info



          Hope this helps






          share|improve this answer





















          • Thank you. And are the data readable after the getStorageAt function or is it in some format/ data type that is not readable and can't be transferred to a readable form? I'm asking because I want to store there some private data and I'm not sure if is necessary to use some encryption or I can just let it be only as it is..
            – Banana Cake
            3 hours ago












          • web3 will return a number in hexadecimal. If the information is private you should encrypt it. If this answered your question please accept the answer.
            – Jaime
            2 hours ago


















          2














          All the data in the Blockchain is public. The "public" keyword creates a getter for the variable, (a function that return the value). When you make it private the getter is not created but you can access the storage of the contract. web3 allows you to read the storage using:



          web3.getStorageAt(address, position)


          see this for more info



          Hope this helps






          share|improve this answer





















          • Thank you. And are the data readable after the getStorageAt function or is it in some format/ data type that is not readable and can't be transferred to a readable form? I'm asking because I want to store there some private data and I'm not sure if is necessary to use some encryption or I can just let it be only as it is..
            – Banana Cake
            3 hours ago












          • web3 will return a number in hexadecimal. If the information is private you should encrypt it. If this answered your question please accept the answer.
            – Jaime
            2 hours ago
















          2












          2








          2






          All the data in the Blockchain is public. The "public" keyword creates a getter for the variable, (a function that return the value). When you make it private the getter is not created but you can access the storage of the contract. web3 allows you to read the storage using:



          web3.getStorageAt(address, position)


          see this for more info



          Hope this helps






          share|improve this answer












          All the data in the Blockchain is public. The "public" keyword creates a getter for the variable, (a function that return the value). When you make it private the getter is not created but you can access the storage of the contract. web3 allows you to read the storage using:



          web3.getStorageAt(address, position)


          see this for more info



          Hope this helps







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 5 hours ago









          Jaime

          4,9771217




          4,9771217












          • Thank you. And are the data readable after the getStorageAt function or is it in some format/ data type that is not readable and can't be transferred to a readable form? I'm asking because I want to store there some private data and I'm not sure if is necessary to use some encryption or I can just let it be only as it is..
            – Banana Cake
            3 hours ago












          • web3 will return a number in hexadecimal. If the information is private you should encrypt it. If this answered your question please accept the answer.
            – Jaime
            2 hours ago




















          • Thank you. And are the data readable after the getStorageAt function or is it in some format/ data type that is not readable and can't be transferred to a readable form? I'm asking because I want to store there some private data and I'm not sure if is necessary to use some encryption or I can just let it be only as it is..
            – Banana Cake
            3 hours ago












          • web3 will return a number in hexadecimal. If the information is private you should encrypt it. If this answered your question please accept the answer.
            – Jaime
            2 hours ago


















          Thank you. And are the data readable after the getStorageAt function or is it in some format/ data type that is not readable and can't be transferred to a readable form? I'm asking because I want to store there some private data and I'm not sure if is necessary to use some encryption or I can just let it be only as it is..
          – Banana Cake
          3 hours ago






          Thank you. And are the data readable after the getStorageAt function or is it in some format/ data type that is not readable and can't be transferred to a readable form? I'm asking because I want to store there some private data and I'm not sure if is necessary to use some encryption or I can just let it be only as it is..
          – Banana Cake
          3 hours ago














          web3 will return a number in hexadecimal. If the information is private you should encrypt it. If this answered your question please accept the answer.
          – Jaime
          2 hours ago






          web3 will return a number in hexadecimal. If the information is private you should encrypt it. If this answered your question please accept the answer.
          – Jaime
          2 hours ago












          Banana Cake is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          Banana Cake is a new contributor. Be nice, and check out our Code of Conduct.













          Banana Cake is a new contributor. Be nice, and check out our Code of Conduct.












          Banana Cake is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Ethereum Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fethereum.stackexchange.com%2fquestions%2f65096%2fhow-secured-are-private-data-stored-on-blockchain%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          濃尾地震

          How to rewrite equation of hyperbola in standard form

          No ethernet ip address in my vocore2