Author

Topic: sending to an address generated with your xpub key (Read 176 times)

legendary
Activity: 3640
Merit: 1571
September 03, 2020, 03:07:00 PM
#4
Hi,

I currently use Electrum wallet but I do not always have the wallet on me, it's currently only used on a laptop which is rarely online. So I was thinking of generating an address from my xpub key and creating a generator on my dev site which I can access with phone, or at work.

If I send to an address that has been generated using my xpub will it appear in my Electrum wallet even if Electrum has not generated that address keypair yet? or is there a way I can tell electrum to generate this keypair forcefully using the HD path for example?

Thanks for help.

addresses should be created at m/0/i where m is the xpub, and i is the index. by default electrum maintains a gap limit or readahead window of 20 unused addresses. as you send money to old addresses new addresses are automatically created to maintain this readahead window.

if you create gaps of unused addresses larger than that gap limit then you will have to raise the gap limit on the laptop so that it sees the addresses you've used.

the easiest way to ensure that you generate the right addresses  is to use electrum itself on your dev site. create a watch only wallet using the xpub and then use the add_request command to get addresses via jsonrpc.


https://electrum.readthedocs.io/en/latest/jsonrpc.html
legendary
Activity: 2114
Merit: 1293
There is trouble abrewing
that is the whole point of HD wallets using BIP32 with non-hardened keys, you can produce the same public key from both the xprv and the xpub. and wallets like Electrum do use this scheme to make offline storage and setups like what you are trying to do easily possible.

if you generate the keys automatically they will be sequential and should show up automatically in any wallet you use unless you manually generated a key way down the line at a very high index in which case you have to change the gap as jackg pointed out.
copper member
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
Yeah anything generated by your xpub will be on both wallets. If you have an android phone I'd recommend getting the electrum app itself and scanning the xpub straight into that.

You may want to search "electrum change gap limit on console" too see how to add more addresses by using a simple command.
newbie
Activity: 4
Merit: 7
Hi,

I currently use Electrum wallet but I do not always have the wallet on me, it's currently only used on a laptop which is rarely online. So I was thinking of generating an address from my xpub key and creating a generator on my dev site which I can access with phone, or at work.

If I send to an address that has been generated using my xpub will it appear in my Electrum wallet even if Electrum has not generated that address keypair yet? or is there a way I can tell electrum to generate this keypair forcefully using the HD path for example?

Thanks for help.
Jump to: