Skip to content
This repository has been archived by the owner on Nov 21, 2019. It is now read-only.

Allow selection of BIP 44 accounts (BIP 44 level 3 index) #307

Closed
mmazi opened this issue Dec 12, 2016 · 9 comments
Closed

Allow selection of BIP 44 accounts (BIP 44 level 3 index) #307

mmazi opened this issue Dec 12, 2016 · 9 comments

Comments

@mmazi
Copy link

mmazi commented Dec 12, 2016

MyEtherWallet seems to only ever use the m/44'/60'/0'/0/0 BIP 44 path. As a user, I'd like to be able to select the account number, i.e. the 3rd level index in the chain that is now fixed to 0'.

(The fourth level (change) probably doesn't need to be selectable by the user as it is a technical detail, and moreover only makes sense in the context of Bitcoin and other UTXO-based coins, and not Ethereum. The fifth level is already selectable (sequentially) by the user.)

@mmazi
Copy link
Author

mmazi commented Dec 12, 2016

Um, actually it seems that MyEtherWallet uses m/44'/60'/0' (with Ledger Wallet) and derives addresses directly from this key as children instead of deriving keys from its 0-indexed child (the external chain) as specified by BIP 44. Why is this so?

@tayvano
Copy link
Contributor

tayvano commented Dec 12, 2016

We use the specifications and paths used by metamask and jaxx and ether.cards and ledger to decrypt ethereum keys. We didn't make up new paths or re-invent the wheel. We just did what as necessary to unlock the same addresses that users were already using on these other products and services.

I'm curious to know which service you generated a wallet with that didn't use this/these paths?

@mmazi
Copy link
Author

mmazi commented Dec 12, 2016

I see, so I guess the missing BIP 44 change level is a Ledger issue; I'll ask them.

I used my own software to create the mnemonic and the keys, based on BitGo's HD wallet implementation.

The original issue stands though: I'd still like to be able to select BIP 44 accounts and not be constrained to the 0 account only. (E.g. Ledger's Bitcoin Chrome wallet supports BIP 44 accounts.)

@tayvano
Copy link
Contributor

tayvano commented Dec 24, 2016

So we may add support for this in the future if it's requested more often, but we feel like it's a pretty rare use-case. However, you can manually change the path (confirmed using chrome) in the following way.

  1. Go to send tab or whatever tab you want to interact with.

  2. Click mnemonic and then right click on the text area and select "inspect".

  3. Click on the console tab in developer tools.

  4. Copy and paste the following (changing the account to whatever you want)

24 word key
angular.element($0).scope().$parent.HDWallet.ledgerPath = "m/44'/60'/1'/0"

12 word key
angular.element($0).scope().$parent.HDWallet.jmPath = "m/44'/60'/1'/0"

  1. Hit enter.

  2. Enter your mnemonic in the textarea and hit enter

  3. It will display the addresses associated with this account.

The most annoying thing is that you will have to do this before unlocking the wallet each time as the variable gets reset each time you refresh or switch pages on MEW.

I totally understand that this isn't the most viable solution for people accessing wallets on a consistent basis but we simply have so much on our plate right now that we have to prioritize.


I think the ideal solution for this would be a small link above the mnemonic text area that says "Set Path Manually". When clicked it would display an input with m/44'/60'/0'/0 set as default.

["Paste/Type Your Mnemonic"]
[small text link that no one except ppl who wanted it would notice] / [input w/ path]
[textarea for mnemonic]

User could change it, then enter mnemonic, and unlock the wallet and it would use that path. Would need front end validation to verify it's a valid path. Then it would simply be a change to use the ng-model of that field instead of the other paths here. Obviously if the user never clicked the button, the field would remain with the default, and that would be used.

Other option would be a localstorage value that you could set and change and https://github.com/kvhnuke/etherwallet/blob/mercury/app/scripts/controllers/decryptWalletCtrl.js would check for a value in local storage before using the default paths.

Anyone who wants this feature is free to open a PR or we'll get to it when we're bored one day 😛

@mmazi
Copy link
Author

mmazi commented Jan 3, 2017

Thanks for the in-depth reply. I'll test it with Ledger Nano (the above answer is for the mnemonic). If it works, it will be fine for my use case.

I think the ideal solution for this would be a small link above the mnemonic text area

Please note that this should also work for other radio-button options (eg. Ledger Nan S), not only for the mnemonic variant. But yeah, this sounds like a flexible and not-too-hard-to-implement solution.

@mmazi
Copy link
Author

mmazi commented Jan 3, 2017

I've filed an issue with Ledger regarding their use of m/44'/60'/0' as the parent to derive addresses from:
LedgerHQ/ledger-wallet-ethereum-chrome#7

@tayvano
Copy link
Contributor

tayvano commented Jan 3, 2017

The ledger radio uses $scope.HDWallet.ledgerPath as well so it should work. It may not though as there are some extra items around the Ledger obviously. Let me know.

@jase1981
Copy link
Contributor

jase1981 commented Jan 21, 2017

Relevant pull request: #326

@tayvano
Copy link
Contributor

tayvano commented Feb 16, 2017

This is live as of v3.4.7

@tayvano tayvano closed this as completed Feb 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants