<oembed><type>rich</type><version>1.0</version><author_name>npub10f96gqrsu4qpygfgvuvzce47aavjvql703egfde0l2hua8dzpszs67ej47</author_name><author_url>https://nostr.ae/npub10f96gqrsu4qpygfgvuvzce47aavjvql703egfde0l2hua8dzpszs67ej47</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2014-03-27&#xA;📝 Original message:Le 27/03/2014 12:39, Mike Hearn a écrit :&#xA;&gt;     One issue that I have is bandwidth: Electrum (and mycelium) cannot&#xA;&gt;     watch as many addresses as they want, because this will create too&#xA;&gt;     much traffic on the servers. (especially when servers send utxo merkle&#xA;&gt;     proofs for each address, which is not the case yet, but is planned)&#xA;&gt;&#xA;&gt;&#xA;&gt; This is surprising and the first time I&#39;ve heard about this. Surely your&#xA;&gt; constraint is CPU or disk seeks? Addresses are small, I find it hard to&#xA;&gt; believe that clients uploading them is a big drain, and mostly addresses&#xA;&gt; that are in the lookahead region won&#39;t have any hits and so won&#39;t result&#xA;&gt; in any downloads?&#xA;&#xA;&#xA;To be honest, I have not carried out a comprehensive examination of &#xA;server performance. What I can see is that Electrum servers are often &#xA;slowed down when a wallet with a large number (thousands) of addresses &#xA;shows up, and this is caused by disk seeks (especially on my slow VPS).&#xA;&#xA;The master branch of electrum-server is also quite wasteful in terms of &#xA;CPU, because it uses client threads. I have another branch that uses a &#xA;socket poller, but that branch is not widely deployed yet.&#xA;&#xA;I reckon that I might have been a bit too conservative, in setting the &#xA;number of unused receiving addresses watched by Electrum clients (until &#xA;now, the default &#34;gap limit&#34; has always been 5). The reason is that, if &#xA;I increase that number, then there is no way to go back to a smaller &#xA;value, because it needs to be compatible with all previously released &#xA;versions. However, Electrum servers performance has improved over time, &#xA;so I guess it could safely be raised to 20 (see previous post to slush).&#xA;&#xA;In terms of bandwidth, I am referring to my Android version of Electrum. &#xA;When it runs on a 3G connection, it sometimes takes up to 1 minute to &#xA;synchronize (with a wallet that has hundreds of addresses). However, I &#xA;have not checked if this was caused by addresses or block headers.&#xA;&#xA;&#xA;&#xA;&gt;&#xA;&gt;     This constraint is not so important for bloom-filter clients.&#xA;&gt;&#xA;&gt;&#xA;&gt; Bloom filters are a neat way to encode addresses and keys but they don&#39;t&#xA;&gt; magically let clients save bandwidth. A smaller filter results in less&#xA;&gt; upload bandwidth but more download (from the wallets perspective). So&#xA;&gt; I&#39;m worried if you think this will be an issue for your clients: I&#xA;&gt; haven&#39;t investigated bandwidth usage deeply yet, perhaps I should.&#xA;&gt;&#xA;&gt; FWIW the current bitcoinj HDW alpha preview pre-gens 100 addresses on&#xA;&gt; both receive and change branches. But I&#39;m not sure what the right&#xA;&gt; setting is.&#xA;&#xA;&#xA;Heh, may I suggest 20 in the receive branch?&#xA;&#xA;For the change branch, there is no need to watch a large number of &#xA;unused addresses, because the wallet should try to fill all the gaps in &#xA;the sequence of change.&#xA;&#xA;(Electrum does that. It also watches 3 unused addresses at the end of &#xA;that sequence, in order to cope with possible blockchain reorgs causing &#xA;gaps. As an extra safety, it also waits for 3 confirmations before using &#xA;a new change address, which sometimes results in address reuse, but I &#xA;guess a smarter strategy could avoid that).&#xA;&#xA;&#xA;&#xA;&gt;&#xA;&gt; We also have to consider latency. The simplest implementation from a&#xA;&gt; wallets POV is to step through each transaction in the block chain one&#xA;&gt; at a time, and each time you see an address that is yours, calculate the&#xA;&gt; next ones in the chain. But that would be fantastically slow, so we must&#xA;&gt; instead pre-generate a larger lookahead region and request more data in&#xA;&gt; one batch. Then you have to recover if that batch ends up using all the&#xA;&gt; pre-genned addresses. It&#39;s just painful.&#xA;&#xA;&#xA;&#xA;&gt;&#xA;&gt;     My opinion, as far as Electrum is concerned, is that merchant accounts&#xA;&gt;     should behave differently from regular user accounts: While merchants&#xA;&gt;     need to generate an unlimited number of receiving addresses, it is also&#xA;&gt;     acceptable for them to have a slightly more complex wallet recovery&#xA;&gt;     procedure&#xA;&gt;&#xA;&gt;&#xA;&gt; Maybe. I dislike any distinction between users and merchants though. I&#xA;&gt; don&#39;t think it&#39;s really safe to assume merchants are more sophisticated&#xA;&gt; than end users.&#xA;&#xA;well, it depends what we mean by &#34;merchant&#34;. I was thinking more of a &#xA;website running a script, rather than a brick and mortar ice cream &#xA;seller. :)&#xA;&#xA;&#xA;&gt;&#xA;&gt;     but also because we want fully automated synchronization between&#xA;&gt;     different&#xA;&gt;     instances of a wallet, using only no other source of information than&#xA;&gt;     the blockchain.&#xA;&gt;&#xA;&gt;&#xA;&gt; I think such synchronization won&#39;t be possible as we keep adding&#xA;&gt; features, because the block chain cannot sync all the relevant data. For&#xA;&gt; instance Electrum already has a label sync feature. Other wallets need&#xA;&gt; to compete with that, somehow, so we need to build a way to do&#xA;&gt; cross-device wallet sync with non-chain data.&#xA;&#xA;Oh, I was not referring to label sync, but only to the synchronization &#xA;of the list of addresses in the wallet. Label sync is an Electrum plugin &#xA;that relies on a centralized server. Using a third party server is &#xA;acceptable in that case, IMO, because you will not lose your coins if &#xA;the server fails.</html></oembed>