A mnemonic is a human readable list of words that generates a master seed, that in turn, generates wallet accounts for users. It is critical that a mnemonic must be backed-up by the user, as soon as it is generated. If the user’s account is deleted from their device, or if the device is lost, the mnemonic is not recoverable! It is the key to accessing a user’s wallet accounts. We are working on cloud-backup using the iOS/Android keystore for users with smaller account balances.

Generate a Mnemonic seed

Creates a random mnemonic string. Returned string can be displayed to the user for backup. After calling createMnemonic, call createAccount to create the first account using this mnemonic.

Abstrakt.shared.createMnemonic() -> String

Import Mnemonic

This function imports an mnemonic to the device. The user can type in their mnemonic and recover previously generated accounts or import accounts from another device. Two Cases:

  1. The user already has accounts previously created from this menmonic in SDK. (function getMyAccounts returns accounts)
    • In this case, private keys of existing accounts are automatically generated using the imported menmonic.
  2. The user does not have existing accounts generated earlier.
    • In this case, nickName and blockchainNetwork can be set to create first account. If unset, defaults will be used to create first account.

Note: only one mnemonic is support at this time. multi-mnemonic support will be added soon.

isTestnetEnabledif enabled will generate testnet work accounts and mainnet accounts of existing accounts
mnemonicmnemonic string to import
nickNameoptional name of first account created using mnemonic. Both blockchainNetwork and nickName have to be specifed or either.
blockchainNetworkoptional blockchain network of first account created.
booleanreturns true = success or false = failed
Abstrakt.shared.importMnemonic(isTestnetEnabled: Bool = false, mnemonic: String, nickName: String, blockchainNetwork: BlockchainNetwork, completion: @escaping (Bool) -> Void)

Get Mnemonic

This function returns generated/imported menmonic encrypted on the device. It can be displayed to the user for backing up.

Abstrakt.shared.getMnemonic(completion: @escaping (String) -> Void)

Cloud backup (work in progress…)

This function will enable you to encrypt the user generated mnenomnic with a password and store it to the apple keychain.

Recover cloud backup (work in progress…)

Once a mnenomic is encrypted and backuped to the user’s apple keychain, it can be recovered automatcially on future logins.