summaryrefslogtreecommitdiff
path: root/bc/6bd3ae82e98bebd7448cd87f56e86ad62b3d36
blob: eced263c40ce1d4675da097efe58913e3130c7d4 (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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
Return-Path: <rsomsen@gmail.com>
Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138])
 by lists.linuxfoundation.org (Postfix) with ESMTP id 5FA07C0011
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Thu, 24 Feb 2022 14:02:13 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
 by smtp1.osuosl.org (Postfix) with ESMTP id 3F06A82C1E
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Thu, 24 Feb 2022 14:02:13 +0000 (UTC)
X-Virus-Scanned: amavisd-new at osuosl.org
X-Spam-Flag: NO
X-Spam-Score: -0.856
X-Spam-Level: 
X-Spam-Status: No, score=-0.856 tagged_above=-999 required=5
 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
 DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 HTML_MESSAGE=0.001, NUMERIC_HTTP_ADDR=1.242,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
 autolearn=ham autolearn_force=no
Authentication-Results: smtp1.osuosl.org (amavisd-new);
 dkim=pass (2048-bit key) header.d=gmail.com
Received: from smtp1.osuosl.org ([127.0.0.1])
 by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id LNp2I8ThXN26
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Thu, 24 Feb 2022 14:02:12 +0000 (UTC)
X-Greylist: whitelisted by SQLgrey-1.8.0
Received: from mail-yw1-x1132.google.com (mail-yw1-x1132.google.com
 [IPv6:2607:f8b0:4864:20::1132])
 by smtp1.osuosl.org (Postfix) with ESMTPS id 3AD4E83381
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Thu, 24 Feb 2022 14:02:12 +0000 (UTC)
Received: by mail-yw1-x1132.google.com with SMTP id
 00721157ae682-2d646fffcc2so26355967b3.4
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Thu, 24 Feb 2022 06:02:12 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=mc4eEIvtGsTYPTINRO47QWaC7WnfowMYFhA8yImO1LE=;
 b=l2EsDn2neL0jfVQjZHcGVoXT35LqOZnVVGkUz44nTVQv8xAk92r37jpo7/z95Q7Cmo
 y2BMP4+Km0dSs5XwH9knot/v8tLn+bSGcIJQ2O+cQ7erUQyzIMuBNH/EZB8uSQfmHwBF
 wD35LDXYEpUM3iISu1Pc5BlgCx6hYmMtrpfbyfSSs6XUcxf1O/9UqzBKNYswsCwyrxT9
 I31J6/Y+i7ePZ3seUwpaYnPFGndj0onMcNuhZuzFJ92jKMsMQHMpfIGX6AzG23FCJSBm
 DVlOlAILY6B735nfZ7u/sFk6Yw0JIMi53y/yhcR6Etqwl/Yo4P/ZC1IN0N7lZcNq14RA
 q6OA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=mc4eEIvtGsTYPTINRO47QWaC7WnfowMYFhA8yImO1LE=;
 b=1HhpIiyDIljko4sf5PROzPZb42VyRr29qmz/01KxrOAmCB9hOatpZBX2zyeXXf5hHF
 +YQ1p7HI9cCLe2HQCPaXymJThlx4P5i89RNXuN+Wto4p+cLgEH014b5kGbaCCtJBPYzw
 sf1ZtJ4YgHs08HNA3Gtg5Qa0QzYMTD67evJm+Il4YJ9mEigFnD3vVCbP2cpdopGFtG6v
 Nrdx9c8A5bMHqLXbGsT/Tct4spi+yZ2oV/1R5rMg5PEEYDFADiRA3WCyE7qyujTMywQ6
 PiaQmHjZ0zIVAfZxZwFCTp30LKUQ8Y8Txeb9pBfiS1JKQkpxwCm41TOwt23gcGzYdK/s
 hvjA==
X-Gm-Message-State: AOAM530E+sI5oQd70etezrshkBrLzV5PMk/pyRR0yH9im511YlZ+/ofD
 tgdjFcKFxZy37rQ+OKtFbS+b2enxszsWSJsGyhjjMPuB
X-Google-Smtp-Source: ABdhPJzF8P7Kq4hn6X2BkQcZfcjn0CUAXSqxT/C3RecxitusCoUJ0wLRB9jK3DNcZZYAK9nl/8O/JgYUTrv835c5zaU=
X-Received: by 2002:a81:7094:0:b0:2d1:9e5:1288 with SMTP id
 l142-20020a817094000000b002d109e51288mr2467252ywc.283.1645711331129; Thu, 24
 Feb 2022 06:02:11 -0800 (PST)
MIME-Version: 1.0
References: <CAPv7TjaY51PpA++xv5g+d6RwMOz+P4+rxSOeziGvdt_g6__05Q@mail.gmail.com>
 <132554114-6b0ae655e1150c240f98f8f865924478@pmq8v.m5r2.onet>
In-Reply-To: <132554114-6b0ae655e1150c240f98f8f865924478@pmq8v.m5r2.onet>
From: Ruben Somsen <rsomsen@gmail.com>
Date: Thu, 24 Feb 2022 15:01:58 +0100
Message-ID: <CAPv7TjYnzUE=pBFH9UPwvbqT+DEZEVuuNWJqbNjsEKM5Tdz0bQ@mail.gmail.com>
To: vjudeu <vjudeu@gazeta.pl>
Content-Type: multipart/alternative; boundary="0000000000004b7b0a05d8c4077f"
X-Mailman-Approved-At: Thu, 24 Feb 2022 14:06:43 +0000
Cc: Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org>
Subject: Re: [bitcoin-dev] OP_RETURN inside TapScript
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, 24 Feb 2022 14:02:13 -0000

--0000000000004b7b0a05d8c4077f
Content-Type: text/plain; charset="UTF-8"

In Q = P + hash(P||commitment)G you cannot spend from Q without knowing
both the private key of P as well as the commitment (i.e. 32 bytes,
assuming the commitment itself is another hash). This is generally not a
problem for tapscript, as the scripts are deterministically generated (i.e.
backing up the policy once is sufficient), but what you are suggesting is
not deterministic. Hope that clarifies things.

On Thu, Feb 24, 2022 at 2:27 PM <vjudeu@gazeta.pl> wrote:

> > Also, tweaking an ECC point (this includes tapscript) in
> non-deterministic ways also makes it harder to recover from backup, because
> you can't recover the key without knowing the full commitment.
>
> I don't think so. You can spend coins from taproot by key or by script. If
> you spend by key, making backup is simple, we have WIF for that. If you
> spend by script, you only need a part of the tree. So, you can "recover the
> key without knowing the full commitment", because you can spend coins
> "without knowing the full commitment". On-chain, you never reveal your
> "OP_RETURN <data>" or "OP_RETURN <hash>" or "<tapbranch> <tapbranch>
> <tapbranch> OP_RETURN <chunk_of_data>". Those additional branches are
> stored only by those who wants their data to be connected with some key,
> knowing the full script is not needed, because it is not needed for
> on-chain validation.
>
> > Furthermore, the scheme is not actually equivalent to op_return, because
> it requires the user to communicate out-of-band to reveal the commitment,
> whereas with op_return the data is immediately visible (while not popular,
> BIP47 and various colored coin protocols rely on this).
>
> Yes, but storing that additional data on-chain is not needed. It is
> expensive. By paying one satoshi per byte, you would pay 0.01 BTC for
> pushing 1 MB of data. That means 1 BTC for 100 MB of data, so 15 BTC for
> that 1.5 GB file. And in practice it is the absolute minimum, because you
> have to wrap your data somehow, you cannot just push 1.5 GB file. By
> placing that in TapScript, you can use your taproot public key as usual and
> attach any data into your key for "free", because it takes zero additional
> bytes on-chain.
>
> On 2022-02-24 11:08:39 user Ruben Somsen <rsomsen@gmail.com> wrote:
>
> Note this has always been possible, and is not specifically related to
> tapscript. As long as you're committing to an ECC point, you can tweak it
> to commit data inside it (i.e. pay-to-contract). This includes P2PK and
> P2PKH.
>
> Committing to 1.5GB of data has equally been possible with OP_RETURN
> <hash>, or even an entire merkle tree of hashes, as is the case with Todd's
> opentimestamps.
>
> Also, tweaking an ECC point (this includes tapscript) in non-deterministic
> ways also makes it harder to recover from backup, because you can't recover
> the key without knowing the full commitment.
>
> Furthermore, the scheme is not actually equivalent to op_return, because
> it requires the user to communicate out-of-band to reveal the commitment,
> whereas with op_return the data is immediately visible (while not popular,
> BIP47 and various colored coin protocols rely on this).
>
> Cheers,
> Ruben
>
>
> On Thu, Feb 24, 2022 at 10:19 AM vjudeu via bitcoin-dev <
> bitcoin-dev@lists.linuxfoundation.org
> <http://../NowaWiadomosc/Do/QlIkBFQ6QUFhIVRZX192dnQBeCtCchE6GhA5LFpLCUc7EVZQVl9dQRIXXR8NCBMbCwIGChJXQFxcXEgcFh8UVVVDEyBdVkE9JVRdEwFhYXVlblhVIkosEAszLR5BQVV7U0MID0BAQUgIGh0RHgAMGAMXBQJfW1sdXRQUQUoDQlAiBFY8>>
> wrote:
>
>> Since Taproot was activated, we no longer need separate OP_RETURN outputs
>> to be pushed on-chain. If we want to attach any data to a transaction, we
>> can create "OP_RETURN <anything>" as a branch in the TapScript. In this
>> way, we can store that data off-chain and we can always prove that they are
>> connected with some taproot address, that was pushed on-chain. Also, we can
>> store more than 80 bytes for "free", because no such taproot branch will be
>> ever pushed on-chain and used as an input. That means we can use "OP_RETURN
>> <1.5 GB of data>", create some address having that taproot branch, and
>> later prove to anyone that such "1.5 GB of data" is connected with our
>> taproot address.
>>
>> Currently in Bitcoin Core we have "data" field in "createrawtransaction".
>> Should the implementation be changed to place that data in a TapScript
>> instead of creating separate OP_RETURN output? What do you think?
>> _______________________________________________
>> bitcoin-dev mailing list
>> bitcoin-dev@lists.linuxfoundation.org
>> <http://../NowaWiadomosc/Do/QlIkBFQ6QUFhIVRZX192dnQBeCtCchE6GhA5LFpLCUc7EVZQVl9dQRIXXR8NCBMbCwIGChJXQFxcXEgcFh8UVVVDEyBdVkE9JVRdEwFhYXVlblhVIkosEAszLR5BQVV7U0MID0BAQUgIGh0RHgAMGAMXBQJfW1sdXRQUQUoDQlAiBFY8>
>> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>
>

