From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Mon, 30 Nov 2026 23:52:16 -0800 Received: from mail-oo1-f64.google.com ([209.85.161.64]) by mail.fairlystable.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1xYIet-000VbO-9G for bitcoindev@gnusha.org; Mon, 30 Nov 2026 23:52:16 -0800 Received: by mail-oo1-f64.google.com with SMTP id 006d021491bc7-703a37d970esf12344711eaf.1 for ; Mon, 30 Nov 2026 23:52:14 -0800 (PST) ARC-Seal: i=3; a=rsa-sha256; t=1796111529; cv=pass; d=google.com; s=arc-20260327; b=BL4WzoWM5Y1moALemyO8pvJtoGSBRfW1pZNqOBAEIgt3yDSTOcEJk56ml5x2cWSSPI wvvrqGRZkrHlpLkoza4OL6sm9R4Hx0jgcEf1GrEsCSvY08levdaoa+fzwtqaUE4ltmDk txtuscBR/A9fzhZ7iGrUenBzQlJjjpHr3fi2aLqUyTu+zpXmLwEge/wZJ/tbxaRnlc3E r9gkJdOI63r0CLCLqCcMl4wB1XSpqZpWtSG8hjbyjsWLkZmXRO1oeimWZulolhsCMemY 7LacnHHunLnCwDFatUnT5mROLa69Br5XKjV3bnHBxA86FLRFwoVwNeSr+kAnqdj3vrG8 QCUw== ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:cc:to:subject:message-id:date:from :mime-version:sender:dkim-signature:dkim-signature; bh=qbe0ipgy/8yHW7UeLqfdU28gYypK5sFoWH3zhnaB2VE=; fh=N+B7q0vqv57be3GNXFJS5bIzRTWkjoBEYvbWqPEQgtQ=; b=W8QzYDGPAJmNKRmmxC+I1yoht6Y1fCYlPWgay8DM2+bmzK42G0dNMtMyZAJHSZHeLX 6cYlCSFhaSbf9BU/fXu4qPdULV7kA5couTmWFh/KmBqF75obbnJZjqbS8cdLKIrDhY0S p/BvG6l3b8jveqKlu5ym2nbqlHYYOzhDN1ZazB1VjlnebL7L4429l5dpWMqxuXHOJ84w n42PEyPt/gznlhUxC0PIZKms9dR1bQ7gJeaJDUBsQkm8iNNA3EGSyHlHqGclZSu057EO 3+KDnSogsPWFNsS2Tha1HNbTobWEZvmDGP7Xqmo5Y3WexGAQlPn2ImeJPBIO+NWJcv3a ozIg==; darn=gnusha.org ARC-Authentication-Results: i=3; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20260707 header.b="dT2M/cek"; arc=pass (i=1); spf=pass (google.com: domain of antoine.riard@gmail.com designates 2607:f8b0:4864:20::122b as permitted sender) smtp.mailfrom=antoine.riard@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com; dara=pass header.i=@googlegroups.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20260707; t=1796111529; x=1796716329; darn=gnusha.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:content-type:cc:to:subject:message-id:date:from :mime-version:sender:from:to:cc:subject:date:message-id:reply-to :content-type; bh=qbe0ipgy/8yHW7UeLqfdU28gYypK5sFoWH3zhnaB2VE=; b=I5Of0V3brTBpOC7bsfTxB/PVfEztrzm8+046v7tV2miNttq4nizjXLE0dILpNrOn2T JLZHQIX3mDk+8v0h3j6IHRM45Y5McGbVO5G2ArGy+Y4ytz5+lC/cAfS92e8L7S0c99we 2U8xKakOELLxB+GVRO/9xLY538OCshI0Hd1I8kktUwu3F0Dggpf7B1wJ4RwWPeQ5Jeid 9kpAOP1GUPDCG0aw4YhkqJm9ZcEyLRzd8N94Cp461hQ6RRzpf9AFzd3oIwv11KVTqjtx oFRD5HRdXA1yhn9F4eLZ760XTKoPyhB+k79mrDIzh1yBu+JJrXkPc5Vkt6w9Gj2cH+Mk q06Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796111529; x=1796716329; darn=gnusha.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:content-type:cc:to:subject:message-id:date:from :mime-version:from:to:cc:subject:date:message-id:reply-to :content-type; bh=qbe0ipgy/8yHW7UeLqfdU28gYypK5sFoWH3zhnaB2VE=; b=Ag1FA0v/Bzr8J4KgQGbxOi7X8xddnkBIC3f7tgGMzeOmo3tVD3LFWj+Iv9D8wf3sJD waRfyqWgYxV4dzUBK/4PHsqkkT3W4GYJqUso1ZKtGLoXvDveZMa5tl0BxkKNi2/kuV82 NhEdYWlJeN3kcYhMFTbpL+rBVB0KSmM4plmNCNiM4zNE9d8Hts1iDZR/gTl3l8oMbGmv bGhZhHAcabCG31CgGktBY1aAqL8wTzsD2g+nyLA2l/ZBhR8+9BPaRvwC+4AFnm0sBw4O leRaD1ruR+Hgeg+Ii34Q9pUYrko6stdifGm9UcsQv4t8ORHg9PxUzm7r5Wp/pmE5mv9V dIyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796111529; x=1796716329; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:content-type:cc:to:subject:message-id:date:from :mime-version:x-gm-gg:x-beenthere:x-gm-message-state:sender:from:to :cc:subject:date:message-id:reply-to:content-type; bh=qbe0ipgy/8yHW7UeLqfdU28gYypK5sFoWH3zhnaB2VE=; b=QjdE4Agg4oMj7bLFZf2zPxtFGjUJ6omRIA4cK7L49c1avbSid9qrUo+/XyKIG4TFn5 UiLtQVz95k5K8c14cgLp+iW1cJ23tPfDPbS2e1+ErPX/sdV723tx+CaAZ8dJokkWakWi RYe2l/uuo4Yqivt3AG+zlZ7Acf2Evf/rfOV/QwWXgVC+/ArVc97cfZSYJ35McTSj1f0Z eguP/OttnM7u12ZesPyXqmop+ylqK2M6e7+3d1jBPfg8PTKy46MtZ2WMqDDWQRHYjEm9 T538hVwWArH3tZndzq2uJCO0+TVMa1JjCaeGarh1LfjlTEnbLaqrT2CEhor5MajLYj/O llfQ== Sender: bitcoindev@googlegroups.com X-Forwarded-Encrypted: i=3; AL+hErGnvbbqlE090r9Tgj2tDV24mrMyiQ7iMhstXb5usb4unOJgAVFqJk/0s7Nb1RuGx8BRgxy3KJU3TNm7@gnusha.org X-Gm-Message-State: APuU4Z+jIf7SPZI3AV1Mk8DVXQ2niRg4Q2JcsyBfVoVIJfy4pJ8kcVrk FqJ4eb/MX/OavK0juacL3iwg6yBePrQSVuPF+ejK9PEaALCE26OrTD2+ X-Received: by 2002:a05:6820:418c:b0:716:b936:7cfb with SMTP id 006d021491bc7-71b39527ea2mr24609405eaf.26.1796111528715; Mon, 30 Nov 2026 23:52:08 -0800 (PST) X-BeenThere: bitcoindev@googlegroups.com; h="ATskLdeL/tRVcf2zM5hSzwfX4p6CzZTwo6peVKfN1hXr8XgnJg==" Received: by 2002:a05:6820:a286:20b0:704:6019:73b6 with SMTP id 006d021491bc7-71b7fadd2fcls1290570eaf.2.-pod-prod-08-us; Mon, 30 Nov 2026 23:52:02 -0800 (PST) X-Received: by 2002:a05:6808:1811:b0:572:c1b3:c48e with SMTP id 5614622812f47-57a09105e06mr39484306b6e.30.1796111522066; Mon, 30 Nov 2026 23:52:02 -0800 (PST) Received: by 2002:a05:6808:a5d7:20b0:572:f7eb:ee1 with SMTP id 5614622812f47-57a32c5d3cfmsb6e; Mon, 30 Nov 2026 20:57:41 -0800 (PST) X-Received: by 2002:a05:6a00:3d12:b0:89e:fc47:2c17 with SMTP id d2e1a72fcca58-8c87b4f3a5bmr35974776b3a.19.1796101060503; Mon, 30 Nov 2026 20:57:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1796101060; cv=pass; d=google.com; s=arc-20260327; b=SHdUPnAQISscmvSd9l8tda5+FkW6HNGHiWcSd1zh1h3wcO5bUXQ3FgIos+AqavacqE UKrEnA5UifUyNciNyYTjYFQEMB84rZdAhoiC75sTmtGGcZniy+8Gdg5bUzzbwp8TW+ed QLVsCmSLsOHTlGm7zQ+V/wm4Sxvd6TdWfiq9TYC/AODyjVZBT18ss9ryOsa6HT7ZFVWc MxAttvg6x1EApMekR0/8IeeSP4TuopmxwtZgWRk2+IPu4xPAYwsEiagiwHYrazyGriCf 0UB7GiBLFhM8UarqtjhCGA8UCwUxVho5kkRTnhG2ULuQkXBnL4EJvDZ24bRctIE0nCBQ d1fw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=cc:to:subject:message-id:date:from:mime-version:dkim-signature; bh=FIaDcJgkLRWFVwB4M5B0c30X5uHtwwDLZhLHjfyg8Us=; fh=rkm3bHbFkkqaOCEhDYIrUdh+uNF0aEpt1sjHeEyiFh0=; b=HO3rowpOq3IpFMX07OGFyfdnm6bjT3g2jj9tynmgTr3AQ93k+nu0V8Jk9AbRog6aXG JmUj+FOM+Q76WGq4Npa3P6UgqBvNVSBLs13VgB98waPCMdDjjEbxnVFEwi617270wk47 iyapA8vwriS4c2uPpH2KfIfXBRhP9fgKsSkSbqG8hnZ+oGvQmtN0xngA9PNGhfOrvgRo p1ekRcBcSXSSih8hG6Nfp7icRijXMYswdwgyD8ubtAqFTBKv36qV/ZB5eP85EnbomCCr IhAZhN7JYYgHJbCnjezl9DMUzQ+pYNau1k5STE8J2djsWf86xEJU3Q0kmTfD/EumQ+Z1 d6fg==; dara=google.com ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20260707 header.b="dT2M/cek"; arc=pass (i=1); spf=pass (google.com: domain of antoine.riard@gmail.com designates 2607:f8b0:4864:20::122b as permitted sender) smtp.mailfrom=antoine.riard@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com; dara=pass header.i=@googlegroups.com Received: from mail-dl1-x122b.google.com (mail-dl1-x122b.google.com. [2607:f8b0:4864:20::122b]) by gmr-mx.google.com with ESMTPS id d2e1a72fcca58-8c872e4ae46si709919b3a.10.2026.11.30.20.57.40 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Nov 2026 20:57:40 -0800 (PST) Received-SPF: pass (google.com: domain of antoine.riard@gmail.com designates 2607:f8b0:4864:20::122b as permitted sender) client-ip=2607:f8b0:4864:20::122b; Received: by mail-dl1-x122b.google.com with SMTP id a92af1059eb24-1b5adf7eacdso3452242c88.1 for ; Mon, 30 Nov 2026 20:57:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1796101060; cv=none; d=google.com; s=arc-20260327; b=PsUaZCx/U7hFDKhatd7CP35jK+53O5vBfVOCXZyqGaKR44O2uhhHDYk6C6Rh9U15AF hMucs0LUYE07L8IbMjYyhUfmKwv47LerdlyNFcMLeWhh2GSBNzzlNyxCD66oqB9aCb/B yT/bd9G53O0gc0+fqEiVOZ0apbXU8KFOswyojlgx48DBFX9IjRxKQmQZFlDDiGIIHptF 9azQ8eqySVOWfV9+9m+AnvZb9PecFFeSgstRPFxTDlC/k7DQkvmRSvCYi5RUEYpW1tmy f3vcVOWBUdmuXKunnHwuK7ASxIX8qHQeAbfmyXvnFXLuBB0AW7Gj1G0rXLvxe7Mlc+MA hgyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=cc:to:subject:message-id:date:from:mime-version:dkim-signature; bh=FIaDcJgkLRWFVwB4M5B0c30X5uHtwwDLZhLHjfyg8Us=; fh=rkm3bHbFkkqaOCEhDYIrUdh+uNF0aEpt1sjHeEyiFh0=; b=G0i3wNmTMhjgYsuoBuCEF4DEc548NvI/T+A6Co6kBkWyfGvmQ+/gV6QFbBPMhxiyep 30SV8H9rsOhN8Vnuj2nWV8rlbcyfRIWcb77Gc0oFpz3FcyIC1YBjGVHIVI+hyWtQhIej Lwa8BJkBJ+VZDluiDjGX7FMkL6IALOrlbXHf4iPF6YrDzUoeGARx62Px4ULWx2TKMxSC cmYts15pbLRn0h5L+wENYPSNdJWn/HGqlpbGPYWfR4vEDbRRLSTeEtmp6PNf2OOfaQbZ RnXIaXhS58iDTD4WOueHl4A2HdwMYw91C/oyJQnHnL0k0I4kfPv8wE/eQG/IAyoQ3BL/ IEhw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; arc=none X-Gm-Gg: AZFdTZfcebL1IJaab4mlmQhwQ1ogCTnhNgNW3eO3douE7d88+atR7hTtmDN0GNei0xf AVI0LNkoW/OPK1uRBuWXJlKWJSHjLm5q5B9YrhRQzODL2nVUL6bPEw1YM/NU7yN9UsDLaSyyJ7l hspbTWN9woymUZq65Eq7UOocz1Uri0K33498S9STeoFrUGBfbcdBrOWkpRrIUziF4Ltp5qNqE/L BgAjrYWu5QfJWazhyo3ANaDDoWUyG9QdFE4zcQXlh5DNnThaTc9XZZ8RPK6iaHHpo00NIDDw4Ok QF2N2L+hg2IGtEHXjMxpUckaJgev+no4eCdQxF/mOpOaHIpTmKy+5SVrgM9/qxvzy1cEcKwTDNk ViEVECkERDf3s7wvttAsfFL4PsMMBgkVsxwA7QygWS7Jf2tkBumImepaitVo2U10Wt0BVgFkbA4 qyrUpAu2b1v0ItJz5AwS7oHG9VBrdS X-Received: by 2002:a05:701a:cc90:20b0:1b5:888a:a1a7 with SMTP id a92af1059eb24-1b5888aa2d6mr19660925c88.19.1796101059516; Mon, 30 Nov 2026 20:57:39 -0800 (PST) MIME-Version: 1.0 From: Antoine Riard Date: Tue, 1 Dec 2026 04:57:28 +0000 X-Gm-Features: Aa3M54pXy_BxBZUfZ09ewTMVvzJ2PQdx6pyfbFqk5iXjmdO8g3vIXtGWa0mTZXk Message-ID: Subject: [bitcoindev] BIP54: 64 byte tx or not 64 byte tx outlaw To: Bitcoin Development Mailing List Cc: btc@ariard.me Content-Type: multipart/alternative; boundary="000000000000a21d3106618b5d0d" X-Original-Sender: antoine.riard@gmail.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20260707 header.b="dT2M/cek"; arc=pass (i=1); spf=pass (google.com: domain of antoine.riard@gmail.com designates 2607:f8b0:4864:20::122b as permitted sender) smtp.mailfrom=antoine.riard@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com; dara=pass header.i=@googlegroups.com Precedence: list Mailing-list: list bitcoindev@googlegroups.com; contact bitcoindev+owners@googlegroups.com List-ID: X-Google-Group-Id: 786775582512 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-Spam-Score: -0.5 (/) --000000000000a21d3106618b5d0d Content-Type: text/plain; charset="UTF-8" Hello devs, In the process of moving BIP54 forward and converging (or not converging) on the proposed fixes brought by BIP54, it has arised from the consensus design conversation that the most controversial rule is the introduction of the outlaw of 64 byte transactions. With an aim of actively resolving the different viewpoints on the topic, this post briefly reminds the problem space underlying and justifying the new rule and present the solutions that are proposed, that have been proposed and their trade-offs [0]. Currently, BIP54 proposes the following modification to the Bitcoin network consensus rules: "transactions whose witness-stripped serialized size is exactly 64 bytes are invalid". Translated formally in code [1], in the contextual check block, if any transaction included a block is stripped of its witnesses and stripped of the BIP144 marker / flags, the whole block is marked as invalid for containing a 64 bytes transaction. Let's remind the initial problem solved [2]. The Merkle tree construction used by Bitcoin consensus rules presents few security weaknesses due to the lack of domain separation for the hashing of the internal nodes versus the tree leaves. In informal terms, an inner Merkle node is the hash of the concatenation of two 32-byte children hash while the leaf node is the hash of a serialized transaction. This weakness enables a malicious peer to announce to another target peer a valid block and that its Merkle root is a single canonical transaction, when in reality the serialization of the transaction is equal to the concatenation of two transactions [3]. If the single transaction is invalid the whole block is marked as invalid, as such it can be leveraged to trigger a netsplit. It is known that a (valid) node-to-transaction collision finding can be generalized to an arbitrary-size row of 64-byte (invalid) transactions, i.e beyond a 2-transaction block layout. However, due to the constraints on the structure of the coinbase it is informally deemed as not computationally feasible. To avoid exploitation of the first special case, bitcoin core node doesn't mark as permanently invalid any block validation, enabling as such a malleable block being rejected for a 2-txn-block-hashing-as-a-inner-node-deserializing to-an-invalid-64-byte-tx to be processed again with the valid transactions (learnt from an honest peer e.g). There is a transaction-to-node collision finding variant, where the idea is to find a valid transaction and make it appears as if it was a Merkle tree inner node, a valid 64-byte transaction being forced to be interpreted as the concatenation of two 32 byte (fake) transactions. This can be used to convince a SPV verifier, who is not aware about the depth of three to accept the fake transaction, as it was included in a block. The collision cost here is less expensive than for a block malleability. By outlawing any witness-stripped 64-byte transaction, BIP 54 design goal is to prevent any collision due to the lack of domain separation. Indeed, if any 64-byte transaction is made invalid the serialization of it cannot be used to collide with the (valid) inner node of a block, the transaction can be immediately rejected. While this does not remove all the cases of fake acceptance for a SPV verifier, the rule outlaws the attack scenario where a malicious peer would feed a fake transaction of which the hash would correspond to the last 32 bytes of a valid 64 byte transaction. Whatever the chain depth of the header, such a situation would be considered invalid. It has been argued that such generic outlawing rule would create a seam in bitcoin transaction processing, as now any contract protocol designer would not be able to create a construction leveraging 64-byte transaction, or that any wallet flow building collaborative transaction (e.g Lightning cooperative closure) have to mirror the changes and outlaw the new check. In my view a more restricted transaction seam as it has been proposed [4], comes with the fundamental disadvantage that it doesn't fully prevent transaction-to-node or node-to-transaction collision-finding, it only adds more constraints to increase the computational unfeasibility (however one has to note the proposal doesn't emphasize any collision-finding hardness analysis...). However, it sounds to me, intuitively, that a complete outlaw of the 64 byte structure makes the security analysis simpler, as one doesn't have to think about the trick to reduce the collision-space (as e.g any fields in the transaction structure of which the sum of the pair size are equally valid collisions). After reading again the whole design background on the 64 byte rule and the block or SPV proof malleability issues, in my humble opinion, outlawing as a whole 64-byte transactions sounds a simpler change. That's the change, of which the only measurable advantages sounds to be for SPV verifier is worthy of its own, is not further raised in the current post (of course one's view will be tainted in function of one usage of SPV proof for any protocol usage...). Overall, to present a digest of my viewpoint, of all the 4 consensus changes proposed by BIP54, it sounds that outlawing 64 byte transaction is the change for which the attack surface reduction fitness has been the less analyzed and the measurable concrete benefits for the ecosystem the more uncertain. My humble opinion only. Cheers, Antoine OTS hash: c8138d973f2403936ae6c3daa501e83342cd0cab04ce5d6d07485385c337842a PS: While synthetizing and writing this post, I realize it doesn't cover the arguments raised by evoskuil that only checking the structure correctness of the coinbase would be sufficient to assume computational infeasibility of the attacks ( https://groups.google.com/g/bitcoindev/c/CAfm7D5ppjo/m/MsOdTqYyCwAJ). IIRC, the viewpoint is that block invalid for this reason could be cached safely for invalidity, as it would be computationally feasible to malleate them. Those are good remarks, I might do a follow-up post on it (maybe). [0] As far as I know, in matters of bitcoin consensus changes, there is no social threshold or markers on when the subject of a proposed consensus change has been hashed out enough, and in fact given that consensus change is a dynamic process, in my view it's hard for one to exist. Still, sometimes it sounds necessary to bring back on the table the design rationale of a change and its trade-offs. If it doesn't enlighten the protocol experts, at least I see that a summary exposition can be valuable for the other stakeholders. [1] https://github.com/bitcoin/bitcoin/pull/35793/changes/1837129581b109a8c9f5f9a0f1ed9a882345cdb8 [2] https://gnusha.org/pi/bitcoindev/CAFp6fsGtEm9p-ZQF_XqfqyQGzZK7BS2SNp2z680QBsJiFDraEA@mail.gmail.com/2-BitcoinMerkle.pdf [3] The full collision-finding algorithm is not given in the 2018's "Weaknesses in Bitcoin's Merkle Root Construction" paper, yet one has to keep in mind that the two serialized transactions are _the preimage_ to find a rough 32-bit collision (less than 32-bit as there are pairs of valid solutions due to the scriptPubkey - scriptSig lengths reducing the collision space), as only 4 bytes fields must have a constrained value for a 64-byte transaction to be a valid transaction. [4] https://groups.google.com/g/bitcoindev/c/ZVDEzxG6Sq8/m/WFamT4oJAQAJ -- You received this message because you are subscribed to the Google Groups "Bitcoin Development Mailing List" group. To unsubscribe from this group and stop receiving emails from it, send an email to bitcoindev+unsubscribe@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/bitcoindev/CALZpt%2BEDAz86ac8iNHG3OsyU0tcpd3oHk8tqMpb354nrTcSKjQ%40mail.gmail.com. --000000000000a21d3106618b5d0d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello devs,

In the process of moving BIP54 forward = and converging (or not converging)
on the proposed fixes brought by BIP5= 4, it has arised from the consensus
design conversation that the most co= ntroversial rule is the introduction of
the outlaw of 64 byte transactio= ns. With an aim of actively resolving the
different viewpoints on the to= pic, this post briefly reminds the problem
space underlying and justifyi= ng the new rule and present the solutions that
are proposed, that have b= een proposed and their trade-offs [0].

Currently, BIP54 proposes the= following modification to the Bitcoin network
consensus rules: "tr= ansactions whose witness-stripped serialized size is
exactly 64 bytes ar= e invalid". Translated formally in code [1], in the
contextual chec= k block, if any transaction included a block is stripped
of its witnesse= s and stripped of the BIP144 marker / flags, the whole
block is marked a= s invalid for containing a 64 bytes transaction.

Let's remind th= e initial problem solved [2]. The Merkle tree construction
used by Bitco= in consensus rules presents few security weaknesses due to
the lack of d= omain separation for the hashing of the internal nodes versus
the tree l= eaves. In informal terms, an inner Merkle node is the hash of the
concat= enation of two 32-byte children hash while the leaf node is the hash
of = a serialized transaction.

This weakness enables a malicious peer to = announce to another target peer a
valid block and that its Merkle root i= s a single canonical transaction, when
in reality the serialization of t= he transaction is equal to the concatenation
of two transactions [3]. If= the single transaction is invalid the whole block
is marked as invalid,= as such it can be leveraged to trigger a netsplit.

It is known that= a (valid) node-to-transaction collision finding can be
generalized to a= n arbitrary-size row of 64-byte (invalid) transactions, i.e
beyond a 2-t= ransaction block layout. However, due to the constraints on the
structur= e of the coinbase it is informally deemed as not computationally feasible.<= br>
To avoid exploitation of the first special case, bitcoin core node d= oesn't
mark as permanently invalid any block validation, enabling as= such a malleable
block being rejected for a 2-txn-block-hashing-as-a-in= ner-node-deserializing
to-an-invalid-64-byte-tx to be processed again wi= th the valid transactions
(learnt from an honest peer e.g).

There= is a transaction-to-node collision finding variant, where the idea
is t= o find a valid transaction and make it appears as if it was a Merkle
tre= e inner node, a valid 64-byte transaction being forced to be interpretedas the concatenation of two 32 byte (fake) transactions. This can be used<= br>to convince a SPV verifier, who is not aware about the depth of three to=
accept the fake transaction, as it was included in a block. The collisi= on
cost here is less expensive than for a block malleability.

By = outlawing any witness-stripped 64-byte transaction, BIP 54 design goal
i= s to prevent any collision due to the lack of domain separation. Indeed,if any 64-byte transaction is made invalid the serialization of it cannot<= br>be used to collide with the (valid) inner node of a block, the transacti= on
can be immediately rejected.

While this does not remove all th= e cases of fake acceptance for a SPV
verifier, the rule outlaws the atta= ck scenario where a malicious peer
would feed a fake transaction of whic= h the hash would correspond to the
last 32 bytes of a valid 64 byte tran= saction. Whatever the chain depth
of the header, such a situation would = be considered invalid.

It has been argued that such generic outlawin= g rule would create a
seam in bitcoin transaction processing, as now any= contract protocol
designer would not be able to create a construction l= everaging 64-byte
transaction, or that any wallet flow building collabor= ative transaction
(e.g Lightning cooperative closure) have to mirror the= changes and outlaw
the new check.

In my view a more restricted t= ransaction seam as it has been proposed [4],
comes with the fundamental = disadvantage that it doesn't fully prevent
transaction-to-node or no= de-to-transaction collision-finding, it only adds
more constraints to in= crease the computational unfeasibility (however one
has to note the prop= osal doesn't emphasize any collision-finding hardness
analysis...). =

However, it sounds to me, intuitively, that a complete outlaw of th= e 64 byte
structure makes the security analysis simpler, as one doesn= 9;t have to think
about the trick to reduce the collision-space (as e.g = any fields in the
transaction structure of which the sum of the pair siz= e are equally valid
collisions).

After reading again the whole de= sign background on the 64 byte rule and
the block or SPV proof malleabil= ity issues, in my humble opinion, outlawing
as a whole 64-byte transacti= ons sounds a simpler change. That's the change,
of which the only me= asurable advantages sounds to be for SPV verifier is
worthy of its own, = is not further raised in the current post (of course
one's view will= be tainted in function of one usage of SPV proof for any
protocol usage= ...).

Overall, to present a digest of my viewpoint, of all the 4 con= sensus
changes proposed by BIP54, it sounds that outlawing 64 byte trans= action
is the change for which the attack surface reduction fitness has = been
the less analyzed and the measurable concrete benefits for the ecos= ystem
the more uncertain. My humble opinion only.
=C2=A0
Cheers,Antoine

OTS hash: c8138d973f2403936ae6c3daa501e83342cd0cab04ce5d6d= 07485385c337842a

PS: While synthetizing and writing this post, I rea= lize it doesn't cover
the arguments raised by evoskuil that only che= cking the structure correctness
of the coinbase would be sufficient to a= ssume computational infeasibility of
the attacks (https://groups.go= ogle.com/g/bitcoindev/c/CAfm7D5ppjo/m/MsOdTqYyCwAJ).
IIRC, the viewp= oint is that block invalid for this reason could be cached
safely for in= validity, as it would be computationally feasible to malleate
them. Thos= e are good remarks, I might do a follow-up post on it (maybe).

[0] A= s far as I know, in matters of bitcoin consensus changes, there is no
so= cial threshold or markers on when the subject of a proposed consensus
ch= ange has been hashed out enough, and in fact given that consensus changeis a dynamic process, in my view it's hard for one to exist. Still, so= metimes
it sounds necessary to bring back on the table the design ration= ale of a change
and its trade-offs. If it doesn't enlighten the prot= ocol experts, at least I
see that a summary exposition can be valuable f= or the other stakeholders.

[1] https= ://github.com/bitcoin/bitcoin/pull/35793/changes/1837129581b109a8c9f5f9a0f1= ed9a882345cdb8

[2] https://gnusha.org/pi/bitcoindev/CAFp6fsGtEm9p-ZQF_XqfqyQGzZK7B= S2SNp2z680QBsJiFDraEA@mail.gmail.com/2-BitcoinMerkle.pdf

[3] The= full collision-finding algorithm is not given in the 2018's "Weak= nesses
in Bitcoin's Merkle Root Construction" paper, yet one ha= s to keep in mind that
the two serialized transactions are _the preimage= _ to find a rough 32-bit collision
(less than 32-bit as there are pairs = of valid solutions due to the scriptPubkey -
scriptSig lengths reducing = the collision space), as only 4 bytes fields must have
a constrained val= ue for a 64-byte transaction to be a valid transaction.

[4] ht= tps://groups.google.com/g/bitcoindev/c/ZVDEzxG6Sq8/m/WFamT4oJAQAJ

--
You received this message because you are subscribed to the Google Groups &= quot;Bitcoin Development Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to bitcoind= ev+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/= msgid/bitcoindev/CALZpt%2BEDAz86ac8iNHG3OsyU0tcpd3oHk8tqMpb354nrTcSKjQ%40ma= il.gmail.com.
--000000000000a21d3106618b5d0d--