Return-Path: Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 54419C0051 for ; Fri, 16 Oct 2020 21:58:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id A87582E880 for ; Fri, 16 Oct 2020 21:58:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iu0N238UYKmS for ; Fri, 16 Oct 2020 21:58:31 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-40136.protonmail.ch (mail-40136.protonmail.ch [185.70.40.136]) by silver.osuosl.org (Postfix) with ESMTPS id 62F452E85D for ; Fri, 16 Oct 2020 21:58:31 +0000 (UTC) Date: Fri, 16 Oct 2020 21:58:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wuille.net; s=protonmail2; t=1602885508; bh=B7q2zOo2HGwbb1gryWmfFj8Z58g0maL4QuOIhcBKZrk=; h=Date:To:From:Reply-To:Subject:In-Reply-To:References:From; b=oJsntOhiGBkd0Gitzc6TxvEwtPmIfr791szBU/nDQauMHJUtPMoHZ89wYlccpAeZf RyvKWuGJCG1Cf0x+HoLPqqA2zJ2WWEknIUJaeHLNbV0OQVVE3JbWssp96Bh6FbZsFO zaxZ2P1o2fLx+ZeWszrZyQREoQpzgaAp55xKe1ty4iDm91Mif8XVTxi+NbUNg+pMs2 0Rf0kRqEY2vuDL8rxNyBpBi9Otwz35ZGl/UmhVLF2PeNQTmn50v0Y+uogAXmLhrNmK k0ACtOB4O+E1RHO21/tfzh4g0/Q1IMPLU2s98/fQUX6DAelG2ZAgK+ht/e0rJEtkhE P/bBoPQh3Nt+A== To: "yanmaani@cock.li" , Bitcoin Protocol Discussion From: Pieter Wuille Reply-To: Pieter Wuille Message-ID: In-Reply-To: <42c7e76c023b403a9e99d29a1836b53e@cock.li> References: <42c7e76c023b403a9e99d29a1836b53e@cock.li> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Mailman-Approved-At: Fri, 16 Oct 2020 23:34:55 +0000 Subject: Re: [bitcoin-dev] Suggestion: Solve year 2106 problem by taking timestamps mod 2^32 X-BeenThere: bitcoin-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Bitcoin Protocol Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2020 21:58:34 -0000 On Saturday, September 19, 2020 5:36 AM, yanmaani--- via bitcoin-dev wrote: > Currently, Bitcoin's timestamp rules are as follows: > > 1. The block timestamp may not be lower than the median of the last 11 > blocks' > > 2. The block timestamp may not be greater than the current time plus two > hours > > 3. The block timestamp may not be greater than 2^32 (Sun, 07 Feb 2106 > 06:28:16 +0000) > > Thus, Bitcoin will "die" on or about 2106-02-07, when there is no > timestamp below 2^32 that exceeds the median of the last 11 blocks. > > If the rules were changed to the following, this problem would be > solved: > > 4. The block timestamp plus k*2^32 may not be lower than the median of > the last 11 blocks' > > 5. The block timestamp plus k*2^32 may not be greater than the current > time plus two hours > > 6. k is an integer, whose value must be the same for the calculations of > Rule 1 and Rule 2 I believe that is equivalent to: we treat block headers (as abstract data structure) as having a 64-bit timestamp, which have the requirement that the difference between the timestamp and the median timestamp of the past 1= 1 blocks is at least one and at most 2^32 (I don't think we need to support less than 6 blocks per 136 years). On serialization, only the lower 32 bit are encoded. On deserialization, the higher 32 bits are set equal to that of the median of the past 11 block= s. If that violates the rule above, set it one higher. That's in line of how I'd expect this will eventually be addressed. There i= s no rush, of course. > What do you think of this idea? Is it worth a BIP? Probably, at some point. Cheers, -- Pieter