I wrote a merchant script for Electrum some time ago.
it writes IDs in a database.
I think we should improve the client, so that it takes a list of IDs from a database in order to generate a sequence of addresses
maybe a new plugin could do that.
it could connect to a service like acceptbit.com, and get a list of IDs that have been used to generate addresses
I think this would violate beautiful "deterministicability" principle (what a term!) of Electrum. Deterministic wallets are very resilient to being lost. Once we start promoting importation of foreign keys - this will open can of worms about backups and will hurt wallet owners in the long run.
In case of acceptbit and similar services - I'd just pull the "last used index" and make sure wallet used that to sync all addresses up to this index.
Gleb
Regarding very high gap values - I'm not sure of performance ramifications but if you have thousands of addresses in a wallet I suspect the server end could be severely impeded by such a large subscribe cmd.
One way would be to add a new list of addresses besides just change and normal ones. We already have an imported list but we could add a "sparse" list. These ones show up and act as normal addresses in the interface but actually store the index with the address and use the index instead of ordinal position to generate keys. The import cmd line could accept a list of index values to add to this list. It could potentially also use a different hash base, eg. 2 instead of 1 so that it cannot collide with normal addresses.
Upon restoring a lost wallet you could restore sparse addresses automatically with a scan of a range (scan 0-250 or whatever), or it could be a cmd used any time to scan for sparsely used addresses beyond the last one known. This way you likely don't even need to import index values, just trigger a scan cmd (periodically much less work than subscribing always).
@ThomasV if this sounds like a good idea I'd be happy to code it and offer a pull request. It should be transparent to users with wallets missing the list. (Gee, I have to sync up to date first as I'm still using 1.6.1 right now)