summaryrefslogtreecommitdiff
path: root/6d/24159dbd17e38ed5bec24c61afcf3771534b08
blob: fb186415dcb91d59d8f1f74079f6b6db77b14228 (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
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
Return-Path: <jlrubin@mit.edu>
Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org
	[172.17.192.35])
	by mail.linuxfoundation.org (Postfix) with ESMTPS id B4C975B1
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Mon,  7 Nov 2016 19:30:51 +0000 (UTC)
X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6
Received: from dmz-mailsec-scanner-2.mit.edu (dmz-mailsec-scanner-2.mit.edu
	[18.9.25.13])
	by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 535491CB
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Mon,  7 Nov 2016 19:30:50 +0000 (UTC)
X-AuditID: 1209190d-833ff70000007d9e-2c-5820d66852b1
Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])
	(using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client did not present a certificate)
	by  (Symantec Messaging Gateway) with SMTP id 3F.CE.32158.866D0285;
	Mon,  7 Nov 2016 14:30:49 -0500 (EST)
Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])
	by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id uA7JUmU5022545
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Mon, 7 Nov 2016 14:30:48 -0500
Received: from mail-it0-f47.google.com (mail-it0-f47.google.com
	[209.85.214.47]) (authenticated bits=0)
	(User authenticated as jlrubin@ATHENA.MIT.EDU)
	by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id uA7JUkEd032248
	(version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT)
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Mon, 7 Nov 2016 14:30:47 -0500
Received: by mail-it0-f47.google.com with SMTP id u205so150013778itc.0
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Mon, 07 Nov 2016 11:30:47 -0800 (PST)
X-Gm-Message-State: ABUngvfMZYxlxzUpHkUeqFIH9/J8x9pxmtos3Uf9xPsSjLp+1RLvr6u/4Z8WmZOCw+lF0PNQe+BNlucqqCN2TQ==
X-Received: by 10.36.28.204 with SMTP id c195mr2290708itc.81.1478547046799;
	Mon, 07 Nov 2016 11:30:46 -0800 (PST)
MIME-Version: 1.0
Received: by 10.36.129.132 with HTTP; Mon, 7 Nov 2016 11:30:26 -0800 (PST)
In-Reply-To: <1478270151.1662.6.camel@mmci.uni-saarland.de>
References: <CAMZUoKkG0AqwsTE=opTcsD=xqWsoVxqPVCzFbcSz8zJT1wiFPg@mail.gmail.com>
	<E8BB95A5-09B3-443C-B197-29DA3C4767D8@xbt.hk>
	<CAMZUoKmnkk=q7GkkvA+Q4-r64JCQ+kPRPdoEN8bnAwd2YGMH+Q@mail.gmail.com>
	<CAD438HsZRZcRWu=++3kuvyA5Ns9cU360utJMCyc6bROT-fdcHg@mail.gmail.com>
	<1478270151.1662.6.camel@mmci.uni-saarland.de>
From: Jeremy <jlrubin@mit.edu>
Date: Mon, 7 Nov 2016 11:30:26 -0800
X-Gmail-Original-Message-ID: <CAD5xwhhstv4w+81FrQ+W7W9gCTpN92vhSL95QNCHkHNFwJ7DQQ@mail.gmail.com>
Message-ID: <CAD5xwhhstv4w+81FrQ+W7W9gCTpN92vhSL95QNCHkHNFwJ7DQQ@mail.gmail.com>
To: Tim Ruffing <tim.ruffing@mmci.uni-saarland.de>,
	Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org>
Content-Type: multipart/alternative; boundary=001a113bc72a82297a0540bb0fd6
X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrNKsWRmVeSWpSXmKPExsUixCmqrZt5TSHC4H4Lj0XTa1sHRo/fPyYz
	BjBGcdmkpOZklqUW6dslcGU87rrNWtAwgbFi/YebLA2Mr6u7GDk4JARMJP7OyOxi5OIQEmhj
	klj77DszhHOHUWL+hf9sEM4HJonFex+wQDiLGCWm975l72LkBGrPkZj+dTMLhF0s8ff4K1YQ
	m1dAUOLkzCdgcSEBL4m3DR1gcU4Ba4kPx+4yQQzazSTxbds8dpA72ATkJD78MgWpYRFQkViy
	9j0jxMxEifaPL9khZgZIfLjVwgJSLiwQKHHukzdIWESggVHi/6x8EJsZaNWxhdMYJzAKzUJy
	xSwkqVlA3cwC6hLr5wlBhLUlli18zQxhq0nc3naVHVl8ASPbKkbZlNwq3dzEzJzi1GTd4uTE
	vLzUIl0jvdzMEr3UlNJNjOBYkOTdwfjvrtchRgEORiUe3gm9ChFCrIllxZW5hxglOZiURHlT
	NgGF+JLyUyozEosz4otKc1KLDzFKcDArifDaXQXK8aYkVlalFuXDpKQ5WJTEef+7fQ0XEkhP
	LEnNTk0tSC2CycpwcChJ8GqANAoWpaanVqRl5pQgpJk4OEGG8wANv3gFZHhxQWJucWY6RP4U
	oz3Hg5PPHzBxvPrwAkjumfUKSHZ8+PCASYglLz8vVUqcdxpImwBIW0ZpHtxkUJq7GHpN/xWj
	ONCjwrwNIAfwAFMk3OxXQGuZgNZWxYCtLUlESEk1MOqtfDZzybXYCwdPfTklvcWtlWH7kx/P
	P99O/Ne32KW+8zybjZjQjU0PthfbyMwqmr8zsPDFoezX7sFTAgvV81vltkix9L0I/WZ9/9rW
	WdWSx/VX7ZJKTIpu+OFusXClxK0fTV4rRN88654f4++1vqzuSHjkyS8ef2Jbm8Pu5qzk3Hx1
	qrrPF2MlluKMREMt5qLiRAD8O3SLTgMAAA==
X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00,HTML_MESSAGE,
	RCVD_IN_DNSWL_MED,RCVD_IN_SORBS_SPAM,RP_MATCHES_RCVD autolearn=ham
	version=3.3.1
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
	smtp1.linux-foundation.org
Subject: Re: [bitcoin-dev] Implementing Covenants with
	OP_CHECKSIGFROMSTACKVERIFY
X-BeenThere: bitcoin-dev@lists.linuxfoundation.org
X-Mailman-Version: 2.1.12
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: Mon, 07 Nov 2016 19:30:51 -0000

--001a113bc72a82297a0540bb0fd6
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

I think
=E2=80=8Bthe following implementation may be advantageous. It uses the same=
 number
of opcodes, without OP_CAT.

Avoiding use of OP_CAT is still desirable as I think it will be difficult
to agree on semantics for OP_CAT (given necessary measures to prevent
memory abuse) than for OP_LEFT. Another option I would be in support of
would be to have signature flags apply to OP_CHECKSIGFROMSTACK and all
OP_CHECKSIG flags be ignored if they aren't meaningful...

=E2=80=8B


























*<signature; SIGHASH_ALL><signatureTxnData>1. <pubkey>
OP_DUP3<pubkey><signature;
SIGHASH_ALL><signatureTxnData><pubkey><signature;
SIGHASH_ALL><signatureTxnData>2.
OP_CHECKSIGVERIFY<signatureTxnData><pubkey><signature;
SIGHASH_ALL><signatureTxnData>3. OP_SHA256 OP_ROT OP_SIZE OP_SUB1
OP_LEFT<signature><sha256(signatureTxnData)><pubkey><signatureTxnData>4.
OP_SWAP OP_ROT OP_CHECKSIGFROMSTACK=E2=80=8BVERIFY=E2=80=8B (with same =E2=
=80=8Bargument order=E2=80=8B)=E2=80=8B*



