0

I am trying to generate a wallet/private_key inside my app. However, it often takes 25-30 seconds to get a result.

    const provider = ethers.getDefaultProvider();  //Takes 1 second
    const signer = ethers.Wallet.createRandom().connect(provider);  //Takes 30 seconds !!!

    await this.context.contextFunctions.saveNewAccount(
                signer.address,
                signer._signingKey().privateKey,
                0,
              );

What I am looking for is a faster way of generating a Private_key and Address. (Generating a wallet)

1 Answer 1

0

I figured out that the createRandom() function is too slow because it is also creating a mnemonic of the private key. The solution was to create my own "createRandom()" function that doesn't contain that step.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.