summaryrefslogtreecommitdiff
path: root/68/d259abea5e2d2820f6131b53be929f0105a92d
blob: 961ad9c690362d894096e2294d7ede0ab85df43e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
Return-Path: <pete@petertodd.org>
Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137])
 by lists.linuxfoundation.org (Postfix) with ESMTP id 8FAF9C002B
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Thu,  2 Feb 2023 11:22:30 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
 by smtp4.osuosl.org (Postfix) with ESMTP id 6A1B94196E
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Thu,  2 Feb 2023 11:22:30 +0000 (UTC)
DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 6A1B94196E
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=WUehJLDp
X-Virus-Scanned: amavisd-new at osuosl.org
X-Spam-Flag: NO
X-Spam-Score: -2.602
X-Spam-Level: 
X-Spam-Status: No, score=-2.602 tagged_above=-999 required=5
 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
 RCVD_IN_DNSWL_LOW=-0.7, 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 yk0k0unaw-pk
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Thu,  2 Feb 2023 11:22:28 +0000 (UTC)
X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0
DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 54A8541920
Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com
 [64.147.123.19])
 by smtp4.osuosl.org (Postfix) with ESMTPS id 54A8541920
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Thu,  2 Feb 2023 11:22:28 +0000 (UTC)
Received: from compute1.internal (compute1.nyi.internal [10.202.2.41])
 by mailout.west.internal (Postfix) with ESMTP id 7964D32007E8;
 Thu,  2 Feb 2023 06:22:24 -0500 (EST)
Received: from mailfrontend1 ([10.202.2.162])
 by compute1.internal (MEProxy); Thu, 02 Feb 2023 06:22:24 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc: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=1675336944; x=1675423344; bh=fDRx4Mbt0meFMTCdSbBkMBX/pXzV
 pI5o80ruBGynL8I=; b=WUehJLDpO9uSVS/sKRgATE3P1Dcn+NJgPClmvl4/Xe9r
 CvaQciRFKnnl99nruht0EfDu9DSTD1agb6AvfjHqIMDczCi6Yze4X6sEhH58ucXI
 IK8/AgkaMrF08GwD/w8JikO+xACD60LCF2bVaLOba1pJnw8/NBKNCSQUxdL94M9H
 FqVHrsCy7A/MyaoVUY5Aut6SbUbEZDDv422iClw9RWkh/JMqyG96gqoZJUmeYfX8
 WCNPOwo00lzKHvviO4e1gjNu9Ev872CCVB6dEhxWABK4HtAQ+1huw1BGeRg6h9P5
 99pYTxgDw8CAuQMFSi8p2z4Eh1kwQxdUWgIAFacUxw==
X-ME-Sender: <xms:75zbY-Y45cizmW_cux2fX4lk8x45HPfQhDREWtcddo58QS9bBRdSZQ>
 <xme:75zbYxb6tarY-sc8EmyZwuOvyOEFa9UESEHvl8RNt3XHQaGbYMv79dQ_3phPO9gOI
 nGjSznsSLuiMg3iwIo>
X-ME-Received: <xmr:75zbY4-X08V9mh1aIoLZsFXWdxIZ_P97-lnm8QhaxtFWcgszQ6_9Uiba2aWX>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudefkedgvdeiucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvdenucfhrhhomheprfgvthgv
 rhcuvfhougguuceophgvthgvsehpvghtvghrthhouggurdhorhhgqeenucggtffrrghtth
 gvrhhnpeelvdellefftddukeduffejgfefjeeuheeileeftdfgteduteeggeevueethfej
 tdenucffohhmrghinhepphgvthgvrhhtohguugdrohhrghenucevlhhushhtvghrufhiii
 gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpvghtvgesphgvthgvrhhtohguugdr
 ohhrgh
X-ME-Proxy: <xmx:75zbYwpu-VPkLIzf-BKYPfjd3n0AOJGgsc5frB-x8PeAYnvTQPNIGA>
 <xmx:75zbY5qajDN4J_Pz8WzFnETpdLKzSRUCsfmTryk5gTAydIuXUETe3w>
 <xmx:75zbY-TLotirBF6OGcRBU1Trzp533o0d0W-2yYR-4pyacDERL1smLA>
 <xmx:8JzbY6mh7g9JH9N1Z_WBW7HCgLLZPgNH5A_A5Bpu0faTssC1cylLKQ>
Feedback-ID: i525146e8:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu,
 2 Feb 2023 06:22:23 -0500 (EST)
Received: by localhost (Postfix, from userid 1000)
 id B5E895F824; Thu,  2 Feb 2023 06:22:23 -0500 (EST)
Date: Thu, 2 Feb 2023 06:22:23 -0500
From: Peter Todd <pete@petertodd.org>
To: Andrew Poelstra <apoelstra@wpsoftware.net>
Message-ID: <Y9uc72RSs6LQojG4@petertodd.org>
References: <CACrqygAMsO1giYuxm=DZUqfeRjEqGM7msmEnZ-AHws3oA2=aqw@mail.gmail.com>
 <764E460B-C0C6-47B8-A97E-F7CBC81FD645@petertodd.org>
 <Y9pxAdm3kO1rr2kU@camus>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
 protocol="application/pgp-signature"; boundary="y38CCmU2HZ6kL8N5"
Content-Disposition: inline
In-Reply-To: <Y9pxAdm3kO1rr2kU@camus>
Cc: Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org>
Subject: Re: [bitcoin-dev] Debate: 64 bytes in OP_RETURN VS taproot OP_FALSE
 OP_IF OP_PUSH
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: Thu, 02 Feb 2023 11:22:30 -0000


--y38CCmU2HZ6kL8N5
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Feb 01, 2023 at 02:02:41PM +0000, Andrew Poelstra wrote:
> On Tue, Jan 31, 2023 at 09:07:16PM -0500, Peter Todd via bitcoin-dev wrot=
e:
> >=20
> >=20
> > On January 31, 2023 7:46:32 PM EST, Christopher Allen via bitcoin-dev <=
bitcoin-dev@lists.linuxfoundation.org> wrote:
> > >All other things being equal, which is better if you need to place a
> > >64-bytes into the Bitcoin blockchain? A traditional OP_RETURN or a spe=
nt
> > >taproot transaction such as:
> > >
> > >OP_FALSE
> > >OP_IF
> > >OP_PUSH my64bytes
> > >OP_ENDIF
> >=20
> > What's wrong with OpPush <data> OpDrop?
> >
>=20
> This is a technical nit, but the reason is that <data> is limited to 520
> bytes (and I believe, 80 bytes by standardness in Taproot), so if you
> are pushing a ton of data and need multiple pushes, it's more efficient
> to use FALSE IF ... ENDIF since you avoid the repeated DROPs.

Yes, for more than 520 bytes you need to wrap the push in an IF/ENDIF so it=
's
not executed. But in this example we're just talking about 64 bytes, so that
limit isn't relevant and OpPush <data> OpDrop should be sufficient.

Specifically for more than 520 bytes you run into the the
MAX_SCRIPT_ELEMENT_SIZE check in script/interpreter.cpp, which applies to a=
ll
scripts regardless of standardness at script execution:

           //
           // Read instruction
           //
           if (!script.GetOp(pc, opcode, vchPushValue))
               return set_error(serror, SCRIPT_ERR_BAD_OPCODE);
           if (vchPushValue.size() > MAX_SCRIPT_ELEMENT_SIZE)
               return set_error(serror, SCRIPT_ERR_PUSH_SIZE);

--=20
https://petertodd.org 'peter'[:-1]@petertodd.org

--y38CCmU2HZ6kL8N5
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEE0RcYcKRzsEwFZ3N5Lly11TVRLzcFAmPbnO0ACgkQLly11TVR
LzeTgRAAh4KEOfcl1rst/9v1R2MGReWITXP7hRzZVJwm/ZloG/cNVRxETjnXIfKK
SCbW5SDV0PMM2qSBKbOCze1FyrMfmYYeD1Nvh/ExIiBByBdGHbbvfmIuJg75xyZp
hHF1+V5g3oyvJSZyhl5nbvfwkhUxpu6WxiLNh7OeoMiWz+yvmtrzaVgCp4FGwcle
1kJnUY50LiVuKVx916vTTVN2QKkfYjz0CQQBZVuWddpt2GVmldXjNucRJk/iAiK+
xKjizjthwRYMDUhfOooFuEf6MobJP2GSMYSJFYXR+6QxxAcz1zvD4oIVF3ISyyRk
Q0Apr55sH0U4XQInAAT4LvwZD1WqoZ9v2qw196empAaFPcAK9DnxDEaa66GjXbO1
blUpZdhpcZPbXZid+/0wmpg4RN3BGnRA3SVQ+euPdgqmGZML77icLAq9MB31ftdh
0q/Lpc7JKVdG1kqGzwrioWa0/QnDtk/3OuqAzpBW9/4RSTN50OxqWsuCRtpx2YE5
NeDfrkUFPsYHkpH3D/MBoU/qI2w3kIfWeiQO+v+cjchRpM+33jFpKF7RSyJegdSm
dAn74QpqMCJfrfImEtjlTsVIkvajLg478ANbVXpiu/N4L9VkV8uB+N+dyw8jyMEp
xt/MZ/eRL3G7ruNh9UHwA0nyvFgMk6j2FyXt0ATxcsgYt1RwZpE=
=K8SR
-----END PGP SIGNATURE-----

--y38CCmU2HZ6kL8N5--