--
@JeremyRubin <https://twitter.com/JeremyRubin>
<https://twitter.com/JeremyRubin>

On Fri, Nov 4, 2016 at 7:35 AM, Tim Ruffing via bitcoin-dev <
bitcoin-dev@lists.linuxfoundation.org> wrote:

> Not a covenant but interesting nevertheless: _One_ of OP_CAT and
> OP_CHECKSIGFROMSTACKVERIFY alone is enough to implement "opt-in miner
> takes double-spend" [1]:
>
> You can create an output, which is spendable by everybody if you ever
> double-spend the output with two different transactions. Then the next
> miner will probably take your money (double-spending against your two
> or more contradicting transactions again).
>
> If you spend such an output, then the recipient may be willing to
> accept a zero-conf transaction, because he knows that you'll lose the
> money when you attempt double-spending (unless you are the lucky
> miner). See the discussion in [1] for details.
>
> The implementation using OP_CHECKSIGFROMSTACKVERIFY is straight-
> forward. You add a case to the script which allows spending if two
> valid signatures on different message under the public key of the
> output are given.
>
> What is less known I think:
> The same functionality can be achieved in a simpler way just using
> OP_CAT, because it's possible to turn Bitcoin's ECDSA to an "opt-in
> one-time signature scheme". With OP_CAT, you can create an output that
> is only spendable using a signature (r,s) with a specific already fixed
> first part r=3Dx_coord(kG). Basically, the creator of this output commits
> on r (and k) already when creating the output. Now, signing two
> different transaction with the same r allows everybody to extract the
> secret key from the two signatures.
>
> The drawbacks of the implementation with OP_CAT is that it's not
> possible to make a distinction between legitimate or illegitimate
> double-spends (yet to be defined) but just every double-spend is
> penalized. Also, it's somewhat hackish and the signer must store k (or
> create it deterministically but that's a good idea anyway).
>
> [1] https://www.mail-archive.com/bitcoin-development@lists.
> sourceforge.net/msg07122.html
>
> Best,
> Tim
>
> On Thu, 2016-11-03 at 07:37 +0000, Daniel Robinson via bitcoin-dev
> wrote:
> > Really cool!
> >
> > How about "poison transactions," the other covenants use case
> > proposed by M=C3=B6ser, Eyal, and Sirer? (I think
> > OP_CHECKSIGFROMSTACKVERIFY will also make it easier to check fraud
> > proofs, the other prerequisite for poison transactions.)
> >
> > Seems a little wasteful to do those two "unnecessary" signature
> > checks, and to have to construct the entire transaction data
> > structure, just to verify a single output in the transaction. Any
> > plans to add more flexible introspection opcodes to Elements, such as
> > OP_CHECKOUTPUTVERIFY?
> >
> > Really minor nit: "Notice that we have appended 0x83 to the end of
> > the transaction data"=E2=80=94should this say "to the end of the signat=
ure"?
> >
> > On Thu, Nov 3, 2016 at 12:28 AM Russell O'Connor via bitcoin-dev <bit
> > coin-dev@lists.linuxfoundation.org> wrote:
> > > Right.  There are minor trade-offs to be made with regards to that
> > > design point of OP_CHECKSIGFROMSTACKVERIFY.  Fortunately this
> > > covenant construction isn't sensitive to that choice and can be
> > > made to work with either implementation of
> > > OP_CHECKSIGFROMSTACKVERIFY.
> > >
> > > On Wed, Nov 2, 2016 at 11:35 PM, Johnson Lau <jl2012@xbt.hk> wrote:
> > > > Interesting. I have implemented OP_CHECKSIGFROMSTACKVERIFY in a
> > > > different way from the Elements. Instead of hashing the data on
> > > > stack, I directly put the 32 byte hash to the stack. This should
> > > > be more flexible as not every system are using double-SHA256
> > > >
> > > > https://github.com/jl2012/bitcoin/commits/mast_v3_master
> > > >
> > > >
> > > >
> > > > > On 3 Nov 2016, at 01:30, Russell O'Connor via bitcoin-dev <bitc
> > > > > oin-dev@lists.linuxfoundation.org> wrote:
> > > > >
> > > > > Hi all,
> > > > >
> > > > > It is possible to implement covenants using two script
> > > > > extensions: OP_CAT and OP_CHECKSIGFROMSTACKVERIFY.  Both of
> > > > > these op codes are already available in the Elements Alpha
> > > > > sidechain, so it is possible to construct covenants in Elements
> > > > > Alpha today.  I have detailed how the construction works in a
> > > > > blog post at <https://blockstream.com/2016/11/02/covenants-in-e
> > > > > lements-alpha.html>.  As an example, I've constructed scripts
> > > > > for the Moeser-Eyal-Sirer vault.
> > > > >
> > > > > I'm interested in collecting and implementing other useful
> > > > > covenants, so if people have ideas, please post them.
> > > > >
> > > > > If there are any questions, I'd be happy to answer.
> > > > >
> > > > > --
> > > > > Russell O'Connor
> > > > > _______________________________________________
> > > > > bitcoin-dev mailing list
> > > > > bitcoin-dev@lists.linuxfoundation.org
> > > > > https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
> > >
> > > _______________________________________________
> > > bitcoin-dev mailing list
> > > bitcoin-dev@lists.linuxfoundation.org
> > > https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
> > >
> >
> > _______________________________________________
> > bitcoin-dev mailing list
> > bitcoin-dev@lists.linuxfoundation.org
> > https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>

--001a113bc72a82297a0540bb0fd6
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:arial,he=
lvetica,sans-serif;font-size:small;color:rgb(0,0,0)">I think=C2=A0<div clas=
s=3D"gmail_default" style=3D"display:inline">=E2=80=8Bthe following impleme=
ntation may be advantageous. It uses the same number of opcodes, without OP=
_CAT.</div><div><div class=3D"gmail_default" style=3D"display:inline"><br><=
/div></div><div><div class=3D"gmail_default" style=3D"display:inline">Avoid=
ing use of OP_CAT is still desirable as I think it will be difficult to agr=
ee on semantics for OP_CAT (given necessary measures to prevent memory abus=
e) than for OP_LEFT. Another option I would be in support of would be to ha=
ve signature flags apply to OP_CHECKSIGFROMSTACK and all OP_CHECKSIG flags =
be ignored if they aren&#39;t meaningful...</div><div style=3D"color:rgb(34=
,34,34);font-family:arial,sans-serif;font-size:13px"><br></div><div style=
=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px"><div c=
lass=3D"gmail_default" style=3D"font-family:arial,helvetica,sans-serif;font=
-size:small;color:rgb(0,0,0)">=E2=80=8B</div><br><i>&lt;signature; SIGHASH_=
ALL&gt;<br>&lt;signatureTxnData&gt;<br><br>1. &lt;pubkey&gt; OP_DUP3<br>&lt=
;pubkey&gt;<br>&lt;signature; SIGHASH_ALL&gt;<br>&lt;signatureTxnData&gt;<b=
r>&lt;pubkey&gt;<br>&lt;signature; SIGHASH_ALL&gt;<br>&lt;signatureTxnData&=
gt;<br><br>2. OP_CHECKSIGVERIFY<br><br>&lt;signatureTxnData&gt;<br>&lt;pubk=
ey&gt;<br>&lt;signature; SIGHASH_ALL&gt;<br>&lt;signatureTxnData&gt;<br><br=
>3. OP_SHA256 OP_ROT OP_SIZE OP_SUB1 OP_LEFT<br><br>&lt;signature&gt;<br>&l=
t;sha256(signatureTxnData)&gt;<br>&lt;pubkey&gt;<br>&lt;signatureTxnData&gt=
;<br><br>4. OP_SWAP OP_ROT OP_CHECKSIGFROMSTACK<div class=3D"gmail_default"=
 style=3D"font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(=
