-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JS keystore support #8096
JS keystore support #8096
Conversation
packages/sdk/wallets/wallet-keystore/src/keystore-wallet-wrapper.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice progress!
dde7727
to
bb40112
Compare
packages/sdk/wallets/wallet-keystore/src/keystore-wallet-wrapper.ts
Outdated
Show resolved
Hide resolved
packages/sdk/wallets/wallet-keystore/src/keystore-wallet-wrapper.test.ts
Outdated
Show resolved
Hide resolved
packages/sdk/wallets/wallet-keystore/src/keystore-wallet-wrapper.test.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great. I think the most powerful thing here is the fact that we can plug our existing wallet abstraction into this, meaning now files, databases, what have you can back our wallets.
I'm very curious to see how this ends up being used with our other projects like the CLI and attestation service.
### Description - Implements most basic keystore functionality (encrypt, decrypt, change password) base class (+ file system for data persistence), based on `ethereumjs-wallet` - `Keystore` abstraction should make it fairly straightforward to add additional IO formats (browser storage, DB, however valora wants to do this...) - `KeystoreWalletWrapper` is a bare bones wrapper of a file keystore + the `LocalWallet` -- I expect this to change (+ maybe move into its own directory), but would wait until implementing attestation service/CLI-relevant changes before adding more here, in order to see what's necessary/makes sense ### Tested - Unit tests - Tested instantiating, signing, sending txs via the `KeystoreWalletWrapper` + keystore files - Tested that keystore files created by geth can be copied into this keystore directory and decrypted with the same passphrase; same with the reverse (i.e. keystore files created + encrypted with the `FileKeystore` can be copied to the geth keystore directory, decrypted, and used to send txs) ### Related issues - #7063 - related autogenerated docs (split PR so as to not clutter this one) [old file structure PR](#8160), [docs PR new file structure](#8185) ### Backwards compatibility New module, no changes to existing wallets or tools. ### Remaining TODOs - [later PR] modify KeystoreWalletWrapper as makes sense with future use cases
(Up to date with new file structure) - Added autogenerated docs for keystore - Added a walkthrough with code/usage examples in `using-js-keystores.md` (note: will not work until first version is published); [this is what it will look like on gitbook](https://eela.gitbook.io/forked-monorepo-docs-test/~/revisions/-MczCo4GM6pOBxl1YTZq/v/docs-test%2Feelanagaraj%2Fjs-keystore-docs-new/developer-guide/start/using-js-keystores) Split so as to not clutter the first PR (#8096) (apologies for the messy commits here -- wanted to stack them to make the differences cleaner initially but didn't want to wait to land docs with the rest of the PR!)
Description
ethereumjs-wallet
Keystore
abstraction should make it fairly straightforward to add additional IO formats (browser storage, DB, however valora wants to do this...)KeystoreWalletWrapper
is a bare bones wrapper of a file keystore + theLocalWallet
-- I expect this to change (+ maybe move into its own directory), but would wait until implementing attestation service/CLI-relevant changes before adding more here, in order to see what's necessary/makes senseTested
KeystoreWalletWrapper
+ keystore filesFileKeystore
can be copied to the geth keystore directory, decrypted, and used to send txs)Related issues
JavaScript native keystore #7063
related autogenerated docs (split PR so as to not clutter this one) old file structure PR, docs PR new file structure
Backwards compatibility
New module, no changes to existing wallets or tools.
Remaining TODOs