summaryrefslogtreecommitdiff
path: root/ba/e1d34f71aaf64b2c2cd9fbd56797f31050b4bf
blob: c7ed38950cee69deea022979e008c88c615f7909 (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
Return-Path: <roconnor@blockstream.io>
Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org
	[172.17.192.35])
	by mail.linuxfoundation.org (Postfix) with ESMTPS id 4656371
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Thu,  3 Nov 2016 04:20:10 +0000 (UTC)
X-Greylist: whitelisted by SQLgrey-1.7.6
Received: from mail-qk0-f174.google.com (mail-qk0-f174.google.com
	[209.85.220.174])
	by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 637981A6
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Thu,  3 Nov 2016 04:20:09 +0000 (UTC)
Received: by mail-qk0-f174.google.com with SMTP id o68so43236127qkf.3
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Wed, 02 Nov 2016 21:20:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=blockstream-io.20150623.gappssmtp.com; s=20150623;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc; bh=dpdNgAfKamFjmVKL2WGNI/vvzdxeJTsvElRZfe5+PLc=;
	b=uRkSnOMKEGsIelxXGGibgKKAUT4M4e67PpzFljYIO7yc9BwsFdSsiwkSS3UXI6Q1so
	RQQXzh1zMTI4in7Zde4wlRPN/H8DJ8wTc1Kn+N6Xvd5gBh2m4Xh9u33fnmx2wsZhxVJY
	uFzbM7VNKb+QKwnsaX8AZEL+ddvehy5RpwFC+JZb1SvRsUVkdF4KtoCspFjikdgyVflh
	TxES5hVT5xvYBps+DYqOJLeUhIl+nP3DFwhENCrqywItNJ/Xx0R+VOq+rt/monjDWfli
	MqziP0D+w1AS26hLGQ2auyD7qnU4g6DHwcfFOS7FF6QgAYBz3YxmYXp9T5txs/DEgkwA
	04Kg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:mime-version:in-reply-to:references:from:date
	:message-id:subject:to:cc;
	bh=dpdNgAfKamFjmVKL2WGNI/vvzdxeJTsvElRZfe5+PLc=;
	b=lx3bSK9UzJ3EjC7+RRcCtfgFV9Q8RdkkQIjlDdu25EPp8uvVr0Yf6u7qKoybCyWAAe
	fECCA3rZFawcrsQmKOctcwPqBActv86tSCRJ1ZTwW1ZpvBJ/qnUq18Z7CtENqcyHZ6wn
	COwuFB2RrWlAbMHep360AjGNd/NMjfruKrledtbE+f5W6ePfBz1XZ32zz6hkGxs0pV+X
	LHdtQq38+iSg8LxB1tYYhB/1pHHB8AJ5ES4SBo6CFCQnF3kQz7qyYIOI9kjlK0RocQnX
	MgCMPlDQA92klMzn96lB5mj0lzkEwb02bWcn552uIS+EPGyvucHrW2/9H/izICDgiPI1
	B24Q==
X-Gm-Message-State: ABUngvdY4Jxm3AXK/X9MzBm+v6LCTQOLTcnUrtXUo2WpESzNamabP8LUSua/BBCirTqIIiVVsJv8Y4b9k0QOCMPE
X-Received: by 10.55.221.29 with SMTP id n29mr6891221qki.114.1478146808545;
	Wed, 02 Nov 2016 21:20:08 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.12.164.195 with HTTP; Wed, 2 Nov 2016 21:19:48 -0700 (PDT)
In-Reply-To: <E8BB95A5-09B3-443C-B197-29DA3C4767D8@xbt.hk>
References: <CAMZUoKkG0AqwsTE=opTcsD=xqWsoVxqPVCzFbcSz8zJT1wiFPg@mail.gmail.com>
	<E8BB95A5-09B3-443C-B197-29DA3C4767D8@xbt.hk>
From: "Russell O'Connor" <roconnor@blockstream.io>
Date: Thu, 3 Nov 2016 00:19:48 -0400
Message-ID: <CAMZUoKmnkk=q7GkkvA+Q4-r64JCQ+kPRPdoEN8bnAwd2YGMH+Q@mail.gmail.com>
To: Johnson Lau <jl2012@xbt.hk>
Content-Type: multipart/alternative; boundary=001a1149d3a4731aa005405ddf96
X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,
	DKIM_VALID, HTML_MESSAGE, RCVD_IN_DNSWL_LOW,
	RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
	smtp1.linux-foundation.org
