diff options
author | Peter Todd <pete@petertodd.org> | 2023-10-23 15:45:44 +0000 |
---|---|---|
committer | bitcoindev <bitcoindev@gnusha.org> | 2023-10-23 15:45:50 +0000 |
commit | 80cbbf48bc33aa944624362a6c55c6489cc40f86 (patch) | |
tree | 4d1b71fe837d676128259b9c8715ea6020bd568c | |
parent | 8eebf802a77f84c82d037427d8b9bebb16373a0b (diff) | |
download | pi-bitcoindev-80cbbf48bc33aa944624362a6c55c6489cc40f86.tar.gz pi-bitcoindev-80cbbf48bc33aa944624362a6c55c6489cc40f86.zip |
Re: [bitcoin-dev] [Lightning-dev] OP_Expire and Coinbase-Like Behavior: Making HTLCs Safer by Letting Transactions Expire Safely
-rw-r--r-- | 4a/d9fc965d9040a89417ced9bdd3ce9831c68073 | 179 |
1 files changed, 179 insertions, 0 deletions
diff --git a/4a/d9fc965d9040a89417ced9bdd3ce9831c68073 b/4a/d9fc965d9040a89417ced9bdd3ce9831c68073 new file mode 100644 index 000000000..b5685a9c1 --- /dev/null +++ b/4a/d9fc965d9040a89417ced9bdd3ce9831c68073 @@ -0,0 +1,179 @@ +Return-Path: <pete@petertodd.org> +Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) + by lists.linuxfoundation.org (Postfix) with ESMTP id 7A828C0032; + Mon, 23 Oct 2023 15:45:50 +0000 (UTC) +Received: from localhost (localhost [127.0.0.1]) + by smtp4.osuosl.org (Postfix) with ESMTP id 48377413A3; + Mon, 23 Oct 2023 15:45:50 +0000 (UTC) +DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 48377413A3 +Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key, + unprotected) header.d=messagingengine.com header.i=@messagingengine.com + header.a=rsa-sha256 header.s=fm3 header.b=Q/sg5mb2 +X-Virus-Scanned: amavisd-new at osuosl.org +X-Spam-Flag: NO +X-Spam-Score: -2.6 +X-Spam-Level: +X-Spam-Status: No, score=-2.6 tagged_above=-999 required=5 + tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, + RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, + RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] + autolearn=ham autolearn_force=no +Received: from smtp4.osuosl.org ([127.0.0.1]) + by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 7Sw-tzBa0_Je; Mon, 23 Oct 2023 15:45:49 +0000 (UTC) +Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com + [66.111.4.28]) + by smtp4.osuosl.org (Postfix) with ESMTPS id 26B5E40994; + Mon, 23 Oct 2023 15:45:48 +0000 (UTC) +DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 26B5E40994 +Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) + by mailout.nyi.internal (Postfix) with ESMTP id 300E55C035D; + Mon, 23 Oct 2023 11:45:48 -0400 (EDT) +Received: from mailfrontend1 ([10.202.2.162]) + by compute1.internal (MEProxy); Mon, 23 Oct 2023 11:45:48 -0400 +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= + messagingengine.com; h=cc:cc:content-type:content-type:date:date + :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to + :message-id:mime-version:references:reply-to:sender:subject + :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender + :x-sasl-enc; s=fm3; t=1698075948; x=1698162348; bh=YEOwd9isYVbqI + 8swwyWa5/GG5FJDU1VeeMwBRCgkVOA=; b=Q/sg5mb2AD1OOwH8+bW8AgFxy9lMS + Di70sCcP2KAjh6S70aXkKQ0q429cK3WHDblZWnliOX2p1HKQX6yxg1uPd9da4OzC + quDkRn6N+3aTw7EM/ORfc09GsNPTcjOguMOblNYFLjkwTuWE/TB60CoF7Yu0nNmA + ZPfnR+OQX7Njp7U7YP6QzznmKYGw1Re9Q5WppEYslBsL0pgltXq/SwfjO8GNEAYV + WaqcKTBXfjyikBFS2Coye0xna6SumdDGA/Fn6wBMHxI0LSFzedJrHQtkzjh8NUPd + BfPm+OXVtDEcoctZQowQKkd4gBsuZ61wMM6l+UR7v9W2XSsNbCSZQyACQ== +X-ME-Sender: <xms:K5U2ZfanF735aJqCQY8N_tb7uRlzu4vOYLokks52R-Nin2Qx0WQumA> + <xme:K5U2ZeajtzbQmVj9SpA0rZDogzrx6ym89h6FKx4_dgMJit0vZYZDlgGfGLvgOP9ct + FyOLpL4_RLSpFMCYwQ> +X-ME-Received: <xmr:K5U2ZR_F2cyOaH9Kl_L_FhY5_VNqst7jlr2cVzOr34wAXiYUsnD623KxXCbizO9KrvbBjh68C0BjleYIehflNMEBJacIQXD7> +X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrkeeigdeludcutefuodetggdotefrodftvf + curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu + uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc + fjughrpeffhffvvefukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefrvghtvghr + ucfvohguugcuoehpvghtvgesphgvthgvrhhtohguugdrohhrgheqnecuggftrfgrthhtvg + hrnhepledvleelffdtudekudffjefgfeejueehieelfedtgfetudetgeegveeutefhjedt + necuffhomhgrihhnpehpvghtvghrthhouggurdhorhhgnecuvehluhhsthgvrhfuihiivg + eptdenucfrrghrrghmpehmrghilhhfrhhomhepphgvthgvsehpvghtvghrthhouggurdho + rhhg +X-ME-Proxy: <xmx:K5U2ZVo0Sr8iYHRkuODF4xs7SJ4mLwtjl3ya-xGrhHrnsJYIheMxDA> + <xmx:K5U2Zarq3KiKnyartVIBtowrW5WcU-Y_2WWmdLXBDEvfHMd4NhX2Nw> + <xmx:K5U2ZbRCg6Ls2TbJFDG3-O_751r9i-EVQ1WL2QDS9sdZ6hy2TXKQRA> + <xmx:LJU2Zbf2NjlRlIINn-a9pBASgchkp95TQgRu8vJEq6EAQ9DFtZU02g> +Feedback-ID: i525146e8:Fastmail +Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, + 23 Oct 2023 11:45:47 -0400 (EDT) +Received: by localhost (Postfix, from userid 1000) + id 3420B5F86B; Mon, 23 Oct 2023 15:45:44 +0000 (UTC) +Date: Mon, 23 Oct 2023 15:45:44 +0000 +From: Peter Todd <pete@petertodd.org> +To: ZmnSCPxj <ZmnSCPxj@protonmail.com> +Message-ID: <ZTaVKB1wdsLL7XiK@petertodd.org> +References: <CALZpt+GdyfDotdhrrVkjTALg5DbxJyiS8ruO2S7Ggmi9Ra5B9g@mail.gmail.com> + <ZTMWrJ6DjxtslJBn@petertodd.org> + <o2Dp_FkSCCwB6Mo9dePXgvxwQeKcmDwK_fNK6bhHPrsYIC6KaoeTtfHh8kv2NGHqkJhppNmEvRZGTly1Zs3Of1gIfl76iNQgCZaNJ-bJqgE=@protonmail.com> +MIME-Version: 1.0 +Content-Type: multipart/signed; micalg=pgp-sha512; + protocol="application/pgp-signature"; boundary="J6SITKTbT5gUF8FZ" +Content-Disposition: inline +In-Reply-To: <o2Dp_FkSCCwB6Mo9dePXgvxwQeKcmDwK_fNK6bhHPrsYIC6KaoeTtfHh8kv2NGHqkJhppNmEvRZGTly1Zs3Of1gIfl76iNQgCZaNJ-bJqgE=@protonmail.com> +Cc: Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org>, + security@ariard.me, "lightning-dev\\\\\\\\@lists.linuxfoundation.org" + <lightning-dev@lists.linuxfoundation.org> +Subject: Re: [bitcoin-dev] [Lightning-dev] OP_Expire and Coinbase-Like + Behavior: Making HTLCs Safer by Letting Transactions Expire Safely +X-BeenThere: bitcoin-dev@lists.linuxfoundation.org +X-Mailman-Version: 2.1.15 +Precedence: list +List-Id: Bitcoin Protocol Discussion <bitcoin-dev.lists.linuxfoundation.org> +List-Unsubscribe: <https://lists.linuxfoundation.org/mailman/options/bitcoin-dev>, + <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=unsubscribe> +List-Archive: <http://lists.linuxfoundation.org/pipermail/bitcoin-dev/> +List-Post: <mailto:bitcoin-dev@lists.linuxfoundation.org> +List-Help: <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=help> +List-Subscribe: <https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev>, + <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=subscribe> +X-List-Received-Date: Mon, 23 Oct 2023 15:45:50 -0000 + + +--J6SITKTbT5gUF8FZ +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +Content-Transfer-Encoding: quoted-printable + +On Mon, Oct 23, 2023 at 11:10:56AM +0000, ZmnSCPxj wrote: +> Hi all, +>=20 +> This was discussed partially on the platform formerly known as twitter, b= +ut an alternate design goes like this: +>=20 +> * Add an `nExpiryTime` field in taproot annex. + +I would strongly suggest making it nExpiryHeight, and only offering the opt= +ion +of expiration at a given height. + +Time-based anything is sketchy, as it could give miners incentives to lie a= +bout +the current time in the nTime field. If anything, the fact that nLockTime c= +an +in fact be time-based was a design mistake. + +> * This indicates that the transaction MUST NOT exist in a block at or a= +bove the height specified. +> * Mempool should put txes buckets based on `nExpiryTime`, and if the bl= +ock is reached, drop all the buckets with `nExpiryTime` less than that bloc= +k height. +> * Add an `OP_CHECKEXPIRYTIMEVERIFY` opcode, mostly similar in behavior to= + `OP_EXPIRE` proposed by Peter Todd: + +Note that if we redefine an OP_SuccessX opcode, we do not need _Verify +behavior. We can produce a true/false stack element, making either OP_Expi= +re +or OP_CheckExpiryTime better names for the opcode. + +> * Check if `nExpiryTime` exists and has value equal or less than the st= +ack top. +>=20 +> The primary difference is simply that while Peter proposes an implicit fi= +eld for the value that `OP_EXPIRE` will put in `CTransaction`, I propose an= + explicit field for it in the taproot annex. + +To be clear, I also proposed an explicit field too. But I had a brainfart a= +nd +forgot that we'd added the taproot annex. So I proposed re-using part of +nVersion. + +> The hope is that "explicit is better than implicit" and that the design w= +ill be better implemented as well by non-Bitcoin-core implementations, as t= +he use of tx buckets is now explicit in treating the `nExpiryTime` field. + +Also, having a nExpiryHeight may be useful in cases where a signature cover= +ing +the field is sufficient. + +--=20 +https://petertodd.org 'peter'[:-1]@petertodd.org + +--J6SITKTbT5gUF8FZ +Content-Type: application/pgp-signature; name="signature.asc" + +-----BEGIN PGP SIGNATURE----- + +iQIzBAEBCgAdFiEE0RcYcKRzsEwFZ3N5Lly11TVRLzcFAmU2lSUACgkQLly11TVR +LzeuYA//VXMPcCNN835JobBNhk0hbufUVxRlrNQrXqdgQzXPzbVjkiLd6AdaODps +WBN7GXFBGpVn9o5N4FEODDOgdp5p5D6UZd+dz1245D14DifH4SyQVw3+qzj09wiZ +FqMOKR0DoQXL9gzRGC9dHJZhRuINsJq6EMWawaLnY+g42XIUjKtgdKZ+2aRtiRhT +6f6WdAmn4m3eEKaAIrT2lSZ4IJupSDv4VzIkeNpNYEX6Fwo6VGEangyg/SiwcDG0 +HAeLhVwVeaS0a5Q+gjzSXPPHeBKyxl6MU5PlWqqi2ryralxyGmrIyBlGfB7U52Xi +OohxIexV9NhKNuVmEYnPNL+0rnKrZ9SSrPDaa+1z+jfJkFlBh23WMoPmupunUC2H +4n1jUrwV9bxcbk4zjO/lUFPlbKgDToHf8mzp9a4qZFvqNsCElcT+q8srhCZWBsIb +YoyVs4J1RMHCADchc5JqPN0HDnMAhRG7tpf6EzdMVIPX1uUOnjKSBrfziwLSqeJ6 +UyQ5MEiMCCJuRRdC6MlrNuGWhUeppECtoN5uG4e/lWGHMgf/YJ9yofNprZJgBf5U +50yH/Zmt6Mlv2NYrfs9JnslgZoPYXsV57Z4Ut1H4PFeX+feKVvZfAOZQA0NsDO83 +aPkOjXykauPX5HVXOSMJmbdQekm0P5bjdnzD7Vgx3EUmqgjHvos= +=7Oab +-----END PGP SIGNATURE----- + +--J6SITKTbT5gUF8FZ-- + |