2

I just started using Flutter and I am trying to create a crypto wallet app that can support multiple different cryptocurrencies. The current issue I am facing is, is that I don't know how a mnemonics code is being generated for different cryptocurrencies when trying to create a backup for multiple wallets. I am using this library btw: https://pub.dartlang.org/packages/bip39

Any help would be much appreciated!

Omega
  • 65
  • 7

1 Answers1

1

You can use one mnemonic code for all cryptocurrencies. As you can see in the library documentation you linked, you use the mnemonic code to get a wallet seed. That wallet seed is then used to create a HD wallet.

That single HD wallet can have many different cryptos. You differentiate between them by following the scheme in BIP44. In the accompanying SLIP44 there's a list of what HD wallet constants each currency uses.

torkel
  • 2,096
  • 3
  • 10
  • 20
  • Ah, I didn't know this. Thanks a lot for making things more clear, but is there an example I can follow on any site? I tried searching for examples, but no big results so far.. – Omega Apr 29 '19 at 10:03
  • What sort of example are you looking for? There's quite a bit going on here, with entropy generation, mnemonic derivation from that entropy, seed generation from the mnemonic, and finally private key generation from the seed – torkel Apr 29 '19 at 14:35
  • I was searching for a code example online, but it seems not easy to find the right example I am looking for. Maybe it's because of the wrong search term I use on Google? Honestly, thanks for your help so far! – Omega Apr 30 '19 at 00:24
  • Here's an example that should cover what you're asking for: https://github.com/bitcoin-s/bitcoin-s-core/tree/master/core#generating-a-bip39-mnemonic-phrase-and-an-xpriv. It's written in Scala, but should hopefully give you some pointers. – torkel Apr 30 '19 at 09:27
  • I noted that I need Bip44 to generate Ethereum wallets as well... The current library I am using doesn't support Ethereum (yet, I think): https://pub.dartlang.org/packages/bitcoin_bip44#-installing-tab- Can I use another library that takes the hex seed I generated using Bip32 and use it there to generate HD wallet for Ethereum as well? I am just not sure about the limitations. Is there a faster way to communicate with you by Discord or anything related? Thanks for your help so far! – Omega May 03 '19 at 01:21
  • I'm not familiar with addresses in Ethereum, I'm sorry. – torkel May 03 '19 at 10:07