0,0,0);display:inline">=E2=80=8BVERIFY=E2=80=8B</div>=C2=A0(with same=C2=A0=
<div class=3D"gmail_default" style=3D"font-family:arial,helvetica,sans-seri=
f;font-size:small;color:rgb(0,0,0);display:inline">=E2=80=8Bargument</div>=
=C2=A0order<div class=3D"gmail_default" style=3D"font-family:arial,helvetic=
a,sans-serif;font-size:small;color:rgb(0,0,0);display:inline">=E2=80=8B)=E2=
=80=8B</div></i></div><div><i><div class=3D"gmail_default" style=3D"font-fa=
mily:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0);display:in=
line"><br></div></i></div><div class=3D"gmail_extra" style=3D"color:rgb(34,=
34,34);font-family:arial,sans-serif;font-size:13px"><div class=3D"gmail-m_-=
6598423716298820742gmail_signature"></div></div></div></div></div><div clas=
s=3D"gmail_extra"><br clear=3D"all"><div><br clear=3D"all"><div><div class=
=3D"gmail_signature" data-smartmail=3D"gmail_signature"><div dir=3D"ltr">--=
<br><a href=3D"https://twitter.com/JeremyRubin" target=3D"_blank">@JeremyRu=
bin</a><a href=3D"https://twitter.com/JeremyRubin" target=3D"_blank"></a></=
div></div></div>
</div>
<br><div class=3D"gmail_quote">On Fri, Nov 4, 2016 at 7:35 AM, Tim Ruffing =
via bitcoin-dev <span dir=3D"ltr">&lt;<a href=3D"mailto:bitcoin-dev@lists.l=
inuxfoundation.org" target=3D"_blank">bitcoin-dev@lists.linuxfoundation.org=
</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin=
:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Not a covenant but=
 interesting nevertheless: _One_ of OP_CAT and<br>
OP_CHECKSIGFROMSTACKVERIFY alone is enough to implement &quot;opt-in miner<=
br>
takes double-spend&quot; [1]:<br>
<br>
You can create an output, which is spendable by everybody if you ever<br>
double-spend the output with two different transactions. Then the next<br>
miner will probably take your money (double-spending against your two<br>
or more contradicting transactions again).<br>
<br>
If you spend such an output, then the recipient may be willing to<br>
accept a zero-conf transaction, because he knows that you&#39;ll lose the<b=
r>
money when you attempt double-spending (unless you are the lucky<br>
miner). See the discussion in [1] for details.<br>
<br>
The implementation using OP_CHECKSIGFROMSTACKVERIFY is straight-<br>
forward. You add a case to the script which allows spending if two<br>
valid signatures on different message under the public key of the<br>
output are given.<br>
<br>
What is less known I think:<br>
The same functionality can be achieved in a simpler way just using<br>
OP_CAT, because it&#39;s possible to turn Bitcoin&#39;s ECDSA to an &quot;o=
pt-in<br>
one-time signature scheme&quot;. With OP_CAT, you can create an output that=
<br>
is only spendable using a signature (r,s) with a specific already fixed<br>
first part r=3Dx_coord(kG). Basically, the creator of this output commits<b=
r>
on r (and k) already when creating the output. Now, signing two<br>
different transaction with the same r allows everybody to extract the<br>
secret key from the two signatures.<br>
<br>
The drawbacks of the implementation with OP_CAT is that=C2=A0it&#39;s not<b=
r>
possible to make a distinction between legitimate or illegitimate<br>
double-spends (yet to be defined) but just every double-spend is<br>
penalized. Also, it&#39;s somewhat hackish and the signer must store k (or<=
br>
create it deterministically but that&#39;s a good idea anyway).<br>
<br>
[1] <a href=3D"https://www.mail-archive.com/bitcoin-development@lists.sourc=
eforge.net/msg07122.html" rel=3D"noreferrer" target=3D"_blank">https://www.=
mail-archive.com/<wbr>bitcoin-development@lists.<wbr>sourceforge.net/msg071=
22.html</a><br>
<br>
Best,<br>
Tim<br>
<br>
On Thu, 2016-11-03 at 07:37 +0000, Daniel Robinson via bitcoin-dev<br>
wrote:<br>
<div class=3D"HOEnZb"><div class=3D"h5">&gt; Really cool!<br>
&gt;<br>
&gt; How about &quot;poison transactions,&quot; the other covenants use cas=
e<br>
&gt; proposed by M=C3=B6ser, Eyal, and Sirer? (I think<br>
&gt; OP_CHECKSIGFROMSTACKVERIFY will also make it easier to check fraud<br>
&gt; proofs, the other prerequisite for poison transactions.)<br>
&gt;<br>
&gt; Seems a little wasteful to do those two &quot;unnecessary&quot; signat=
ure<br>
&gt; checks, and to have to construct the entire transaction data<br>
&gt; structure, just to verify a single output in the transaction. Any<br>
&gt; plans to add more flexible introspection opcodes to Elements, such as<=
br>
&gt; OP_CHECKOUTPUTVERIFY?<br>
&gt;<br>
&gt; Really minor nit: &quot;Notice that we have appended 0x83 to the end o=
f<br>
&gt; the transaction data&quot;=E2=80=94should this say &quot;to the end of=
 the signature&quot;?<br>
