Skip to content

Is it safe to store Near private-key in browser localStorage? #880

Answered by willemneal
Slyracoon23 asked this question in Q&A
Discussion options

You must be logged in to vote

Great question! As is usual it depends. Keys in local storage are function access keys; they can only sign transactions on behalf of the user for a set of the corresponding contract's methods (default is all of them) with an allowance of 0.25 N that can only be used to pay network fees. Anytime you need to make a transaction that attaches a deposit of NEAR to the call the user is redirected to a wallet with a full access key that has the permission to transfer the NEAR. When "logging in" to an app you are redirected to a wallet and sign a transaction with a full access key to add a new function access key.

A common pattern for a function call to force the user to sign with a full access k…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Slyracoon23
Comment options

@willemneal
Comment options

Answer selected by thisisjoshford
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants