MetaMask / MetaMask/core

[Proposal] Persist UserStorageController e2ee content keys

Open
#5,128 0 comments 0 reactions 1 assignee Claimed by @mirceanis View on GitHub
team-identity
Dominant language
TypeScript
Stars
413
Forks
308
Avg merge
1d 4h
Merged PRs (30d)
253

Description

The UserStorageController e2e encryption keys are derived from a `storageKey` that is specific to the user profile. The key derivation function used is scrypt, with parameters recommended for password inputs. This means that it's a very costly operation (on the order of seconds on a 2024 mobile device).
These derived keys are cached in memory for the lifetime of the controller instance, but a better approach would be to use a Key Store, to persist the derived keys in a safe manner. This would avoid the rerun of the costly key derivation operation on every app restart.

In preparation for a multi-device / multi-SRP user profile (and user storage) world, the KeyStore should wrap keys using a deterministic approach. See [upgrade plan](https://www.notion.so/metamask-consensys/E2EE-passwords-salts-and-keys-14cf86d67d688063bc44d7224431f16d) for details.
A proposed approach to enable this is to use the preinstalled [message-signing-snap encryption capabilities](https://github.com/MetaMask/message-signing-snap/issues/101)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.