Local Storage Read - Algorand
Local Storage Read
post by isha on Sep 2, 2021
Hi, I am trying to understand local and global storage of statefull smart contract.
I get it that global can be read and written by anyone. But not sure how local storage works?
If anyone has idea about it please let me know.
post by fabrice on Sep 2, 2021
Both local and global storage can be read by any stateful application, and can only be written by the application that owns them.
Differences between the two are: where they are stored, the maximum limits, and the necessity for opt-in for local storage. See Your First Application - Algorand Developer Portal
post by isha on Sep 3, 2021
Does that mean local storage is not stored on blockchain?
post by fabrice on Sep 3, 2021
Both local storage and global storage are stored on the blockchain.
“where they are stored” was meant to mean “where exactly in the node database representing the blockchain, they are stored”:
- global storage is stored at the “application” level: it’s unique per application.
- local storage is stored at the “account” level: it’s unique per application and per account.
post by isha on Sep 5, 2021
Oh okay great that helps
Thank you
post by cc9one on Dec 2, 2021
Does this mean that local storage can securely contain confidential information?
post by tsachi on Dec 2, 2021
Both local and global information is stored on the blockchain, and you should avoid storing secrets and/or sensitive information there.
post by fabrice on Dec 2, 2021
To be very clear: everything on the blockchain is public.
You cannot store any private/confidential information on a blockchain.
This is true for Algorand and most, if not all, the other public blockchains.
If you need to store private information, you need to use cryptographic techniques such as encryption and commitments.
Note: Some blockchains provide privacy for transactions, but it’s a very different story. It does not allow you to “store” information per se.