mycelium-com / wallet-android

Mycelium Bitcoin Wallet for Android
http://mycelium.com
Other
660 stars 320 forks source link

Key Derivation Path for Ethereum on 'home screen' #552

Closed Querela closed 4 years ago

Querela commented 4 years ago

I would like to have the derivation path for Ethereum "m/44'/60'/0'/0/0" https://github.com/mycelium-com/wallet-android/blob/f2ff3b7cf78a20cc97e2ed96027bdc8f8495e74b/walletcore/src/main/java/com/mycelium/wapi/wallet/eth/EthereumModule.kt#L120 on the home screen, similar to Bitcoin. As the settings (Show address path) don't specifically name Bitcoin, I would assume it would also work for Ethereum. (The path above is BIP44...)


Changes: I would assume the only major change needs to happen in https://github.com/mycelium-com/wallet-android/blob/f2ff3b7cf78a20cc97e2ed96027bdc8f8495e74b/mbw/src/main/java/com/mycelium/wallet/activity/main/address/AddressFragmentModel.kt#L65 ? With an if-branch for EthAccount and populating of a single(?) variable (bip32Path.value = ..., maybe even static if the KDP never changes in the future?).


Reason: As the key derivation for Ethereum is not exactly specified yet (see https://github.com/ethereum/EIPs/issues/84), it is not immediately obvious how MyCelium produces the key on my screen. And as I currently don't have the option to export private keys, like for Bitcoin, I initially did not want to use MyCelium to manage Ethereum because I only had my Masterseed phrase but no way to get the private/public key from it, without the app. I had to examine the source code before I was assured of how I could regenerate my keys, to use MyCelium...


BTW, I also did not find any mention of it online (forum, GitHub issues, Reddit, ...), so I needed to search through the code first ...

(I later reproduced my public address with AlphaWallet and my 12 word seed. The only difference are the upper-case letters used for a checksum?, https://www.quora.com/Is-an-Ethereum-Wallet-address-case-sensitive )

Querela commented 4 years ago

Thank you. I was trying to start implementing this but not as concise as it is now.

In Commit: https://github.com/mycelium-com/wallet-android/commit/27e4ba947f802b487b89c94f8968d9aaf420d5c5 In Release 3.4.0.0, Branch release3040000 available (currently in Android App).