Bitcoin Forum

Bitcoin => Electrum => Topic started by: jackg on December 28, 2018, 10:08:29 PM



Title: Is there a fast way to make a watch only wallet on mobile out of xpub, zpub addr
Post by: jackg on December 28, 2018, 10:08:29 PM
I have been trying to make a watching only wallet out of an xpub, a zpub and a legacy address on my new phone (it has an octocore 2GHz processor so it is definitely up to the task ;D) my issue is that it seems in electrum, I can't import an xpub, zpub and legacy address together all at once.

I have gotton round the issue by importing my addresses individually to make the watching only wallet, I'm just wondering if this is normal or if I've done something wrong?


Title: Re: Is there a fast way to make a watch only wallet on mobile out of xpub, zpub addr
Post by: HCP on December 29, 2018, 01:02:02 AM
Electrum does not support having multiple master keys in one HD wallet. Even for watching only wallets. You need to create multiple wallets. (Note: this is true on desktop as well AFAIK!)

I would think that even though they should be using different derivation paths/addresses (xpub vs. zpub), this could prove to be very problematic and confusing, so is no doubt why it isn't supported.

Likewise with trying to combine a master key with "a legacy address" (I assume you mean a single private key? ???)... Electrum does not support different "types" in one wallet. So, you can't import a single private key into an HD wallet.



Title: Re: Is there a fast way to make a watch only wallet on mobile out of xpub, zpub addr
Post by: jackg on December 29, 2018, 01:22:51 AM
Thanks hcp! I just seemed to have taken a naive approach and thought since I can import addresses of different types, why the public keys wouldn't work although I guess it would mean for a lot of work, if not for the client then for the server.


Title: Re: Is there a fast way to make a watch only wallet on mobile out of xpub, zpub addr
Post by: Abdussamad on December 29, 2018, 04:03:15 AM
There is the option to create a non-deterministic watch only wallet with specific addresses. See 2 here: https://bitcoinelectrum.com/creating-a-watch-only-wallet/ . It won't automatically generate new addresses though since it's not deterministic.


Title: Re: Is there a fast way to make a watch only wallet on mobile out of xpub, zpub addr
Post by: pooya87 on December 29, 2018, 04:29:04 AM
it shouldn't be that hard to implement though! Electrum itself will never do it because it doesn't make sense but you probably can write a small script that does it on top of your Electrum. i am not familiar with python otherwise i would have done it. these are the steps:
1- run an script to get n number of master public keys and generate m number of addresses for each master key (m being gap limit in first iteration)
2- import these addresses into Electrum though its command interface
3- let Electrum do the work which is contacting the server and receiving transaction history, downloading block_headers, and updating your balance.
4- run an script that reads your wallet file (you may need to add AES decryption if you have encrypted the watch-only wallet file!) and determines how many of the addresses in it are used. for x number of addresses used run step #1 for m=x


Title: Re: Is there a fast way to make a watch only wallet on mobile out of xpub, zpub addr
Post by: jackg on December 29, 2018, 09:03:02 AM
There is the option to create a non-deterministic watch only wallet with specific addresses. See 2 here: https://bitcoinelectrum.com/creating-a-watch-only-wallet/ . It won't automatically generate new addresses though since it's not deterministic.

I have done that at the moment. I luckily only have 6 addresses with utxos it'll get difficult if I get any more than that (as in quite a few more).