You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Continuing the discussion on Quill and a Twitter conversation with Alex Komarov of MyEtherWallet re: how to store the HDWallet in Safari Wallet.
We're using the KeystoreV3 code from Essential One's HDWallet library (shown below) with a convenience init in an extension (also shown below). The extension that bridges the gap between the Essential One keystore code and MEWwalletKit. The data to be stored in the keystore is encrypted by a user-defined password.
The file format of the keystore is defined by Essential One's implementation. The question is what do we store in the keystore?
Initially Safari Wallet stored the mnemonic (the 12 word recovery phrase) in the keystore. But with support for multiple languages, it would make opening the file slightly more complicated: the app either has to try to restore the key using multiple languages, or we should store what language was used.
I thought it made sense to store something language-independent so we can recreate the master key and recreate the mnemonic in any language supported. The BIP39.entropy property seemed to fit the bill: it is language independent and allows you to recreate the master key and mnemonic.
However, some developers on the internet advise against storing the entropy in the keystore. I'm not sure why we can't store the entropy. The conversion from entropy to mnemonic will remain consistent, so even if we replace MEWwalletKit with another HDWallet library, the same keys will be generated.
Can we continue to store the entropy in the keychain or is there a good reason to roll back to storing the mnemonic itself in the keystore?
In short what you are asking is: "Can we continue to store the entropy in the keychain or is there a good reason to roll back to storing the mnemonic itself in the keystore?"
Here's what we think.
What to store: we don’t see any compelling reason why should one store actual mnemonic - the whole idea of a mnemonic is to be human readable, so its best to use the machine friendly representation that is more succinct and language agnostic.
How and where to store: since keystore file seems to be the only viable option in your case, the question is how to encrypt its contents and where to store it. We think its best to store it in keychain, and encrypt it with a key generated in a secure enclave, that way you should get security benefits of both, enclave and keychain. The only caveat is that when the user will be changing their phones, they will need to restore their account using their recovery phrase.
Continuing the discussion on Quill and a Twitter conversation with Alex Komarov of MyEtherWallet re: how to store the HDWallet in Safari Wallet.
We're using the KeystoreV3 code from Essential One's HDWallet library (shown below) with a convenience init in an extension (also shown below). The extension that bridges the gap between the Essential One keystore code and MEWwalletKit. The data to be stored in the keystore is encrypted by a user-defined password.
The file format of the keystore is defined by Essential One's implementation. The question is what do we store in the keystore?
Initially Safari Wallet stored the mnemonic (the 12 word recovery phrase) in the keystore. But with support for multiple languages, it would make opening the file slightly more complicated: the app either has to try to restore the key using multiple languages, or we should store what language was used.
I thought it made sense to store something language-independent so we can recreate the master key and recreate the mnemonic in any language supported. The
BIP39.entropy
property seemed to fit the bill: it is language independent and allows you to recreate the master key and mnemonic.However, some developers on the internet advise against storing the entropy in the keystore. I'm not sure why we can't store the entropy. The conversion from entropy to mnemonic will remain consistent, so even if we replace MEWwalletKit with another HDWallet library, the same keys will be generated.
Can we continue to store the entropy in the keychain or is there a good reason to roll back to storing the mnemonic itself in the keystore?
Keystore extension:
Original KeystoreV3 code from EssentialOne:
The text was updated successfully, but these errors were encountered: