Closed area closed 6 months ago
Thanks for opening this @area. I'm tempted to go with a function, since that would cover other use cases (although tbh I don't know how likely it is that there are use cases besides legacy paths):
ledgerOptions: {
derivationFunction: (accountNumber) => `44'/60'/${account}'/0/0`
}
What do you think?
cc @alcuadrado
Yep, that would work for me. Making the option a function also makes it easier to adjust messages that output derivation paths than it would be if it were a string.
I would still like to work on this if the desired implementation could be confirmed by whoever needs to :smile:
@area you can assume that the function approach is the one you should take.
The feature has been added and it will be released on the next hardhat-ledger
version. You can read how it works here. Thanks @area!
Support for derivation paths was released in @nomicfoundation/hardhat-ledger@1.0.3
.
Describe the feature
As part of the curse of the early adopter, users may have created addresses with Ledger prior to them fully implementing BIP44, when they used a different derivation path. Such users should be able to use
hardhat-ledger
.One possibility to capture most of these users (myself included) would be to add a
ledgerLegacyDerivationPath
option as a boolean in the network configs, alongsideledgerAccounts
- or possibly combining them in to aledgerOptions
.A more general solution that would capture all possible issues would be to allow users to specify the derivation path themselves - e.g.
m/44'/60'/x'/0/0
. Again, either as a separate option or as part of a combinedledgerOptions
property.Of course, the default behaviour should remain unchanged - most users are not impacted by this.
I need this feature, and it is small, so would be keen to work on a PR myself. I am opening the discussion here to begin with, as requested in
CONTRIBUTING.md
, with the hope that someone can indicate which of these possibilities is most likely to get accepted.Search terms
No response