Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1RNRMA-0008AQ-Rz for bitcoin-development@lists.sourceforge.net; Mon, 07 Nov 2011 15:43:30 +0000 X-ACL-Warn: Received: from rhcavuit02.kulnet.kuleuven.be ([134.58.240.130] helo=cavuit02.kulnet.kuleuven.be) by sog-mx-3.v43.ch3.sourceforge.com with esmtp (Exim 4.76) id 1RNRMA-0005Z8-3V for bitcoin-development@lists.sourceforge.net; Mon, 07 Nov 2011 15:43:30 +0000 X-KULeuven-Envelope-From: sipa@ulyssis.org X-Spam-Status: not spam, SpamAssassin (not cached, score=-48.798, required 5, autolearn=disabled, DKIM_ADSP_CUSTOM_MED 0.00, FREEMAIL_FROM 0.00, KUL_SMTPS -50.00, NML_ADSP_CUSTOM_MED 1.20) X-KULeuven-Scanned: Found to be clean X-KULeuven-ID: 68BC012808B.A568E X-KULeuven-Information: Katholieke Universiteit Leuven Received: from smtps02.kuleuven.be (smtpshost02.kulnet.kuleuven.be [134.58.240.75]) by cavuit02.kulnet.kuleuven.be (Postfix) with ESMTP id 68BC012808B; Mon, 7 Nov 2011 16:43:21 +0100 (CET) Received: from smtp.ulyssis.org (mail.ulyssis.student.kuleuven.be [193.190.253.235]) by smtps02.kuleuven.be (Postfix) with ESMTP id 3756DF3863; Mon, 7 Nov 2011 16:43:21 +0100 (CET) Received: from wop.ulyssis.org (wop.intern.ulyssis.org [192.168.0.182]) by smtp.ulyssis.org (Postfix) with ESMTP id 6944710052; Mon, 7 Nov 2011 16:43:48 +0100 (CET) Received: by wop.ulyssis.org (Postfix, from userid 615) id 652DF87C1B1; Mon, 7 Nov 2011 16:43:21 +0100 (CET) Date: Mon, 7 Nov 2011 16:43:21 +0100 X-Kuleuven: This mail passed the K.U.Leuven mailcluster From: Pieter Wuille To: Luke-Jr Message-ID: <20111107154319.GA9455@ulyssis.org> References: <20111107150240.GA26096@ulyssis.org> <201111071027.58932.luke@dashjr.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201111071027.58932.luke@dashjr.org> X-PGP-Key: http://sipa.ulyssis.org/pubkey.asc User-Agent: Mutt/1.5.20 (2009-06-14) X-Spam-Score: 1.2 (+) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (pieter.wuille[at]gmail.com) 0.0 DKIM_ADSP_CUSTOM_MED No valid author signature, adsp_override is CUSTOM_MED 1.2 NML_ADSP_CUSTOM_MED ADSP custom_med hit, and not from a mailing list X-Headers-End: 1RNRMA-0005Z8-3V Cc: bitcoin-development@lists.sourceforge.net Subject: Re: [Bitcoin-development] Difficulty adjustment / time issues 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: Mon, 07 Nov 2011 15:43:30 -0000 On Mon, Nov 07, 2011 at 10:27:57AM -0500, Luke-Jr wrote: > On Monday, November 07, 2011 10:02:43 AM Pieter Wuille wrote: > > Maybe a short interval (1 minute? 10 minutes?) instead of a fixed > > value could be allowed for the multiple-of-2016 blocks. > > Reminder that there is *already* a short interval only allowed for blocks in > general... In chains where no timejacking attack is going on, yes. In the common case the timestamp is limited to a range of [5 blocks in the past ... 2 hours in the future]. However, during a timejacking attack, the timestamps of multiple-of-2016 blocks are essentially independent from the others. In such a case, most timestamps are very low, and only those of multiple-of-2016-blocks correspond to the current time. Each 2016*N-1 to 2016*N transition incurs an arbitrary large forward shift to the present time, each 2016*N to 2016*N+1 transition does a time shift backwards again that is allowed because the median allows single outliers. By fixing the timestamp occasionally more tightly to the maximum, instead of the median, no such time lapses are possible. Updated proposed rule: limit the timestamp of multiple-of-2016-blocks to [max(past 11 timestamps)+1 ... current_time+7200], essentially just using a maximum instead of a median. I believe that is enough to prevent the attack. -- Pieter