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

Hardhat-ledger should support legacy derivation paths #4790

Closed
area opened this issue Jan 25, 2024 · 6 comments
Closed

Hardhat-ledger should support legacy derivation paths #4790

area opened this issue Jan 25, 2024 · 6 comments
Labels
area:hardhat-ledger status:needs-decision We need to make a decision about this type:feature Feature request

Comments

@area
Copy link
Contributor

area commented Jan 25, 2024

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, alongside ledgerAccounts - or possibly combining them in to a ledgerOptions.

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 combined ledgerOptions 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

@schaable schaable added type:feature Feature request status:ready This issue is ready to be worked on area:hardhat-ledger and removed status:triaging labels Feb 5, 2024
@schaable schaable assigned fvictorio and unassigned schaable Feb 5, 2024
@fvictorio
Copy link
Member

fvictorio commented Feb 8, 2024

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

@fvictorio fvictorio added status:needs-decision We need to make a decision about this and removed status:ready This issue is ready to be worked on labels Feb 8, 2024
@area
Copy link
Contributor Author

area commented Feb 8, 2024

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.

@area
Copy link
Contributor Author

area commented Feb 23, 2024

I would still like to work on this if the desired implementation could be confirmed by whoever needs to 😄

@kanej kanej assigned kanej and unassigned fvictorio Feb 23, 2024
@kanej
Copy link
Member

kanej commented Feb 23, 2024

@area you can assume that the function approach is the one you should take.

@schaable
Copy link
Member

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!

@kanej
Copy link
Member

kanej commented Apr 17, 2024

Support for derivation paths was released in @nomicfoundation/[email protected].

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area:hardhat-ledger status:needs-decision We need to make a decision about this type:feature Feature request
Projects
Archived in project
Development

No branches or pull requests

4 participants