X-Mailman-Approved-At: Thu, 03 Nov 2016 04:28:04 +0000
Cc: bitcoin-dev <bitcoin-dev@lists.linuxfoundation.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: Thu, 03 Nov 2016 04:20:10 -0000

--001a1149d3a4731aa005405ddf96
Content-Type: text/plain; charset=UTF-8

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 <
> bitcoin-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-elements-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
>
>
>

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

<div dir=3D"ltr">Right.=C2=A0 There are minor trade-offs to be made with re=
gards to that design point of OP_<wbr>CHECKSIGFROMSTACKVERIFY.=C2=A0 Fortun=
ately this covenant construction isn&#39;t sensitive to that choice and can=
 be made to work with either implementation of OP_<wbr>CHECKSIGFROMSTACKVER=
IFY.<br><div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On W=
ed, Nov 2, 2016 at 11:35 PM, Johnson Lau <span dir=3D"ltr">&lt;<a href=3D"m=
ailto:jl2012@xbt.hk" target=3D"_blank">jl2012@xbt.hk</a>&gt;</span> wrote:<=
br><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bord=
er-left:1px solid rgb(204,204,204);padding-left:1ex"><div style=3D"overflow=
-wrap: break-word;"><div>Interesting. I have implemented=C2=A0OP_<wbr>CHECK=
SIGFROMSTACKVERIFY 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 shou=
ld be more flexible as not every system are using double-SHA256</div><div><=
br></div><div><a href=3D"https://github.com/jl2012/bitcoin/commits/mast_v3_=
master" target=3D"_blank">https://github.com/jl2012/<wbr>bitcoin/commits/ma=
st_v3_master</a></div><div><br></div><br><div><blockquote type=3D"cite"><di=
v><div class=3D"gmail-h5"><div>On 3 Nov 2016, at 01:30, Russell O&#39;Conno=
r via bitcoin-dev &lt;<a href=3D"mailto:bitcoin-dev@lists.linuxfoundation.o=
rg" target=3D"_blank">bitcoin-dev@lists.<wbr>linuxfoundation.org</a>&gt; wr=
ote:</div><br class=3D"gmail-m_3266083758070358714Apple-interchange-newline=
"></div></div><div><div><div class=3D"gmail-h5"><div dir=3D"ltr">Hi all,<br=
><br>It is possible to implement covenants using two script extensions: OP_=
CAT and OP_CHECKSIGFROMSTACKVERIFY.=C2=A0 Both of these op codes are alread=
y available in the Elements Alpha sidechain, so it is possible to construct=
 covenants in Elements Alpha today.=C2=A0 I have detailed how the construct=
ion works in a blog post at &lt;<a href=3D"https://blockstream.com/2016/11/=
02/covenants-in-elements-alpha.html" target=3D"_blank">https://blockstream.=
com/2016/<wbr>11/02/covenants-in-elements-<wbr>alpha.html</a>&gt;.=C2=A0 As=
 an example, I&#39;ve constructed scripts for the Moeser-Eyal-Sirer vault.<=
br><br>I&#39;m interested in collecting and implementing other useful coven=
ants, so if people have ideas, please post them.<br><br>If there are any qu=
estions, I&#39;d be happy to answer.=C2=A0 <br><br>-- <br>Russell O&#39;Con=
nor<br></div></div></div>
______________________________<wbr>_________________<br>bitcoin-dev mailing=
 list<br><a href=3D"mailto:bitcoin-dev@lists.linuxfoundation.org" target=3D=
"_blank">bitcoin-dev@lists.<wbr>linuxfoundation.org</a><br><a href=3D"https=
://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev" target=3D"_blank=
">https://lists.linuxfoundation.<wbr>org/mailman/listinfo/bitcoin-<wbr>dev<=
/a><br></div></blockquote></div><br></div></blockquote></div><br></div></di=
v></div>

--001a1149d3a4731aa005405ddf96--