Post
Topic
Board Electrum
Re: Generate addresses independently of Electrum
by
anon4250158
on 05/07/2019, 22:04:13 UTC
Check out the project here: https://github.com/FarCanary/ElectrumSeedTester

Using that it generates the Address: bc1qp0efh7jms7f580e7nnywjg5vzm90njm0rdvqpe from the mnemonic "abandon about razor"

BIP32 Root Key: zprvAWgYBBk7JR8Gjbwr8fxvpq5zF33z4wyGYduJVPhcab4iUm8CfePDbKcf2u1pTmgsUwNGGMQdPTN XGkjj9iNqTsRoSQde254shHJJtXe8Weh
BIP32 Derivation Path used: m/0'/0
BIP32 extended private key: zprvAc8htgxrZRryygy2zcbcRFb9C7ybGYhmfJ4PX34YXpfSoorUJugPgUNmdBuNmDgUodvCXMcu3iy 8AMdTCmLZx42hTjvpLcQ74mLdegJzBzC

Quote
m/0'/0/0   bc1qp0efh7jms7f580e7nnywjg5vzm90njm0rdvqpe   02cd91d2ca04f60a727bbb86bd5869135069f5ec516da31ef8fc5edd4ba39af240   KyiVJaSALAurEwB9BzoCe7cGR6gQc96f1B8Y3eCmNKuBBDyyvKwf

Thanks for this.  My code returns the same address now that I have the proper derivation path.


I've tried m/84'/0'/0' , m/84'/0'/0'/0' , and m/84'/0'/0'/0 with valid Electrum segwit and BIP39 mnemonic "abandon about razor", but I'm not getting the same result as Electrum (bc1qp0efh7jms7f580e7nnywjg5vzm90njm0rdvqpe for index 0).  Everything matches the results from BIP84 in Ian Coleman, so I'm not sure what's going wrong here.

First of all that mnemonic is not valid bip39 according to electrum but it is according to the ian coleman site. Regardless you can still create a bip39 wallet with it in electrum. The way to do this is to make sure to click on options and choose bip39 in the seed entry step and in the next step choose native segwit as the derivation path. If you do this you will get addresses that match the bip84 derivation path option on iancoleman's site (m/84'/0'/0'/0).

That mnemonic is also a valid electrum seed so if you don't click on options and check bip39 electrum will use a different method to convert to the binary seed (2 in the op) and as a result you get different addresses.

So overall you have to pay attention to details like these.

I'm guessing Electrum would find "abandon about razor" to be valid, but according to the source code, it will return a failed checksum if the mnemonic is less than 12 words before actually calculating the checksum.  I have next to no experience with Python, so following the code has been difficult.  Nowhere could I find the m/0'/0 derivation path that leads to p2wpkh addresses even after HCP demonstrated that was what is used.  I guess it would be nice if the derivation paths were clearly set as constants in the code.  Thanks for your help.