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

request: deriving keys for x accounts instead of x addresses #20

Closed
ghost opened this issue May 10, 2019 · 7 comments
Closed

request: deriving keys for x accounts instead of x addresses #20

ghost opened this issue May 10, 2019 · 7 comments

Comments

@ghost
Copy link

ghost commented May 10, 2019

Thanks for this great tool. This suggestion would save Ledger users some time and effort

MyCryptoHQ/MyCrypto#2070

in Ledger Live instead, the idea is to follow BIP44, which means the first address is derived on m/44'/60'/0'/0/0, the second on m/44'/60'/1'/0/0, and so on,.. so in other words using the account field of BIP44. (m/44'/60'/x'/0/0)

LedgerHQ/ledger-live-desktop#1185

Ledger Live uses m/44'/60'/x'/0/0 for addresses, but Trezor and MEW use m/44'/60'/0'/0/x, which also seems to be the consensus that has been reached on EIP 84. This will lead to the same derivation for the first address, but different derivations for subsequent addresses.

Currently, Ledger users have to execute the command for each account with the path fully specified.

@dan-da
Copy link
Owner

dan-da commented May 11, 2019

Thx for the ledger path info.

I think that the way to do this right would be to introduce a concept of path templates. So hd-wallet-derive would have a list of templates for various wallet software. I've considered doing this previously, but I figured I'd wait for a request. :-)

I will see about adding path template code when I get some free time. If anyone can point me towards an accurate/current and hopefully maintained list of bip32 paths used by various wallet software, that would be super helpful.

@ghost
Copy link
Author

ghost commented May 11, 2019

Glad to know you already have that in mind.

This is what I was able to find for Trezor, but unfortunately, it's not a comprehensive list:
https://github.com/trezor/trezor-core/blob/118ca37304e5ea78f1e7da8ca0d1701cfd53cefa/docs/coins/README.md

maybe @prusnak could help?

@dan-da
Copy link
Owner

dan-da commented May 11, 2019

Ledger Live uses m/44'/60'/x'/0/0 for addresses, but Trezor and MEW use m/44'/60'/0'/0/x

Oh, I just spotted this. Interesting. x is in the middle of the path, not the end. So supporting ledger-live is more than just a path preset, it is actually about iterating elsewhere, which requires a change to the core derivation code, path verification, etc. I'll have to take a look if there are any gotchas preventing it.

@ghost
Copy link
Author

ghost commented May 11, 2019

Yes I tried to place it in the middle but got an error. Ledger says they made this decision for privacy reasons.

@dan-da
Copy link
Owner

dan-da commented May 11, 2019

@twfink I just added support for using x or x' in the middle of a path. (algo change in a202759)

If you have a chance please give master a try with ledger live and let me know it works or if any issues.

edit: preset templates are not implemented yet, but I did provide examples for Ledger Live and Trezor in the usage text.

@ghost
Copy link
Author

ghost commented May 11, 2019

Thank you! I'll test once my new Ledger arrives in about two weeks.

@dan-da
Copy link
Owner

dan-da commented May 12, 2019

Implemented path presets (with 26 presets defined) in df220b5. Closing this.

@dan-da dan-da closed this as completed May 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant