Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
accounts: switch Ledger derivation path to canonical one #19438
The crux of this PR is adding support for the new Ledger derivation path (standardised), opposed to the old one they used.
This could have been done trivially (#17387), at the expense of dropping support for the old paths. That's not really an option, because it would result in people losing default access to those accounts and freaking out (even though they could be recovered manually).
An alternative approach proposed was in #19358, which introduced a CLI flag to switch between the old and new paths. That doesn't fly either because the use all of a sudden needs to be aware of deterministic wallet internals just to use a HW wallet.
This PR takes a more complex approach that keeps the dirty details hidden. It extends self derivation to support multiple base paths. This ensures that HW wallets can discover non-zero accounts from both the legacy derivation path as well as the standardized one. One special case added is that the auto-derived last empty account is only done for the last derivation path (i.e. the standard one). This ensures that in time, people will switch over to new paths even if the old ones are currently used.
Beside the above feature, this PR does 2 changes:
referenced this pull request
Apr 10, 2019
@gballet I've already given you an example yesterday on chat that your code was wrong: