iancoleman / bip39

A web tool for converting BIP39 mnemonic codes
https://iancoleman.io/bip39/
MIT License
3.54k stars 1.44k forks source link

Is it possible to use for Ethereum? #54

Closed Nogreedy closed 7 years ago

Nogreedy commented 7 years ago

Is it possible to use for Ethereum? e.g. with Metamask (12 words seed). Thanks in advance for your answer.

iancoleman commented 7 years ago

This should be possible. I'll investigate the possibility and if all is good will implement it.

Notes:

iancoleman commented 7 years ago

My research so far:

https://walletgenerator.net/ does not support ethereum which is a bad sign since they support many blockchains (see these reddit comments for more info, looks like over a year that the opportunity to add ethereum has gone unattended).

ethereumjs-util shows pubToAddress uses sha3 hashing which is again not looking promising.

If anyone with more knowledge of ethereum can chime in here that would be really handy. For now I'll leave this issue open pending further info.

Bertrand256 commented 7 years ago

@Nogreedy Functionality of converting BIP39 mnemonic words to ether addresses is available here: https://www.myetherwallet.com/#view-wallet-info. To generate select "Mnemonic Phrase", enter mnemonic words and click "Unlock" button.

Myetherwallet is rather a tool for end-users, than for developers, because it does not expose extended BIP32 private and public keys, so it may be necessary to use both tools, depending on what is your goal.

iancoleman commented 7 years ago

https://github.com/ethereumjs/ethereumjs-util has all the required functionality. It adds about 500 kB of code, but I think it's worth it to be able to include the second-biggest cryptocurrency in the tool.

I've implemented this and should hopefully have it released in a few days once I get time to look at some obscure breakage of the ethereum tests.

Thanks for the pointers @blogin. myetherewallet is very nice!

Nogreedy commented 7 years ago

@iancoleman Thanks so much. PS : I have to admit it's way too much complicated for me... https://github.com/ethereum/EIPs/issues/84

iancoleman commented 7 years ago

See

https://github.com/iancoleman/bip39/commit/505a31593ec3ead7200c9e181641ba7e3a7b5243 - Ethereum Util library https://github.com/iancoleman/bip39/commit/0edac945e597099d1cabfa684e3c172b3d70cf6c - Ethereum address table is populated https://github.com/iancoleman/bip39/commit/24137d96070eb6cb47ef8239738ec6a135f0b675 - Ethereum tests https://github.com/iancoleman/bip39/commit/8b095871e8ab14ec236ddb181ffdfe36e6636058 - Ethereum compiled into standalone

Steps to use:

I'm not too familiar with ethereum and have based the tests for correctness on those generated by https://www.myetherwallet.com/#view-wallet-info

Anyone with better understanding of ethereum would be most welcome to provide feedback.

akumthek commented 6 years ago

Wow nice effort