From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Mon, 22 Jun 2026 07:28:01 -0700 Received: from mail-oo1-f56.google.com ([209.85.161.56]) by mail.fairlystable.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1wbfd2-0004iY-LO for bitcoindev@gnusha.org; Mon, 22 Jun 2026 07:28:01 -0700 Received: by mail-oo1-f56.google.com with SMTP id 006d021491bc7-6a0c02365c7sf8033335eaf.2 for ; Mon, 22 Jun 2026 07:28:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1782138474; cv=pass; d=google.com; s=arc-20240605; b=l3P4aKSeBQMTyG+G8k0WCqsBXyVmQ/iErg+Img9vhj3EB+YEpNPOWbQ8vzBsoQqnj7 f5vCr2xy5xcIxymDe438/K6WK5/7kelfYTRzQYTmibqGi2od8CYsXiSEY53CAKz5KNwN GBWCvLQEybKsdglWsvgeL6czItbq9LQSyONN3bBrzwfIX6tr2VI8HNi2cBNI9Mks3RuB lcJ0kl1mN8nToLDluePVwEXM3vgemicjdQnbFE/O7i9aR+YSOyIWcPpmsT1Wd77DDGYu GXRRhX+ruXW/CdeVTjS7/LDCW8jSB1K5whtedfAme9zYXn7snGZPiEghfsahgI4H8Xrd yQ9Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:feedback-id:sender:dkim-signature; bh=YNkJ9naKOn6Swi3AhuaQz6Ak0ZjcEc4l1miL19vpep8=; fh=IqEC796TvsiaiD26meIryTt7f8AMxCsM2rxAbL0PULo=; b=kctGKVxMgQJFOZNoxBVP7DcB/lMM3GMu8WtXWAysJdEgPrKwte9RU1qN2WiUlHkzob jAY96a7AkEUakvffFiefHfswUj6i8fpIzlt8bMN53F9DvIdnmZyLbzIB9TAf/evbHblr Bpgou/lW/Hd7HPCDOnmkawTg06V+ZjcG/qnIw0Qgg/2L4/BVubxy1NFoxy/oIvAXl7sa oJa/d+J5K2+9302HFnlvSKn7MLeL8NYB7pg2MvoDOYgwYTO9ibvqQMU4Zpb7Dd1z8yXe ITYQ6zdCY7nqDs51VPNacJp65SJ4ZsmhxERA7ifTYaIm/lWn2vp66Ykiir7L5BSYHATD 890w==; darn=gnusha.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@sprovoost.nl header.s=fm2 header.b=GJHIUGFp; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=HjybB9RE; spf=pass (google.com: domain of sjors@sprovoost.nl designates 103.168.172.154 as permitted sender) smtp.mailfrom=sjors@sprovoost.nl; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sprovoost.nl DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20251104; t=1782138474; x=1782743274; 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:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:feedback-id:sender:from:to:cc:subject:date:message-id :reply-to; bh=YNkJ9naKOn6Swi3AhuaQz6Ak0ZjcEc4l1miL19vpep8=; b=MnATXY77w8QCWzuP3x/A5CE9xlFeFilWBLUcIpChtL7ZbjTQMJL96yESRAPbQC9eNO EZ0LChg6KtC1r477QxZAUC6iF9B6PrPdeNCyU/4YG7zikDstapho4qRuiSw2kp6EteQX olNlGM3KckLDQcenxlKoM+jhFjViQ+WI0BGfAcovZVKutgZezjXvoeiV7s6/PJAUwHYN QdPEqSfai6kGINYQGzEkJus0fDdkTIgAkaOWiUvIk1GNHs+nV5TTS5U/YKU9k2VrWOF4 al1UJETQwrtkpaGJ5FMRMOdAl+/ynESwaZlMSVLILxZMCDMtlo8QNMeujF9T8qmD+zlV 8cEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782138474; x=1782743274; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:feedback-id:x-beenthere:x-gm-message-state:sender:from :to:cc:subject:date:message-id:reply-to; bh=YNkJ9naKOn6Swi3AhuaQz6Ak0ZjcEc4l1miL19vpep8=; b=aczT2bUjA9I4c2hpN6kBxbzpw/Ka4LwmUGCdGOL+uqGnLBmLW1AE7AopRZxj5QYT6p E/mGMBuFz0TfYhN7uTzI2QaHZ0N9nykR4BS0tS4ivt7z0Ozop7THobvRTOKCeWOTSDFj V8GcCMUXH5HUu30EkjTpeg28qrfv0mCI+JV3UsaL67yyYZ95jRXBDnehNvle4L2S/GXf x5sl6jCDreNCyOwIAFzhmhtHIEjlUpyrsEwH/WUzXK6e0nq4fIZzs9WsuJHuBpO5fP5h 7zdMmuuarheVs/B12gtmm/6qjOzWP1dSEaqaD/8Yivyxu4NZYhNF3EiMWMBSAocAQUkA 9yGQ== Sender: bitcoindev@googlegroups.com X-Forwarded-Encrypted: i=2; AFNElJ++65UeB6tkkL72eDTpQH8DviDkwt2VGYHqIZWYs+cOTO952S66IBKnbb4oENyzRC2HKOtjhipsAcvW@gnusha.org X-Gm-Message-State: AOJu0YwsgIZMZHjb+AlsRywNMT8luDGiQa7ZkColRqKP7ynpyhCKDnFG 1UH6LX+dQv541/6PtRksVNHSI66oXHo7bGcbv4NLSc4g+kjw1H4waQev X-Received: by 2002:a05:6820:f027:b0:6a1:108b:520f with SMTP id 006d021491bc7-6a1108b54camr443457eaf.46.1782138474332; Mon, 22 Jun 2026 07:27:54 -0700 (PDT) X-BeenThere: bitcoindev@googlegroups.com; h="AX0PUUdP2eH9uR/94IoYi3GhLZDg4M+Us4N1eUlKc/KPnbZLFA==" Received: by 2002:a05:6820:1844:b0:69e:4f4:852d with SMTP id 006d021491bc7-6a0c661aa84ls2374268eaf.0.-pod-prod-09-us; Mon, 22 Jun 2026 07:27:49 -0700 (PDT) X-Received: by 2002:a05:6808:c2a8:b0:485:11d1:303 with SMTP id 5614622812f47-4896aa550e5mr13176542b6e.12.1782138469439; Mon, 22 Jun 2026 07:27:49 -0700 (PDT) Received: by 2002:ae9:f814:0:b0:8f9:4d19:af67 with SMTP id af79cd13be357-92066e71e86ms85a; Mon, 22 Jun 2026 07:25:17 -0700 (PDT) X-Received: by 2002:a05:622a:480f:b0:519:51af:febd with SMTP id d75a77b69052e-519e4c8d519mr217568311cf.46.1782138314442; Mon, 22 Jun 2026 07:25:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1782138314; cv=none; d=google.com; s=arc-20260327; b=cBEK6EBNo2ccYe+Vwgu7uMcH7nZqvb6Bvm3kn9G+0SVIp6tzkBXNJ47UYpl3DCM1M+ ChLRB7EbiVBJizdpl9o5bXutpXwx/XlYvlMqV5ezXBf7bwBjXZiIoCodDmlGpNo2w/oo uM3WhhI61bDzgCWaRfvoaqg3N2XRTN/KBZXM7hPwHFugJw11jmGAwqnTvymhJzCHAU1g m/g18wQWG852/hrfQd0hIY/aEeBEo2PgP6+VC67UPsYaZYUB0P1LUs0kyByFO0NIFRqt b5JDunMYafLbXwzKUQbRvL/XUCb3cidTqtnnTaiaUoam/8eeYTafgjmRdzu3/QcX97EF Tqag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:feedback-id:dkim-signature :dkim-signature; bh=S68NrWR1LlhJ3XNurF/xbtXGXqp9On+LHsFMGoJmo00=; fh=5S/jfVmsXabSuVZCdr5/TKb4Iyrsa8r71aC2XbPJsUA=; b=CJ6zJCKSHZmKFvKq4Deo/7i4dnFDJLpm0UP/mguHwGEwWyLTwx4YzWiPBMG3TjEwxL ELYGIIPqdlVR7/9KotMaUFnhuhFo4LQOl8G1wriQIVfPt2a+w/3VXDb3OjpgQlnItLXs FjYa79WI1Q/sbxqmU+bgZqZuAeyk7O0+DrRDijTI0KHuFItZmrYkz4m6Wl2mti6r0NKp BI7tsmlTZuxYXCFHI5O2zsh9UbgQNLDHOsscB0VhC++kgND+yIvWhO5HJRv4iET7Vkag OUXuXgpIUGNyvWxYQg+3foocco/mtPB5a70MQf6NqDdWEpbMmxH3Zf6zcpaeXhwP3AdN AGQQ==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@sprovoost.nl header.s=fm2 header.b=GJHIUGFp; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=HjybB9RE; spf=pass (google.com: domain of sjors@sprovoost.nl designates 103.168.172.154 as permitted sender) smtp.mailfrom=sjors@sprovoost.nl; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sprovoost.nl Received: from fhigh-a3-smtp.messagingengine.com (fhigh-a3-smtp.messagingengine.com. [103.168.172.154]) by gmr-mx.google.com with ESMTPS id d75a77b69052e-51a098322f6si1934071cf.6.2026.06.22.07.25.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2026 07:25:14 -0700 (PDT) Received-SPF: pass (google.com: domain of sjors@sprovoost.nl designates 103.168.172.154 as permitted sender) client-ip=103.168.172.154; Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfhigh.phl.internal (Postfix) with ESMTP id D76951400114; Mon, 22 Jun 2026 10:25:13 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Mon, 22 Jun 2026 10:25:13 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTGTBy5zV/GhMzxKwmNSfnDa5cwbZuKFtFzMSAn72k85X2uoB5qBsJNyRmedS9PSso kKT2+3p3+UaucvfkZQS6bt9gPrKixnoze2j3S+AYnThza+ftxaNMFRYH8uRreWA+2auWCo STGb8siUT9C4e5wzjxrHbBCsevryVBT7DBYlxE6Rk/nOycyENqYRuptYmej0biR6IM40An ObT/CEs6MWE/vQcZ9IUYHn+mZ83dGLkV2Wp1pebKo5hhnD+9PW16wd5/FjdFv+ZT88mTT7 GOdYObKFIikBaUMWpualoLnrM7av1QRvG5nMhXCL/OfjpjxxW6UQwHqEy/Z9AQX7bCz6HC tdWdSwaABV14iBg3X5GU8Lq8iVBSkSicVcs0t1UMfIvrRI+flqeptibuTMjdhv+KaobTGT qknzLFEdJOTxJDLQ4yTTt4Bq1oWr3MA9g9oGt+IZvDHUHf6j3rRWlZ/xDpxbefYKuqzkq9 cXeiGkkVyP7MWfNuy5gI0p+2L429lL9fMVJFDfkUQxOUpvK4it1JzFSm+4dqtkpoY1XbTA r1F/0r/3cfxd/lBUxFuNnllKVhIt/dxsGN9D9XqEH8j37r8KTfsERECel3alX0epkuZjrz nkeFMiCedenDqmx0j9bQcmTfZc2/7fczuO9qYg4EgzigwqQVRJTic5QYvwVg X-ME-Proxy: Feedback-ID: ie5e042df:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 22 Jun 2026 10:25:13 -0400 (EDT) Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.600.51.1.1\)) Subject: Re: [bitcoindev] Prohibit Merkle Internal Node Preimages That Encode Minimal 64-Byte Transactions From: Sjors Provoost In-Reply-To: Date: Mon, 22 Jun 2026 16:25:01 +0200 Cc: jeremy Content-Transfer-Encoding: quoted-printable Message-Id: <8FEEF72A-92A3-48A9-AC49-43107D17B090@sprovoost.nl> References: To: Bitcoin Development Mailing List X-Mailer: Apple Mail (2.3864.600.51.1.1) X-Original-Sender: sjors@sprovoost.nl X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@sprovoost.nl header.s=fm2 header.b=GJHIUGFp; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=HjybB9RE; spf=pass (google.com: domain of sjors@sprovoost.nl designates 103.168.172.154 as permitted sender) smtp.mailfrom=sjors@sprovoost.nl; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sprovoost.nl 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.8 (/) > Op 1 jun 2026, om 19:46 heeft jeremy het volge= nde geschreven: >=20 > Esteemed Colleagues, > As a result of some of my research on 64-byte transactions, I'd like to d= iscuss an alternative soft fork proposal that preserves the ability to enco= de 64-byte transactions while offering protection to SPV users (who must ma= ke a small patch to validate the path property). > The rule, stated simply, is: > A block is invalid if any Merkle Tree 64-byte preimage has the exact byte= structure of a minimal one-input, one-output, witness stripped transaction= . > [With the miracle of GPT,] I've drafted a relatively complete BIP for dis= cussion. I like the idea of fixing the problem as close to the (merkle, haha) root o= f the problem. But is there a more elegant and succinct way to implement Is= ForbiddenMerkleInternalNodePreimage64? Otherwise I prefer to wait 80 years for a proper fix, rather than add this = complexity to consensus code. Even if we can't have the 64 byte exception (= which I still prefer). After 2106, the fix can be a simple tweak to the leaf hash calculation: if (!hardfork) return tx.getHash().ToUint256(); // Fix Merkle tree, and drop the separate witness commitment by committing // witness data directly in the transaction Merkle tree. return (HashWriter{TaggedHash("TaggedWtxid")} << TX_WITH_WITNESS(tx)).GetSH= A256(); Here's a rough sketch: https://github.com/Sjors/bitcoin/tree/2026/06/merkle The upgrade mechanism isn't important in this context, but I implemented th= e following rules: 1. a new header format, growing timestamp from 32 to 64 bits - mask one byte to use for nonce space, if we think two billion years is = enough 2. the block version must be negative, if and only if it uses the new heade= r format - let's the header/block deserialiser know in the first 4 bytes how long = the header is=20 - current nodes will reject such blocks, because BIP34 deployment burned = nVersion < 2 - therefore it's not used for signalling or nonce grinding - no historical blocks have a negative version 3. new headers must have timestamp >=3D 2^32=20 - makes it a clean break both ways - maybe require old headers can't connect to a new header - Sjors > static bool IsForbiddenMerkleInternalNodePreimage64(const unsigned char p= [64]) > { > // Minimal 64-byte legacy transaction shape: > // > // 4 bytes nVersion > // 1 byte vin count =3D 0x01 > // 36 bytes prevout > // 1 byte scriptSig length =3D x > // x bytes scriptSig > // 4 bytes nSequence > // 1 byte vout count =3D 0x01 > // 8 bytes nValue > // 1 byte scriptPubKey length =3D y > // y bytes scriptPubKey > // 4 bytes nLockTime > // > // Since the fixed overhead is 60 bytes, x + y must equal 4. >=20 > if (p[4] !=3D 0x01) { > return false; > } >=20 > const unsigned int x =3D p[41]; >=20 > switch (x) { > case 0: > if (p[46] !=3D 0x01) return false; > if (p[55] !=3D 0x04) return false; > break; >=20 > case 1: > if (p[47] !=3D 0x01) return false; > if (p[56] !=3D 0x03) return false; > break; >=20 > case 2: > if (p[48] !=3D 0x01) return false; > if (p[57] !=3D 0x02) return false; > break; >=20 > case 3: > if (p[49] !=3D 0x01) return false; > if (p[58] !=3D 0x01) return false; > break; >=20 > case 4: > if (p[50] !=3D 0x01) return false; > if (p[59] !=3D 0x00) return false; > break; >=20 > default: > return false; > } >=20 > const size_t value_pos =3D 47 + x; > const uint64_t raw_value =3D ReadLE64(p + value_pos); >=20 > if (raw_value > static_cast(std::numeric_limits::m= ax())) { > return false; > } >=20 > const int64_t nValue =3D static_cast(raw_value); >=20 > if (!MoneyRange(nValue)) { > return false; > } >=20 > return true; > } >=20 >=20 --=20 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 e= mail to bitcoindev+unsubscribe@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/bitcoindev/= 8FEEF72A-92A3-48A9-AC49-43107D17B090%40sprovoost.nl.