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

Invalid private key generation #10

Closed
klim0v opened this issue Feb 27, 2020 · 3 comments · Fixed by #12
Closed

Invalid private key generation #10

klim0v opened this issue Feb 27, 2020 · 3 comments · Fixed by #12

Comments

@klim0v
Copy link

klim0v commented Feb 27, 2020

        wallet, err := hdwallet.NewFromMnemonic("real town addict extend shoot name disagree vital turn live can tip")
	if err != nil {
		return "", err
	}

	path := hdwallet.MustParseDerivationPath("m/44'/60'/0'/0/0")
	account, err := wallet.Derive(path, false)
	if err != nil {
		return "", err
	}

	keyHex, err := wallet.PrivateKeyHex(account)
	if err != nil {
		return "", err
	}

        return keyHex, nil

got c64f0b3e510d03adef3f057d1814bdc8a7f904caafa6928550fc10670dcff031
wanted c29cd818232f40614691a58c9afcbd5518b539cb135d73b1d9e26d5f5f5dcbbe (https://iancoleman.io/bip39/)

@miguelmota miguelmota added bug Something isn't working help wanted Extra attention is needed labels Mar 2, 2020
@klim0v
Copy link
Author

klim0v commented Mar 3, 2020

btcsuite/btcutil#159

@klim0v
Copy link
Author

klim0v commented Mar 3, 2020

it was a mistake on the m/44H/60H/0H path

@miguelmota miguelmota added waiting on dependency and removed bug Something isn't working help wanted Extra attention is needed labels Oct 16, 2020
@witoff
Copy link
Contributor

witoff commented Mar 2, 2021

This was fixed upstream in btcsuite/btcutil#182, merged in Nov 2020 which effected 1 in 128 addresses that were unlucky enough to have a leading zero.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants