[SDK] How to properly use the EIP712 signer in frontend? #21
-
EnvironmentTestnet Acknowledgement
Issue DescriptionCurrently I am having the user store their private key in localstorage for usage with the Wallet class, In below example api.signer is the initialized Wallet Expected BehaviorHave a cleaner way in the web3 SDK to use for example (metamask) to sign transactions Code Example
Repo Link (Optional)No response |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
@VanillaScent a couple things to mention here. See below.
Hope that helps to some extent! |
Beta Was this translation helpful? Give feedback.
-
@dutterbutter |
Beta Was this translation helpful? Give feedback.
-
This issue has been inactive for some time now. To keep the issue tracker clean and focused, we are considering closing older issues without recent activity. If this issue is still relevant, please comment to keep it open. |
Beta Was this translation helpful? Give feedback.
@VanillaScent a couple things to mention here. See below.
Storing a user's private key in
localStorage
is generally considered unsafe and should be avoided.localStorage
is not designed to be a secure storage solution. It is accessible by any script running in the same origin, meaning any JavaScript code on the same domain can access and manipulate the data stored inlocalStorage
. If an attacker manages to inject malicious code into your application, they could potentially access and steal the private key fromlocalStorage
. It also does not provide built-in encryption for data storage.It is difficult to suggest a "recommended approach to sign EIP712 transactions in frontend applicati…