summaryrefslogtreecommitdiff
path: root/e8/d52fb32d1a6563c75c22dbe1d91239cb438123
blob: 9de4f3d353f72fd14f4dfa1c947a28430028febf (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
Return-Path: <mark@friedenbach.org>
Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org
	[172.17.192.35])
	by mail.linuxfoundation.org (Postfix) with ESMTPS id 0E7E3AA6
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Fri, 22 Sep 2017 21:11:07 +0000 (UTC)
X-Greylist: whitelisted by SQLgrey-1.7.6
Received: from mail-pg0-f52.google.com (mail-pg0-f52.google.com [74.125.83.52])
	by smtp1.linuxfoundation.org (Postfix) with ESMTPS id AE000203
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Fri, 22 Sep 2017 21:11:05 +0000 (UTC)
Received: by mail-pg0-f52.google.com with SMTP id k193so1198824pgc.8
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Fri, 22 Sep 2017 14:11:05 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=friedenbach-org.20150623.gappssmtp.com; s=20150623;
	h=from:message-id:mime-version:subject:date:in-reply-to:cc:to
	:references; bh=OLnG16h4ScdhK7S0kv2OhgBnyU2sx3lqvjyp7P91GoQ=;
	b=BtJGhtbvQUzHGFtBNacIixhJDgj363Cv2j7nhPoQPhk4fmkDeU0EilJmiRPVf/T2Nv
	MWRrYGURj0DeXqRyITcW3DKKV6l92QJ3k5YRy011P9ZzP2T3aw46OmWNRN6cI2GnhKtp
	WDpyTQ1rEojYRbYdejQdtUT1ewbxNGhekl0KO4Z6Ny5hAPDf+bXTVE9bP8IOBRS7bqtE
	GUPtn1q5pHnTvlJDJU8lmWaLhQvlLQvt/lYECkW8npiJREPID0fKHsPNRjTHGeRy23XG
	pUdxDT4AQL4bk9x6E1DbuUqxdEtLvL/+3E5CbF6UfAwuggCY0vNOffAQHpq8osb5CJqm
	JQsw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:from:message-id:mime-version:subject:date
	:in-reply-to:cc:to:references;
	bh=OLnG16h4ScdhK7S0kv2OhgBnyU2sx3lqvjyp7P91GoQ=;
	b=OUyKRcg/s3FtOH/R5clLVl4waTttz7+ecEJP7N4pqwygi/OGzxgWTn5V5HrSeaFVPT
	rgVAR/Vi/NfAfDYtMB3wuAEpfvFep1Li9ZySqWUuZDh7FaFHAGvj10NvB5CG5mnPiJ+x
	kJftTbiTJRHvmjX/IN/f7h6O6iZy3JJs0wljOrTx/ajGfMhPRQP5adUmH40qY+8dgjl3
	sWv9cM1MtMmlyyL1PO9IWa+nU5YxHfUm6FemHZ9AHlZ8mElJHK5RlKzmYOobH/XoDEkO
	nfQsecWP7mu3xKuzzW5Pw3wCKAdGpWy2CsP+DlL0SO2TSfHKoS4/A2THFLVSR2kmBagd
	xxAQ==
X-Gm-Message-State: AHPjjUim6TvioxFjTQZrTJ8j8zPGMb+eBbd97J4SIJmiZKIU56j3VQ8W
	WDjjvdzXgk3fTRn9qEkfpPi8nw==
X-Google-Smtp-Source: AOwi7QDImEyXHYBTGB+9KncxPDMV4ZCLPwtjofUc/wnJM1L8wREvb437ejTaZt5Uwk5dz2NuyQoWJw==
X-Received: by 10.98.236.150 with SMTP id e22mr352782pfm.203.1506114665332;
	Fri, 22 Sep 2017 14:11:05 -0700 (PDT)
Received: from ?IPv6:2601:640:102:9b01:b813:d9f9:2ea:bb39?
	([2601:640:102:9b01:b813:d9f9:2ea:bb39])
	by smtp.gmail.com with ESMTPSA id f74sm844050pfa.36.2017.09.22.14.11.04
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Fri, 22 Sep 2017 14:11:04 -0700 (PDT)
From: Mark Friedenbach <mark@friedenbach.org>
Message-Id: <3385CE20-C1BA-40DD-8FC3-8F53F3350717@friedenbach.org>
Content-Type: multipart/alternative;
	boundary="Apple-Mail=_B15E0862-A6D4-4BA1-9E1A-F403AB94707E"
Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\))
Date: Fri, 22 Sep 2017 14:11:03 -0700
In-Reply-To: <CAKzdR-phAarTY16BOnC95BPN0qMNEE_XZ9H-XmFeeaBc2V1U5w@mail.gmail.com>
To: Sergio Demian Lerner <sergio.d.lerner@gmail.com>
References: <5B6756D0-6BEF-4A01-BDB8-52C646916E29@friedenbach.org>
	<C623794E-F061-4C7A-B05D-378798ED2BF7@friedenbach.org>
	<201709190309.08669.luke@dashjr.org>
	<CAA2B000-6C54-4AD7-B931-43C99D615A61@friedenbach.org>
	<CAKzdR-phAarTY16BOnC95BPN0qMNEE_XZ9H-XmFeeaBc2V1U5w@mail.gmail.com>
X-Mailer: Apple Mail (2.3273)
X-Spam-Status: No, score=0.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,
	HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM autolearn=disabled
	version=3.3.1
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
	smtp1.linux-foundation.org
X-Mailman-Approved-At: Fri, 22 Sep 2017 21:13:27 +0000
Cc: Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org>
Subject: Re: [bitcoin-dev] cleanstack alt stack & softfork improvements
 (Was: Merkle branch verification & tail-call semantics for generalized
 MAST)
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: Fri, 22 Sep 2017 21:11:07 -0000


--Apple-Mail=_B15E0862-A6D4-4BA1-9E1A-F403AB94707E
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8


> On Sep 22, 2017, at 1:32 PM, Sergio Demian Lerner =
<sergio.d.lerner@gmail.com> wrote:
>=20
>=20
>=20
> There are other solutions to this problem that could have been taken
> instead, such as committing to the number of items or maximum size of
> the stack as part of the sighash data, but cleanstack was the approach
> taken.=20
>=20
> The lack of signed maximum segwit stack size was one of the objections =
to segwit I presented last year. This together with the unlimited segwit =
stack size.
>=20
> However, committing to the maximum stack size (in bytes) for an input =
is tricky. The only place where this could be packed is in sequence_no, =
with a soft-fork. E.g. when transaction version is 2 and and only when =
lock_time is zero.
>=20
> For transactions with locktime >0, we could soft-fork so transactions =
add a last zero-satoshi output whose scriptPub contains OP_RETURN and =
followed by N VarInts, containing the maximum stack size of each input.=20=

> Normally, for a 400 byte, 2-input transaction, this will add 11 bytes, =
or a 2.5% overhead.

There=E2=80=99s no need to put it in the transaction itself. You put it =
in the witness and it is either committed to as part of the witness (in =
which case it has to hold for all possible spend paths), or at spend =
time by including it in the data signed by CHECKSIG.


--Apple-Mail=_B15E0862-A6D4-4BA1-9E1A-F403AB94707E
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=utf-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html =
charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" =
class=3D""><br class=3D""><div><blockquote type=3D"cite" class=3D""><div =
class=3D"">On Sep 22, 2017, at 1:32 PM, Sergio Demian Lerner &lt;<a =
href=3D"mailto:sergio.d.lerner@gmail.com" =
class=3D"">sergio.d.lerner@gmail.com</a>&gt; wrote:</div><br =
class=3D"Apple-interchange-newline"><div class=3D""><blockquote =
class=3D"gmail_quote" style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; margin: 0px 0px 0px 0.8ex; =
border-left-width: 1px; border-left-style: solid; border-left-color: =
rgb(204, 204, 204); padding-left: 1ex;"><br =
class=3D"Apple-interchange-newline"><br class=3D"">There are other =
solutions to this problem that could have been taken<br =
class=3D"">instead, such as committing to the number of items or maximum =
size of<br class=3D"">the stack as part of the sighash data, but =
cleanstack was the approach<br class=3D"">taken.<span =
class=3D"Apple-converted-space">&nbsp;</span></blockquote><div =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=3D""><br=
 class=3D""></div><div style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px;" class=3D"">The lack of =
signed&nbsp;maximum segwit stack size was one of the objections to =
segwit I presented last year. This together with the unlimited segwit =
stack size.</div><div style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px;" class=3D""><br class=3D""></div><div =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" =
class=3D"">However, committing to the maximum stack size (in bytes) for =
an input is tricky. The only place where this could be packed is =
in&nbsp;sequence_no, with a soft-fork. E.g. when transaction version is =
2 and and only when lock_time is zero.</div><div style=3D"font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=3D""><span =
style=3D"background-color: rgb(249, 249, 249); font-family: sans-serif; =
font-size: 14px;" class=3D""><br class=3D""></span></div><span =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; =
display: inline !important;" class=3D"">For transactions with locktime =
&gt;0, we could soft-fork so transactions add a last zero-satoshi output =
whose scriptPub contains OP_RETURN and followed by N VarInts, containing =
the maximum stack size of each input.<span =
class=3D"Apple-converted-space">&nbsp;</span></span><br =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" =
class=3D""><span style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; float: none; display: inline =
!important;" class=3D"">Normally, for a 400 byte, 2-input transaction, =
this will add 11 bytes, or a 2.5% overhead.</span></div></blockquote><br =
class=3D""></div><div>There=E2=80=99s no need to put it in the =
transaction itself. You put it in the witness and it is either committed =
to as part of the witness (in which case it has to hold for all possible =
spend paths), or at spend time by including it in the data signed by =
CHECKSIG.</div><br class=3D""></body></html>=

--Apple-Mail=_B15E0862-A6D4-4BA1-9E1A-F403AB94707E--