--0000000000004b7b0a05d8c4077f
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">In Q =3D P=C2=A0+ hash(P||commitment)G you cannot spend fr=
om Q without knowing both the private key of P as well as the commitment (i=
.e. 32 bytes, assuming the commitment itself is another hash). This is gene=
rally not a problem for tapscript, as the scripts are deterministically gen=
erated (i.e. backing up the policy once is sufficient), but what you are su=
ggesting is not deterministic. Hope that clarifies things.</div><br><div cl=
ass=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Thu, Feb 24, 2=
022 at 2:27 PM &lt;<a href=3D"mailto:vjudeu@gazeta.pl">vjudeu@gazeta.pl</a>=
&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px =
0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div=
>&gt; Also, tweaking an ECC point (this includes tapscript) in non-determin=
istic ways also makes it harder to recover from backup, because you can&#39=
;t recover the key without knowing the full commitment.<br><br>I don&#39;t =
think so. You can spend coins from taproot by key or by script. If you spen=
d by key, making backup is simple, we have WIF for that. If you spend by sc=
ript, you only need a part of the tree. So, you can &quot;recover the key w=
ithout knowing the full commitment&quot;, because you can spend coins &quot=
;without knowing the full commitment&quot;. On-chain, you never reveal your=
 &quot;OP_RETURN &lt;data&gt;&quot; or &quot;OP_RETURN &lt;hash&gt;&quot; o=
r &quot;&lt;tapbranch&gt; &lt;tapbranch&gt; &lt;tapbranch&gt; OP_RETURN &lt=
;chunk_of_data&gt;&quot;. Those additional branches are stored only by thos=
e who wants their data to be connected with some key, knowing the full scri=
pt is not needed, because it is not needed for on-chain validation.<br><br>=
&gt; Furthermore, the scheme is not actually equivalent to op_return, becau=
se it requires the user to communicate out-of-band to reveal the commitment=
, whereas with op_return the data is immediately visible (while not popular=
, BIP47 and various colored coin protocols rely on this).<br><br>Yes, but s=
toring that additional data on-chain is not needed. It is expensive. By pay=
ing one satoshi per byte, you would pay 0.01 BTC for pushing 1 MB of data. =
That means 1 BTC for 100 MB of data, so 15 BTC for that 1.5 GB file. And in=
 practice it is the absolute minimum, because you have to wrap your data so=
