Invert coin-type and purpose in default derivation path (#1728)

This commit is contained in:
Svarog 2021-05-20 17:43:07 +03:00 committed by GitHub
parent edc459ae1b
commit 6613faee2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,6 +2,7 @@ package libkaspawallet
import (
"fmt"
"github.com/kaspanet/kaspad/cmd/kaspawallet/libkaspawallet/bip32"
"github.com/kaspanet/kaspad/domain/dagconfig"
"github.com/pkg/errors"
@ -31,7 +32,7 @@ func defaultPath(isMultisig bool) string {
// TODO: Register the coin type in https://github.com/satoshilabs/slips/blob/master/slip-0044.md
const coinType = 111111
return fmt.Sprintf("m/%d'/%d'/0'", coinType, purpose)
return fmt.Sprintf("m/%d'/%d'/0'", purpose, coinType)
}
// MasterPublicKeyFromMnemonic returns the master public key with the correct derivation for the given mnemonic.