2

I have understood that I can access EVM Storage slot by using web3.eth.getStorageAt(addr, index). If this can be applied to the password, then it seems like I can access to any state variables. How can I prevent user to access to EVM Storage slot?

2 Answers 2

6

No, don't try to store private things directly on the chain, nor private variables, all data is public. It may not be easy to decrypt your data without disclosing your source code.

1

Blockchain is a public and transparent system by design, and any data stored on-chain can potentially be accessed by anyone. However, some considerations may help you protect sensitive information and prevent unauthorized access, such as store sensitive information in encrypted form within the contract state; Use visibility modifiers like internal or private for state variables that don't need to be accessed externally; store data in a hashed form in the storage slots, this can obscure the actual data and require additional steps to recover the original information...While the above measures can help mitigate risks, it's not absolute.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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