mehow, you cannot just push 1.5 GB file. By placing that in TapScript, you =
can use your taproot public key as usual and attach any data into your key =
for &quot;free&quot;, because it takes zero additional bytes on-chain.<br><=
br></div>
<div>On 2022-02-24 11:08:39 user Ruben Somsen &lt;<a href=3D"mailto:rsomsen=
@gmail.com" target=3D"_blank">rsomsen@gmail.com</a>&gt; wrote:</div>
<blockquote style=3D"margin-left:7px;border-left:2px solid orange;padding-l=
eft:8px">
<div dir=3D"ltr">Note this has=C2=A0always been possible, and is not specif=
ically related to tapscript. As long as you&#39;re committing to an ECC poi=
nt, you can tweak it to commit data inside it (i.e. pay-to-contract). This =
includes P2PK and P2PKH.
<div>=C2=A0</div>
<div>Committing to 1.5GB of data has equally been possible with OP_RETURN &=
lt;hash&gt;, or even an entire merkle tree of hashes, as is the case with T=
odd&#39;s opentimestamps.
<div>
<div>=C2=A0</div>
<div>Also, tweaking an ECC point (this includes tapscript)=C2=A0in non-dete=
rministic ways also makes it harder to recover from backup, because you can=
&#39;t recover the key without knowing the full commitment.<br>
<div>=C2=A0</div>
<div>Furthermore, the scheme is not actually equivalent to op_return, becau=
se it=C2=A0requires the user to communicate out-of-band to reveal the commi=
tment, whereas with op_return the data is immediately visible (while not po=
pular, BIP47 and various colored coin protocols rely on this).</div>
<div>=C2=A0</div>
<div>Cheers,</div>
<div>Ruben</div>
<div>=C2=A0</div>
</div>
</div>
</div>
</div>
<br>
<div class=3D"gmail_quote">
<div class=3D"gmail_attr" dir=3D"ltr">On Thu, Feb 24, 2022 at 10:19 AM vjud=
eu via bitcoin-dev &lt;<a href=3D"http://../NowaWiadomosc/Do/QlIkBFQ6QUFhIV=
RZX192dnQBeCtCchE6GhA5LFpLCUc7EVZQVl9dQRIXXR8NCBMbCwIGChJXQFxcXEgcFh8UVVVDE=
yBdVkE9JVRdEwFhYXVlblhVIkosEAszLR5BQVV7U0MID0BAQUgIGh0RHgAMGAMXBQJfW1sdXRQU=
QUoDQlAiBFY8" target=3D"_blank">bitcoin-dev@lists.linuxfoundation.org</a>&g=
t; wrote:</div>
<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left:1px solid rgb(204,204,204);padding-left:1ex">
<div>Since Taproot was activated, we no longer need separate OP_RETURN outp=
uts to be pushed on-chain. If we want to attach any data to a transaction, =
we can create &quot;OP_RETURN &lt;anything&gt;&quot; as a branch in the Tap=
Script. In this way, we can store that data off-chain and we can always pro=
ve that they are connected with some taproot address, that was pushed on-ch=
ain. Also, we can store more than 80 bytes for &quot;free&quot;, because no=
 such taproot branch will be ever pushed on-chain and used as an input. Tha=
t means we can use &quot;OP_RETURN &lt;1.5 GB of data&gt;&quot;, create som=
e address having that taproot branch, and later prove to anyone that such &=
quot;1.5 GB of data&quot; is connected with our taproot address.</div>
<div>=C2=A0</div>
<div>Currently in Bitcoin Core we have &quot;data&quot; field in &quot;crea=
terawtransaction&quot;. Should the implementation be changed to place that =
data in a TapScript instead of creating separate OP_RETURN output? What do =
you think?</div>
_______________________________________________<br>bitcoin-dev mailing list=
<br><a href=3D"http://../NowaWiadomosc/Do/QlIkBFQ6QUFhIVRZX192dnQBeCtCchE6G=
hA5LFpLCUc7EVZQVl9dQRIXXR8NCBMbCwIGChJXQFxcXEgcFh8UVVVDEyBdVkE9JVRdEwFhYXVl=
blhVIkosEAszLR5BQVV7U0MID0BAQUgIGh0RHgAMGAMXBQJfW1sdXRQUQUoDQlAiBFY8" targe=
t=3D"_blank">bitcoin-dev@lists.linuxfoundation.org</a><br><a href=3D"https:=
//lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev" rel=3D"noopener n=
oreferrer" target=3D"_blank">https://lists.linuxfoundation.org/mailman/list=
info/bitcoin-dev</a></blockquote>
</div>
</blockquote>
</blockquote></div>

--0000000000004b7b0a05d8c4077f--