From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 70DBAC000D for ; Sun, 17 Oct 2021 15:47:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 5DD8681C6E for ; Sun, 17 Oct 2021 15:47:00 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Spam-Flag: NO X-Spam-Score: -2.098 X-Spam-Level: X-Spam-Status: No, score=-2.098 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no Authentication-Results: smtp1.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OReDT0700XUN for ; Sun, 17 Oct 2021 15:46:59 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-yb1-xb30.google.com (mail-yb1-xb30.google.com [IPv6:2607:f8b0:4864:20::b30]) by smtp1.osuosl.org (Postfix) with ESMTPS id 3658B81C67 for ; Sun, 17 Oct 2021 15:46:59 +0000 (UTC) Received: by mail-yb1-xb30.google.com with SMTP id s64so2209772yba.11 for ; Sun, 17 Oct 2021 08:46:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=1bIcBMro4BveLKecMnCtP7vEIEE3aWgfKMp6jHiMeTk=; b=lykm3g0BAe4X0Z0lvR6IJmwsLGqfYXrdJaIWKPmxA9gklDknsJFvqDvzGUJuXjlyrR a1LrpS4oL5mhBfPmq8/+izjcSm4R/wiLdJfYr0d7h/o1qqnteiGRLymDTMMRCwzR68Y0 m8UmS/fwsTrbNHYbSGzNHX8Cx2UzozEaJbqihx5O4VcyigkwqZi6oFmqLnyiswghauwx HTqsfgJTYF1C7FpSIF39b1V/IsRwRlNJfxB/GDb0OmNJzG2zbC5zYvgr6LYaNts0+tiC BAheg1ajQR+Z5Jm5rJlIfdndiLUk2lhYuhnhxe2DEDDw4qg5S4rWR9pWm3IeC7A/h/BO tbLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=1bIcBMro4BveLKecMnCtP7vEIEE3aWgfKMp6jHiMeTk=; b=eMKSHaBWyWa85/jjN1ThhUcezWyPjD2eoXBPF93TQvCKVKYa9VvpZjk7odAEEFoDdK arkNVzl3PoI7LlP2Sdk3LkJth3La1k0EPbZ+jJx0nnph2UXLpN/pubbd84ZCBKwlPKbw 5mw3xvzZ5fTA6kNU2Ugfm/PvK9XMGjaatpsxf5EE+MNDYyA8RMmyKxY2iJVTlML54aaA CJGwQ12lq0vAihubsDvAIdYiJXCm4bzarDoqJtWw/Ek0rTMKkIiHuw7nhDabqwr6IrK8 6/DhBaBSIS4ZsT1wf1wvMjgEouE5cxE9A0DTj7lp6ERe9qQvqaKDRMldr2U8g/YPdagz oLKA== X-Gm-Message-State: AOAM530bJP8VK2lEpKDcze09VGXPfBtW1v4RGZVmJXOYL0BPMCNVEK0T meFehx72rc5E9+Xhuv96HH43NIurxKn2ZLYCLaE= X-Google-Smtp-Source: ABdhPJwkyGUwMO8EoI6WoO0xJjr6rF0z7eaN6umdbSixBE0BiE9R9zrBHQ8IFskHTOpo3XHuI2vKoV4tmM6yjyuUcns= X-Received: by 2002:a25:1ac6:: with SMTP id a189mr24281465yba.149.1634485618109; Sun, 17 Oct 2021 08:46:58 -0700 (PDT) MIME-Version: 1.0 References: <143289360-eb35e705fded3eb4175a6f8d7669b3a0@pmq5v.m5r2.onet> <0d0b22a297d112939e11c86aa1f6d736@cock.li> In-Reply-To: <0d0b22a297d112939e11c86aa1f6d736@cock.li> From: Kate Salazar Date: Sun, 17 Oct 2021 17:46:46 +0200 Message-ID: To: yanmaani@cock.li, Bitcoin Protocol Discussion Content-Type: multipart/alternative; boundary="000000000000a871da05ce8e569b" X-Mailman-Approved-At: Sun, 17 Oct 2021 16:12:33 +0000 Subject: Re: [bitcoin-dev] Year 2038 problem and year 2106 chain halting 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: Sun, 17 Oct 2021 15:47:00 -0000 --000000000000a871da05ce8e569b Content-Type: text/plain; charset="UTF-8" Hi yanmaani On Sun, Oct 17, 2021 at 5:28 PM yanmaani--- via bitcoin-dev < bitcoin-dev@lists.linuxfoundation.org> wrote: > What, no. The `k` value is calculated implicitly, because there's only > one value of it that could ever be valid - if `k` is 1 too small, we're > 70 years too far back, and then the block will violate median of last > 11. If `k` is 1 too large, we're 70 years too far in the future, then > the block will violate 2 hour rule. Nothing is added to coinbase or > anywhere else. > > It's possible that you'd need some extra logic for locktime, yes, but it > would only be a problem in very special cases. Worst-case, you'll have > to use block time locking in the years around the switch, or softfork in > 64-bit locking. > > But unless I'm missing something, 32-bit would be enough, you just > wouldn't be able to locktime something past the timestamp for the > switch. After the switchover, everything would be back to normal. > > This is a hardfork, yes, but it's a hardfork that kicks in way into the > future. And because it's a hardfork, you might as well do anything, as > long as it doesn't change anything now. > "Anything" is quite a word. Ideally, hard fork requires upgrading every node that can be upgraded, or at least have the node operator's consent to lose the node (for every node that can't be upgraded). > > On 2021-10-15 22:22, vjudeu@gazeta.pl wrote: > > Your solution seems to solve the problem of chain halting, but there > > are more issues. For example: if you have some time modulo 2^32, then > > you no longer know if timestamp zero is related to 1970 or 2106 or > > some higher year. Your "k" value representing in fact the most > > significant 32 bits of 64-bit timestamp has to be stored in all cases > > where time is used. If there is no "k", then zero should be used for > > backward compatibility. Skipping "k" could cause problems related to > > OP_CHECKLOCKTIMEVERIFY or nLockTime, because if some transaction was > > timestamped to 0xbadc0ded, then that transaction will be valid in > > 0x00000000badc0ded, invalid in 0x0000000100000000, and valid again in > > 0x00000001badc0ded, the same for timelocked outputs. > > > > So, I think your "k" value should be added to the coinbase > > transaction, then you can combine two 32-bit values, the lower bits > > from the block header and the higher bits from the coinbase > > transaction. Also, adding your "k" value transaction nLockTime field > > is needed (maybe in a similar way as transaction witness was added in > > Segwit), because in other case after reaching 0x0000000100000000 all > > off-chain transactions with timelocks around 0x00000000ffffffff will > > be additionally timelocked for the next N years. The same is needed > > for each OP_CHECKLOCKTIMEVERIFY, maybe pushing high 32 bits before the > > currently used value will solve that (and assuming zero if there is > > only some 32-bit value). > _______________________________________________ > bitcoin-dev mailing list > bitcoin-dev@lists.linuxfoundation.org > https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev > --000000000000a871da05ce8e569b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi yanmaani

On Sun, Oct 17, 2021 at 5:28 PM yanmaani--= - via bitcoin-dev <bitcoin-dev@lists.linuxfoundation.org> wrote:
What, no. The `k` value is calcula= ted implicitly, because there's only
one value of it that could ever be valid - if `k` is 1 too small, we're=
70 years too far back, and then the block will violate median of last
11. If `k` is 1 too large, we're 70 years too far in the future, then <= br> the block will violate 2 hour rule. Nothing is added to coinbase or
anywhere else.

It's possible that you'd need some extra logic for locktime, yes, b= ut it
would only be a problem in very special cases. Worst-case, you'll have =
to use block time locking in the years around the switch, or softfork in 64-bit locking.

But unless I'm missing something, 32-bit would be enough, you just
wouldn't be able to locktime something past the timestamp for the
switch. After the switchover, everything would be back to normal.

This is a hardfork, yes, but it's a hardfork that kicks in way into the=
future. And because it's a hardfork, you might as well do anything, as =
long as it doesn't change anything now.

=
"Anything" is quite a word.
Ideally, hard fork req= uires upgrading every node that can be upgraded,
or at least = have the node operator's consent to lose the node (for every
= node that can't be upgraded).
=C2=A0

On 2021-10-15 22:22, = vjudeu@gazeta.pl wrote:
> Your solution seems to solve the problem of chain halting, but there > are more issues. For example: if you have some time modulo 2^32, then<= br> > you no longer know if timestamp zero is related to 1970 or 2106 or
> some higher year. Your "k" value representing in fact the mo= st
> significant 32 bits of 64-bit timestamp has to be stored in all cases<= br> > where time is used. If there is no "k", then zero should be = used for
> backward compatibility. Skipping "k" could cause problems re= lated to
> OP_CHECKLOCKTIMEVERIFY or nLockTime, because if some transaction was > timestamped to 0xbadc0ded, then that transaction will be valid in
> 0x00000000badc0ded, invalid in 0x0000000100000000, and valid again in<= br> > 0x00000001badc0ded, the same for timelocked outputs.
>
> So, I think your "k" value should be added to the coinbase > transaction, then you can combine two 32-bit values, the lower bits > from the block header and the higher bits from the coinbase
> transaction. Also, adding your "k" value transaction nLockTi= me field
> is needed (maybe in a similar way as transaction witness was added in<= br> > Segwit), because in other case after reaching 0x0000000100000000 all > off-chain transactions with timelocks around 0x00000000ffffffff will > be additionally timelocked for the next N years. The same is needed > for each OP_CHECKLOCKTIMEVERIFY, maybe pushing high 32 bits before the=
> currently used value will solve that (and assuming zero if there is > only some 32-bit value).
_______________________________________________
bitcoin-dev mailing list
= bitcoin-dev@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mail= man/listinfo/bitcoin-dev
--000000000000a871da05ce8e569b--