summaryrefslogtreecommitdiff
path: root/f1/b5d5fdd5d570ae4afed9e3f0fa4889704e96c0
blob: 43dc6df2a6e839c190e64b3793ba3fcbd25e4c1f (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
Return-Path: <btcdrak@gmail.com>
Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org
	[172.17.192.35])
	by mail.linuxfoundation.org (Postfix) with ESMTPS id 1146314DD
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Wed, 16 Sep 2015 22:40:29 +0000 (UTC)
X-Greylist: whitelisted by SQLgrey-1.7.6
Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com
	[209.85.212.177])
	by smtp1.linuxfoundation.org (Postfix) with ESMTPS id A93FAFF
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Wed, 16 Sep 2015 22:40:27 +0000 (UTC)
Received: by wicgb1 with SMTP id gb1so94061511wic.1
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Wed, 16 Sep 2015 15:40:26 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc:content-type;
	bh=KY/++zR5AVfJd+ZCZO76KtblKUO64DTg8pJCmdP+rwg=;
	b=vgCn+x8duXqnxssvxRDuCfu4mdpIZb+1/AXzO8a/uco7dmP8RFvSTIRgbIzw/ukjSx
	iMP+sjWgYMzXlDlU7pEx99w9yQLR2spT05zR9nb3g6CHPVgNJR7SsasIdPPxpYihPgI0
	WSu1C26k2l5ozqsCkxRgvoAJIcqxMHZy72dbmMq2fvR/riuY+pvyQrFjIEIWGyS8Lu0a
	4plW83x7EXjJCbtxy/9+zXAzLYN5GnocNd3/+NxyMDZWq0lpIC6Fm8toS4mn+b8lAZrN
	kK4s9Ci5zKZCuOCGNCFwSw55pO6kej0DFCR+GxB/UAeE1u5mt2/4cgIbsHHheNWXJRQl
	juLw==
X-Received: by 10.194.121.131 with SMTP id lk3mr25835314wjb.77.1442443226450; 
	Wed, 16 Sep 2015 15:40:26 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.28.21.200 with HTTP; Wed, 16 Sep 2015 15:40:06 -0700 (PDT)
In-Reply-To: <CAOG=w-tuFtX2t+0FVfkoObw_a9-7j4LwX87YJU1n7adYu=DMdQ@mail.gmail.com>
References: <CADJgMztgE_GkbrsP7zCEHNPA3P6T=aSFfhkcN-q=gVhWP0vKXg@mail.gmail.com>
	<CADJgMzv8G3EqLBwEYRHJZ+fO_Jwzy0koi2pJ_iNRkXmoVarGcg@mail.gmail.com>
	<CABm2gDod9z6ksgaCv86qFCyKLTQSL3+oNns+__5H77hVhs05DQ@mail.gmail.com>
	<CAOG=w-sbOcaogkic2i4A5eZnBQ79LUibsGy0dyKyvQg53ktY1Q@mail.gmail.com>
	<55DA6470.9040301@thinlink.com>
	<CAAS2fgQKQpHu-nC1uSrigDx2JLUt64p-LqidVmiuULDE0MJCFQ@mail.gmail.com>
	<CABm2gDqW7OGuyZ1BTTeeivDf9wFVsAK9AaGYm8XWwLb2O2Lb+g@mail.gmail.com>
	<CAOG=w-ubk3nPfxy25Hd6kPeehf7vnYD5chksLWU5wU2t=jL5TA@mail.gmail.com>
	<CAOG=w-to4Vrx4ykKJTy5EAyN4GZd6Q=G5FzqZH-5J3Thz_VNpQ@mail.gmail.com>
	<CAOG=w-tuFtX2t+0FVfkoObw_a9-7j4LwX87YJU1n7adYu=DMdQ@mail.gmail.com>