&gt;<br>
&gt; On Thu, Nov 3, 2016 at 12:28 AM Russell O&#39;Connor via bitcoin-dev &=
lt;bit<br>
&gt; <a href=3D"mailto:coin-dev@lists.linuxfoundation.org">coin-dev@lists.<=
wbr>linuxfoundation.org</a>&gt; wrote:<br>
&gt; &gt; Right.=C2=A0 There are minor trade-offs to be made with regards t=
o that<br>
&gt; &gt; design point of OP_CHECKSIGFROMSTACKVERIFY.=C2=A0 Fortunately thi=
s<br>
&gt; &gt; covenant construction isn&#39;t sensitive to that choice and can =
be<br>
&gt; &gt; made to work with either implementation of<br>
&gt; &gt; OP_CHECKSIGFROMSTACKVERIFY.<br>
&gt; &gt;<br>
&gt; &gt; On Wed, Nov 2, 2016 at 11:35 PM, Johnson Lau &lt;<a href=3D"mailt=
o:jl2012@xbt.hk">jl2012@xbt.hk</a>&gt; wrote:<br>
&gt; &gt; &gt; Interesting. I have implemented=C2=A0OP_<wbr>CHECKSIGFROMSTA=
CKVERIFY in a<br>
&gt; &gt; &gt; different way from the Elements. Instead of hashing the data=
 on<br>
&gt; &gt; &gt; stack, I directly put the 32 byte hash to the stack. This sh=
ould<br>
&gt; &gt; &gt; be more flexible as not every system are using double-SHA256=
<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; <a href=3D"https://github.com/jl2012/bitcoin/commits/mast_v3=
_master" rel=3D"noreferrer" target=3D"_blank">https://github.com/jl2012/<wb=
r>bitcoin/commits/mast_v3_master</a><br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; On 3 Nov 2016, at 01:30, Russell O&#39;Connor via bitco=
in-dev &lt;bitc<br>
&gt; &gt; &gt; &gt; <a href=3D"mailto:oin-dev@lists.linuxfoundation.org">oi=
n-dev@lists.linuxfoundation.<wbr>org</a>&gt; wrote:<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; Hi all,<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; It is possible to implement covenants using two script<=
br>
&gt; &gt; &gt; &gt; extensions: OP_CAT and OP_CHECKSIGFROMSTACKVERIFY.=C2=
=A0 Both of<br>
&gt; &gt; &gt; &gt; these op codes are already available in the Elements Al=
pha<br>
&gt; &gt; &gt; &gt; sidechain, so it is possible to construct covenants in =
Elements<br>
&gt; &gt; &gt; &gt; Alpha today.=C2=A0 I have detailed how the construction=
 works in a<br>
