I need to get private keys (ethereum/bitcoin and other currencies) from mnemonic phrases as fast as possible. At the moment I am using BitcoinJ library:
Set<BigInteger> privateKeys = new HashSet<>();
for (String mnemonic : mnemonics) {
try {
DeterministicSeed deterministicSeed = new DeterministicSeed(mnemonic, null, "", 0);
DeterministicKeyChain deterministicKeyChain = DeterministicKeyChain.builder().seed(deterministicSeed).build();
DeterministicKey deterministicKey = deterministicKeyChain.getKeyByPath(ETHEREUM_HD_PATH, true);
privateKeys.add(deterministicKey.getPrivKey());
} catch (Exception ex) {
ex.printStackTrace();
}
}
Obtaining a private key this way takes on average ~10 ms. Are there any ways to speed up this process (without using a video card)?