Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems in derivation with testnet #14

Open
elbelga opened this issue Apr 13, 2018 · 0 comments
Open

Problems in derivation with testnet #14

elbelga opened this issue Apr 13, 2018 · 0 comments

Comments

@elbelga
Copy link

elbelga commented Apr 13, 2018

Hi, I believe that there is a problem in derivation and some time doesn't work well. I made some tests with testnet and validate results with https://iancoleman.io/bip39/ and it doesn't match.

I found that in the file internal.m (line 130) you save new private key like this

        result = [NSMutableData dataWithLength:numBytes];
        BN_bn2bin(privateKey, result.mutableBytes);

and I believe that you need to save new private key like this

        result = [NSMutableData dataWithLength:32];
        BN_bn2bin(privateKey, &result.mutableBytes[32-numBytes]);

Regards

impul added a commit to impul/HDWalletKit that referenced this issue May 27, 2019
    – Fix ethereum sign;
    – Add chain id to init.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant