web3dart icon indicating copy to clipboard operation
web3dart copied to clipboard

Wallet.fromJson Function execution is too slow

Open panlin-go opened this issue 6 years ago • 1 comments

String content = new File("keystore/UTC--2019-10-19T10-22-27.882172000Z--4ec06cf1958aec265808bd9f3383c3dee418b543").readAsStringSync();

Wallet wallet = Wallet.fromJson(content, "123456");

I don't know why this function needs to be executed for a few minutes? Is my method wrong?

panlin-go avatar Oct 21 '19 03:10 panlin-go

Yeah, the underlying cryptography library is rather slow (it's purely written in Dart). The strength of a wallet is configurable in the wallwt file itself. Can you post the kdf entry from the json and the kdfparams (you can skip the salt).

Now that dart:ffi is a thing, we might be able to speed things up by using a native library to do the heavy lifting, but I haven't looked into that yet for this project.

simolus3 avatar Oct 21 '19 07:10 simolus3