Mycelium on Android differs from iOS / Master keys / Generating addresses
*Why does Mycelium display different master keys on the Android than the iOS version*
(And how to generate the same addresses from both.)
Mycelium 2.2.0 - Android
Mycelium 1.0.1 - iOS (I will not go into the issues/bugs with the iOS version as it deeply needs to be updated - I have done a lot of testing.)
Using a random master seed generated and on each device works and the associated balances match (unlike breadwallet (another topic)).
Export a master public key for use in ecommerce or simply knowing the future addresses.
To generate the addresses from the master key, you can:
Go to:
www.evilbs.com/bip39 or
https://dcpos.github.io/bip39/ or download and run offline (recommended).
The file/website keys shown matches iOS version of MyCelium, but not the Android version of the software.
iOS. Install, make a new wallet. You then have your master seed. Since this is just for testing, I got:
orange hurt leisure rely name multiply pond crawl canoe story only bird
Plug that into the bip39 converter (site or offline).
Click on 'Mycelium wallet' (or BIP44 - same thing) which simply sets to: m/44'/0'/0'/0
bip 44 and 0's for point/wallet, etc
(I go to BIP32 and input m/44'/0'/0'/0 as this allows for testing/changing the numbers (not greyed out))
Great, this produces a mpubkey for the first wallet of:
xpub6FJdwT45KSFs3fAhDGwzY6jrMqP5FETMkR3r9wikit2UoYLRUb625rcGUJzgQtKpNrhhi3tpRaC
Ubab9tXqK9KqwnTesGQs4UTKHzcXkP4x
It matches the iPhone, and the 1st receiving address of: 14Brr4TQpx4a7WvpN52a7S3mZs9nNfCrLs all good.
Now, as for Android, although my 1st receiving address is: 14Brr4TQpx4a7WvpN52a7S3mZs9nNfCrLs, the mpubkey
is different
Andoid:
xpub6DW3ui9w59vVVLtdCtNTrxdLNp9WVCppDhKdnyWDpkUC5ZtfMm1evZKyJte7GuSj9AncPh5kmgi
5wCk1s3yAGjQ1vNi1QyxaevXiULhX11a
When getting a mpubkey, you get a different one from iOS than Android for the same master seed; however,
both devices generate the same receiving addresses - The first being: 14Brr4TQpx4a7WvpN52a7S3mZs9nNfCrLs.
I wanted to know why....
So, I went to any of the bip39 websites to see (after putting in the master seed and selecting Mycelium wallet....
The Derivation path on Android (to see current and future HD wallet addresses) is:
m/44'/0'/0'/0
Side Note:
(if you select bip32 (or custom and put in m/44'/0'/0'/0 ) it is the same thing. Do this to see future receiving addresses)
and when creating another HD Account, the next is:
m/44'/0'/1'/0 and so on.
Everything the site shows matches the iOS version of Mycelium. This does NOT work for the Android version since the
mpubkey is diff on the site than what Android shows you.
So, why does the generated bitcoin addresses match if using different pub keys?
I decided to test with pycoin....
Using iOS mpubkey, for pycoin, you can generate the first 5 addresses using:
ku mpubkey -a -s0-4
0 14Brr4TQpx4a7WvpN52a7S3mZs9nNfCrLs
1 1f26ma1LitK2Cv1aWRcdPQC7zBeyp5WWh
2 1F5K9q3JnxZnRbSqoabU6P427rnbDTTyTG
3 1CaBPyF78q17yo7ZjzJDY7kJfgEaEzaTpS
4 1HqSjEyLj8LgEL7p3sisTvfvAXpfmnzUqf
Great, so everything matches and works on the iPhone
On Android, you get a different mpubkey; however, the address generation is the same IF you change the Deprivation path.
So, for pycoin, you can generate the first 5 addresses using
ku mpubkey -a -s0/0-4
0 14Brr4TQpx4a7WvpN52a7S3mZs9nNfCrLs
1 1f26ma1LitK2Cv1aWRcdPQC7zBeyp5WWh
2 1F5K9q3JnxZnRbSqoabU6P427rnbDTTyTG
3 1CaBPyF78q17yo7ZjzJDY7kJfgEaEzaTpS
4 1HqSjEyLj8LgEL7p3sisTvfvAXpfmnzUqf
Why a diff pubkey and why using -s0-4 vs -s0/0-4 to get the same matching receiving addresses?
Why is it that the website matches everything from iOS version of Mycelium, but not Android,
and why can't I duplicate keys list on the Android with the site?