From: Btc Drak <btcdrak@gmail.com>
Date: Wed, 16 Sep 2015 23:40:06 +0100
Message-ID: <CADJgMzsPrg7VhTQC8aCvcQ3yAN8rtt+Qv_yfrCKMqOALpGPVyg@mail.gmail.com>
To: Mark Friedenbach <mark@friedenbach.org>
Content-Type: multipart/alternative; boundary=089e01227b8a1f0f58051fe4fce7
X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,
	DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, HK_RANDOM_ENVFROM,
	HK_RANDOM_FROM, 
	HTML_MESSAGE,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.1
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
	smtp1.linux-foundation.org
Cc: Bitcoin Dev <bitcoin-dev@lists.linuxfoundation.org>
Subject: Re: [bitcoin-dev] [BIP-draft] CHECKSEQUENCEVERIFY - An opcode for
 relative locktime
X-BeenThere: bitcoin-dev@lists.linuxfoundation.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Bitcoin Development 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: Wed, 16 Sep 2015 22:40:29 -0000

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

Where do we stand now on which sequencenumbers variation to use? We really
should make a decision now.

On Fri, Aug 28, 2015 at 12:32 AM, Mark Friedenbach via bitcoin-dev <
bitcoin-dev@lists.linuxfoundation.org> wrote:

> So I've created 2 new repositories with changed rules regarding
> sequencenumbers:
>
> https://github.com/maaku/bitcoin/tree/sequencenumbers2
>
> This repository inverts (un-inverts?) the sequence number. nSequence=3D1
> means 1 block relative lock-height. nSequence=3DLOCKTIME_THRESHOLD means =
1
> second relative lock-height. nSequence>=3D0x80000000 (most significant bi=
t
> set) is not interpreted as a relative lock-time.
>
> https://github.com/maaku/bitcoin/tree/sequencenumbers3
>
> This repository not only inverts the sequence number, but also interprets
> it as a fixed-point number. This allows up to 5 year relative lock times
> using blocks as units, and saves 12 low-order bits for future use. Or, up
> to about 2 year relative lock times using seconds as units, and saves 4
> bits for future use without second-level granularity. More bits could be
> recovered from time-based locktimes by choosing a higher granularity (a
> soft-fork change if done correctly).
>
> On Tue, Aug 25, 2015 at 3:08 PM, Mark Friedenbach <mark@friedenbach.org>
> wrote:
>
>> To follow up on this, let's say that you want to be able to have up to 1
>> year relative lock-times. This choice is somewhat arbitrary and what I
>> would like some input on, but I'll come back to this point.
>>
>>  * 1 bit is necessary to enable/disable relative lock-time.
>>
>>  * 1 bit is necessary to indicate whether seconds vs blocks as the unit
>> of measurement.
>>
>>  * 1 year of time with 1-second granularity requires 25 bits. However
>> since blocks occur at approximately 10 minute intervals on average, havi=
ng
>> a relative lock-time significantly less than this interval doesn't make
>> much sense. A granularity of 256 seconds would be greater than the Nyqui=
st
>> frequency and requires only 17 bits.
>>
>>  * 1 year of blocks with 1-block granularity requires 16 bits.
>>
>> So time-based relative lock time requires about 19 bits, and block-based
>> relative lock-time requires about 18 bits. That leaves 13 or 14 bits for
>> other uses.
>>
>> Assuming a maximum of 1-year relative lock-times. But what is an
>> appropriate maximum to choose? The use cases I have considered have only
>> had lock times on the order of a few days to a month or so. However I wo=
uld
>> feel uncomfortable going less than a year for a hard maximum, and am hav=
ing
>> trouble thinking of any use case that would require more than a year of
>> lock-time. Can anyone else think of a use case that requires >1yr relati=
ve
>> lock-time?
>>
>> TL;DR
>>
>> On Sun, Aug 23, 2015 at 7:37 PM, Mark Friedenbach <mark@friedenbach.org>
>> wrote:
>>
>>> A power of 2 would be far more efficient here. The key question is how
>>> long of a relative block time do you need? Figure out what the maximum
>>> should be ( I don't know what that would be, any ideas?) and then see h=
ow
>>> many bits you have left over.
>>> On Aug 23, 2015 7:23 PM, "Jorge Tim=C3=B3n" <
>>> bitcoin-dev@lists.linuxfoundation.org> wrote:
>>>
>>>> On Mon, Aug 24, 2015 at 3:01 AM, Gregory Maxwell via bitcoin-dev
>>>> <bitcoin-dev@lists.linuxfoundation.org> wrote:
>>>> > Seperately, to Mark and Btcdrank: Adding an extra wrinkel to the
>>>> > discussion has any thought been given to represent one block with mo=
re
>>>> > than one increment?  This would leave additional space for future
>>>> > signaling, or allow, for example, higher resolution numbers for a
>>>> > sharechain commitement.
>>>>
>>>> No, I don't think anybody thought about this. I just explained this to
>>>> Pieter using "for example, 10 instead of 1".
>>>> He suggested 600 increments so that it is more similar to timestamps.
>>>> _______________________________________________
>>>> 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
>
>

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

<div dir=3D"ltr">Where do we stand now on which=C2=A0sequencenumbers variat=
ion to use? We really should make a decision now.</div><div class=3D"gmail_=
extra"><br><div class=3D"gmail_quote">On Fri, Aug 28, 2015 at 12:32 AM, Mar=
k Friedenbach via bitcoin-dev <span dir=3D"ltr">&lt;<a href=3D"mailto:bitco=
in-dev@lists.linuxfoundation.org" target=3D"_blank">bitcoin-dev@lists.linux=
foundation.org</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div=
 dir=3D"ltr"><div><div>So I&#39;ve created 2 new repositories with changed =
rules regarding sequencenumbers:<br><br><a href=3D"https://github.com/maaku=
/bitcoin/tree/sequencenumbers2" target=3D"_blank">https://github.com/maaku/=
bitcoin/tree/sequencenumbers2</a><br><br></div>This repository inverts (un-=
inverts?) the sequence number. nSequence=3D1 means 1 block relative lock-he=
ight. nSequence=3DLOCKTIME_THRESHOLD means 1 second relative lock-height. n=
Sequence&gt;=3D0x80000000 (most significant bit set) is not interpreted as =
a relative lock-time.<br><br><a href=3D"https://github.com/maaku/bitcoin/tr=
ee/sequencenumbers3" target=3D"_blank">https://github.com/maaku/bitcoin/tre=
e/sequencenumbers3</a><br><br></div>This repository not only inverts the se=
quence number, but also interprets it as a fixed-point number. This allows =
up to 5 year relative lock times using blocks as units, and saves 12 low-or=
der bits for future use. Or, up to about 2 year relative lock times using s=
econds as units, and saves 4 bits for future use without second-level granu=
larity. More bits could be recovered from time-based locktimes by choosing =
a higher granularity (a soft-fork change if done correctly).<br></div><div =
class=3D"HOEnZb"><div class=3D"h5"><div class=3D"gmail_extra"><br><div clas=
s=3D"gmail_quote">On Tue, Aug 25, 2015 at 3:08 PM, Mark Friedenbach <span d=
ir=3D"ltr">&lt;<a href=3D"mailto:mark@friedenbach.org" target=3D"_blank">ma=
rk@friedenbach.org</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quot=
e" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">=
<div dir=3D"ltr"><div><div>To follow up on this, let&#39;s say that you wan=
t to be able to have up to 1 year relative lock-times. This choice is somew=
hat arbitrary and what I would like some input on, but I&#39;ll come back t=
o this point.<br><br></div><div>=C2=A0* 1 bit is necessary to enable/disabl=
e relative lock-time.<br></div><div><br></div><div>=C2=A0* 1 bit is necessa=
ry to indicate whether seconds vs blocks as the unit of measurement.<br><br=
></div><div>=C2=A0* 1 year of time with 1-second granularity requires 25 bi=
ts. However since blocks occur at approximately 10 minute intervals on aver=
age, having a relative lock-time significantly less than this interval does=
n&#39;t make much sense. A granularity of 256 seconds would be greater than=
 the Nyquist frequency and requires only 17 bits.<br><br></div><div>=C2=A0*=
 1 year of blocks with 1-block granularity requires 16 bits.<br></div><div>=
<br></div>So time-based relative lock time requires about 19 bits, and bloc=
k-based relative lock-time requires about 18 bits. That leaves 13 or 14 bit=
s for other uses.<br><br></div><div>Assuming a maximum of 1-year relative l=
ock-times. But what is an appropriate maximum to choose? The use cases I ha=
ve considered have only had lock times on the order of a few days to a mont=
h or so. However I would feel uncomfortable going less than a year for a ha=
rd maximum, and am having trouble thinking of any use case that would requi=
re more than a year of lock-time. Can anyone else think of a use case that =
requires &gt;1yr relative lock-time?<br></div><div><br></div>TL;DR <br></di=
v><div><div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On Su=
n, Aug 23, 2015 at 7:37 PM, Mark Friedenbach <span dir=3D"ltr">&lt;<a href=
=3D"mailto:mark@friedenbach.org" target=3D"_blank">mark@friedenbach.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"><p dir=3D"ltr">A power=
 of 2 would be far more efficient here. The key question is how long of a r=
elative block time do you need? Figure out what the maximum should be ( I d=
on&#39;t know what that would be, any ideas?) and then see how many bits yo=
u have left over.</p><div><div>
<div class=3D"gmail_quote">On Aug 23, 2015 7:23 PM, &quot;Jorge Tim=C3=B3n&=
quot; &lt;<a href=3D"mailto:bitcoin-dev@lists.linuxfoundation.org" target=
=3D"_blank">bitcoin-dev@lists.linuxfoundation.org</a>&gt; wrote:<br type=3D=
"attribution"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;=
border-left:1px #ccc solid;padding-left:1ex">On Mon, Aug 24, 2015 at 3:01 A=
M, Gregory Maxwell via bitcoin-dev<br>
&lt;<a href=3D"mailto:bitcoin-dev@lists.linuxfoundation.org" target=3D"_bla=
nk">bitcoin-dev@lists.linuxfoundation.org</a>&gt; wrote:<br>
&gt; Seperately, to Mark and Btcdrank: Adding an extra wrinkel to the<br>
&gt; discussion has any thought been given to represent one block with more=
<br>
&gt; than one increment?=C2=A0 This would leave additional space for future=
<br>
&gt; signaling, or allow, for example, higher resolution numbers for a<br>
&gt; sharechain commitement.<br>
<br>
No, I don&#39;t think anybody thought about this. I just explained this to<=
br>
Pieter using &quot;for example, 10 instead of 1&quot;.<br>
He suggested 600 increments so that it is more similar to timestamps.<br>
_______________________________________________<br>
bitcoin-dev mailing list<br>
<a href=3D"mailto:bitcoin-dev@lists.linuxfoundation.org" target=3D"_blank">=
bitcoin-dev@lists.linuxfoundation.org</a><br>
<a href=3D"https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev" =
rel=3D"noreferrer" target=3D"_blank">https://lists.linuxfoundation.org/mail=
man/listinfo/bitcoin-dev</a><br>
</blockquote></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
bitcoin-dev mailing list<br>
<a href=3D"mailto:bitcoin-dev@lists.linuxfoundation.org">bitcoin-dev@lists.=
linuxfoundation.org</a><br>
<a href=3D"https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev" =
rel=3D"noreferrer" target=3D"_blank">https://lists.linuxfoundation.org/mail=
man/listinfo/bitcoin-dev</a><br>
<br></blockquote></div><br></div>

--089e01227b8a1f0f58051fe4fce7--