&gt; &gt; &gt; &gt; blog post at &lt;<a href=3D"https://blockstream.com/201=
6/11/02/covenants-in-e" rel=3D"noreferrer" target=3D"_blank">https://blocks=
tream.com/2016/<wbr>11/02/covenants-in-e</a><br>
&gt; &gt; &gt; &gt; lements-alpha.html&gt;.=C2=A0 As an example, I&#39;ve c=
onstructed scripts<br>
&gt; &gt; &gt; &gt; for the Moeser-Eyal-Sirer vault.<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; I&#39;m interested in collecting and implementing other=
 useful<br>
&gt; &gt; &gt; &gt; covenants, so if people have ideas, please post them.<b=
r>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; If there are any questions, I&#39;d be happy to answer.=
=C2=A0=C2=A0<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; --=C2=A0<br>
&gt; &gt; &gt; &gt; Russell O&#39;Connor<br>
&gt; &gt; &gt; &gt; ______________________________<wbr>_________________<br=
>
&gt; &gt; &gt; &gt; bitcoin-dev mailing list<br>
&gt; &gt; &gt; &gt; <a href=3D"mailto:bitcoin-dev@lists.linuxfoundation.org=
">bitcoin-dev@lists.<wbr>linuxfoundation.org</a><br>
&gt; &gt; &gt; &gt; <a href=3D"https://lists.linuxfoundation.org/mailman/li=
stinfo/bitcoin-dev" rel=3D"noreferrer" target=3D"_blank">https://lists.linu=
xfoundation.<wbr>org/mailman/listinfo/bitcoin-<wbr>dev</a><br>
&gt; &gt;<br>
&gt; &gt; ______________________________<wbr>_________________<br>
&gt; &gt; bitcoin-dev mailing list<br>
&gt; &gt; <a href=3D"mailto:bitcoin-dev@lists.linuxfoundation.org">bitcoin-=
dev@lists.<wbr>linuxfoundation.org</a><br>
&gt; &gt; <a href=3D"https://lists.linuxfoundation.org/mailman/listinfo/bit=
coin-dev" rel=3D"noreferrer" target=3D"_blank">https://lists.linuxfoundatio=
n.<wbr>org/mailman/listinfo/bitcoin-<wbr>dev</a><br>
&gt; &gt;<br>
&gt;<br>
&gt; ______________________________<wbr>_________________<br>
&gt; bitcoin-dev mailing list<br>
&gt; <a href=3D"mailto:bitcoin-dev@lists.linuxfoundation.org">bitcoin-dev@l=
ists.<wbr>linuxfoundation.org</a><br>
&gt; <a href=3D"https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-=
dev" rel=3D"noreferrer" target=3D"_blank">https://lists.linuxfoundation.<wb=
r>org/mailman/listinfo/bitcoin-<wbr>dev</a><br>
______________________________<wbr>_________________<br>
bitcoin-dev mailing list<br>
<a href=3D"mailto:bitcoin-dev@lists.linuxfoundation.org">bitcoin-dev@lists.=
<wbr>linuxfoundation.org</a><br>
<a href=3D"https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev" =
rel=3D"noreferrer" target=3D"_blank">https://lists.linuxfoundation.<wbr>org=
/mailman/listinfo/bitcoin-<wbr>dev</a><br>
</div></div></blockquote></div><br></div>

--001a113bc72a82297a0540bb0fd6--