celo-org / celo-monorepo

Official repository for core projects comprising the Celo platform
https://celo.org
Apache License 2.0
687 stars 362 forks source link

JavaScript native keystore #7063

Closed aslawson closed 3 years ago

aslawson commented 3 years ago

Quick Implementation: I see this as basically a state management and persistence library that wraps the LocalWallet functionality already in ContractKit, ideally providing support for each environment we want to run it in. LocalWallet keeps the private key in memory and has support for all operations (sign, decrypt, computeSharedSecret, etc) that we're currently thinking about. In an effort to move away from Geth signing data and controlling keys we just need more people to use this LocalWallet safely.

Could also explore KeystoreManager - Basically an API for getting (and decrypting) the private key in a way all the consumers can implement.

Use Cases

Thoughts on Clef:

AlexBHarley commented 3 years ago

Seems like the ideal scenario here is something Valora can use (ReactNative compatible), the browser can use (LocalStorage / IndexedDB compatibility) and something the CLI can use (file system access).

Where does Metamask store private keys?

Metamask uses a library called LocalForage, that acts as a thin wrapper around LocalStorage and IndexedDB. AFAICT metamask simply stores private keys with that, encrypted with a password / pin.

aslawson commented 3 years ago

Added old description for posterity