Skip to content

Commit

Permalink
Update Default Key Derivation Path
Browse files Browse the repository at this point in the history
- use /44'/145'/0' per standard, instead of zero path /44'/0'/0'
  • Loading branch information
ProtocolCash committed Apr 18, 2019
1 parent c223a3a commit 693d3fb
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,9 @@ public class DeterministicKeyChain implements EncryptableKeyChain {
public static final ImmutableList<ChildNumber> ACCOUNT_ZERO_PATH = ImmutableList.of(ChildNumber.ZERO_HARDENED);
public static final ImmutableList<ChildNumber> EXTERNAL_SUBPATH = ImmutableList.of(ChildNumber.ZERO);
public static final ImmutableList<ChildNumber> INTERNAL_SUBPATH = ImmutableList.of(ChildNumber.ONE);
public static final ImmutableList<ChildNumber> EXTERNAL_PATH = HDUtils.concat(ACCOUNT_ZERO_PATH, EXTERNAL_SUBPATH);
public static final ImmutableList<ChildNumber> INTERNAL_PATH = HDUtils.concat(ACCOUNT_ZERO_PATH, INTERNAL_SUBPATH);
// m / 44' / 0' / 0'
public static final ImmutableList<ChildNumber> BIP44_ACCOUNT_ZERO_PATH =
ImmutableList.of(new ChildNumber(44, true), ChildNumber.ZERO_HARDENED, ChildNumber.ZERO_HARDENED);
// m / 44' / 145' / 0'
public static final ImmutableList<ChildNumber> BIP44_ACCOUNT_145_PATH =
ImmutableList.of(new ChildNumber(44, true), new ChildNumber(145, true), ChildNumber.ZERO_HARDENED);

// We try to ensure we have at least this many keys ready and waiting to be handed out via getKey().
// See docs for getLookaheadSize() for more info on what this is for. The -1 value means it hasn't been calculated
Expand Down Expand Up @@ -420,7 +418,7 @@ protected DeterministicKeyChain(KeyCrypter crypter, KeyParameter aesKey, Determi

/** Override in subclasses to use a different account derivation path */
protected ImmutableList<ChildNumber> getAccountPath() {
return ACCOUNT_ZERO_PATH;
return BIP44_ACCOUNT_145_PATH;
}

private DeterministicKey encryptNonLeaf(KeyParameter aesKey, DeterministicKeyChain chain,
Expand Down

0 comments on commit 693d3fb

Please sign in to comment.