Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1WTBrF-0002sw-6m for bitcoin-development@lists.sourceforge.net; Thu, 27 Mar 2014 15:04:41 +0000 Received-SPF: pass (sog-mx-2.v43.ch3.sourceforge.com: domain of gmx.de designates 212.227.17.21 as permitted sender) client-ip=212.227.17.21; envelope-from=thomasv1@gmx.de; helo=mout.gmx.net; Received: from mout.gmx.net ([212.227.17.21]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:AES128-SHA:128) (Exim 4.76) id 1WTBrD-0000po-03 for bitcoin-development@lists.sourceforge.net; Thu, 27 Mar 2014 15:04:41 +0000 Received: from [192.168.1.27] ([84.101.32.222]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0MLujU-1WPrPY2Ym4-007jy6 for ; Thu, 27 Mar 2014 16:04:32 +0100 Message-ID: <53343DFF.2070406@gmx.de> Date: Thu, 27 Mar 2014 16:04:31 +0100 From: Thomas Voegtlin User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 CC: Bitcoin Development References: <53340999.807@gmx.de> <5334144A.9040600@gmx.de> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:STfMNyoQqkuGhPmaofNasvPUtuOW60nxtkeuqtBtlGi5/b80ehg Kk/WN6cKM7sgZdK3SCD5YoOOVjF+3OkxPaYa46Si4D/VjB34MWUql0mxeE5ZX/3mNCLmcNc dmEO0UqMomizoCN4qymFFFWrQg0SakpTGbMNhbLxVsJP3Lw4jBj5keVaiLcvkC0tkM+iJev eBUmFxpw9X+0empA+Xz/Q== X-Spam-Score: -0.0 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.17.21 listed in list.dnswl.org] -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (thomasv1[at]gmx.de) -0.0 SPF_PASS SPF: sender matches SPF record 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (thomasv1[at]gmx.de) 1.2 MISSING_HEADERS Missing To: header X-Headers-End: 1WTBrD-0000po-03 Subject: Re: [Bitcoin-development] New BIP32 structure X-BeenThere: bitcoin-development@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 15:04:41 -0000 > > Related to this, here is another idea I would like to submit: > > Instead of using a "gap limit" (maximal number of consecutive unused > addresses), I think we should get rid of the topology, and simply count > the number of unused addresses since the beginning of the sequence. > Indeed, the topology of the sequence of addresses is of no interest to > the user. Users often misinterpret "gap limit" as the "number of unused > addresses available", so I think we should just give them what they want > :) This is easier to understand, and it makes things more predictable, > because the wallet will always display the same number of unused > addresses (except when it is waiting for confirmations). > > > I'm not convinced that it is either simpler to implement nor simpler to > understand. I considering every "account" as completely independent > structure (except that it has been derived from master seed). Because of > this, I don't see a reason why number of generated addresses in one > account should affect available addresses of other account. Sorry if I was not clear, but no, I was not proposing that... I propose to count the number of unused addresses in each account, independently. Here is an explanation with pictures: Currently, Electrum does this: x = used address o = unused address x x x o o x x x x o o o o o | └───────┘ 5 unused addresses at the end (gap limit =5) existing gap, size 2 Case 1: Suppose the user decides to use the 4th address starting from the end: x x x o o x x x x x o o o o After 3 confirmations, Electrum will create one extra address: x x x o o x x x x x o o o o o └───────┘ 5 final address (one new) Case 2: The user, who understands nothing about topology, decides to use the final address: x x x o o x x x x o o o o x After 3 confirmations, Electrum will create 5 new addresses: x x x o o x x x x o o o o x o o o o o | └───────┘ 5 new addresses new gap (size 4) You see that this leads to a number of newly created addresses that depends on the address picked by the user. This is the behaviour that I want to fix. I think it is bad for two reasons: First, because it is unpredictable (I had a user who set his gap limit to 100, and then was systematically using the last address of the list, ending up with a lot of wasted addresses). Second, because the worst case scenario (case 2) creates large gaps, which are less robust to blockchain reorgs than in case 1. A reorg in case 1, where the last tx is cancelled will create no gap. A reorg in case 2 can result in a gap that is larger than the limit (5), if another transaction uses the final addresses. (this is why Electrum has to wait for a few confirmations before adding addresses) So, what I propose is to always have a constant number of unused addresses in each account, instead of something that depends on the topology. (this number can be 10 or 20, I don't mind, but I guess Mike might prefer 20...)