From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrkeeigdeludcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefrvghtvghr ucfvohguugcuoehpvghtvgesphgvthgvrhhtohguugdrohhrgheqnecuggftrfgrthhtvg hrnhepledvleelffdtudekudffjefgfeejueehieelfedtgfetudetgeegveeutefhjedt necuffhomhgrihhnpehpvghtvghrthhouggurdhorhhgnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomhepphgvthgvsehpvghtvghrthhouggurdho rhhg X-ME-Proxy: 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 To: ZmnSCPxj Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="J6SITKTbT5gUF8FZ" Content-Disposition: inline In-Reply-To: Cc: Bitcoin Protocol Discussion , security@ariard.me, "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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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--