0

I am generating keypair from memnomic phrase for my crypto app, and anytime i try to generate the address and private key, the whole app start to lag and crashes,i have also tried using the coompute isolate for this case, it is still the same,

// how it been called
var keys = await compute(calculateDashKey, mnemonic);

// implementation
Map calculateDashKey(String seedPhrase) {
  final seed = bip39.mnemonicToSeed(seedPhrase);
  final root = bip32.BIP32.fromSeed(seed);
  final node = root.derivePath("m/44'/5'/0'/0/0");
  var address = P2PKH(
          data: PaymentData(
            pubkey: node.publicKey,
          ),
          network: dash)
      .data
      .address;
  return {
    'address': address,
    'private_key': "0x${HEX.encode(node.privateKey)}"
  };
}
TylerH
  • 20,799
  • 66
  • 75
  • 101
Davy King
  • 27
  • 8

1 Answers1

0

I think the problem is with the library bip39. If you're using this bip39 library then you should look at the GitHub. It was last updated 2 years ago and it is a known issue that it freezes your UI. Perhaps you should find a new library or contact the original developer.

murage kibicho
  • 546
  • 5
  • 14