-
Notifications
You must be signed in to change notification settings - Fork 326
Home
-
If the native secure keystore is verified as being available, and it does not contain a master public key, then present the user with the option to create a new wallet.
-
Using a native source of entropy suitable for cryptographic use, obtain 128bits of random data.
-
Use BRBIP39Encode() to encode this 128bits of data as a 12 word recovery phrase.
-
Store the resulting recovery phrase in the native secure keystore.
-
Store any appropriate wallet authentication information in the secure keystore as well, such as a user selected passcode.
-
Use BIP39DeriveKey() to derive a master private key from the recovery phrase, feed this to BIP32MasterPubKey() to get the master pubkey, and store the master pubkey in the secure keystore.
The master pubkey should be available to the wallet app without user authentication, so that it can be used for background network syncing, and/or syncing immediately on app launch prior to the user being authenticated. It's desirable to use the keystore so that it will be removed in any situation where the keystore data goes missing, such as a backup/restore to a different device that fails to migrate keystore data.