summaryrefslogtreecommitdiff
path: root/91/c47683c74375e106e2295a77fd573619a28ce6
blob: b74905707d8d38f94ffa0cfa7b5fa1cea01e4377 (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
Return-Path: <bitcoin@upalc.com>
Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org
	[172.17.192.35])
	by mail.linuxfoundation.org (Postfix) with ESMTPS id 96ECDAC1
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Tue, 25 Aug 2015 09:07:21 +0000 (UTC)
X-Greylist: whitelisted by SQLgrey-1.7.6
Received: from mail-io0-f170.google.com (mail-io0-f170.google.com
	[209.85.223.170])
	by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 64A10112
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Tue, 25 Aug 2015 09:07:20 +0000 (UTC)
Received: by iodt126 with SMTP id t126so179437313iod.2
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Tue, 25 Aug 2015 02:07:19 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:mime-version:date:message-id:subject:from:to:cc
	:content-type;
	bh=FBJMfdLIxmP36N771AH+AWPRJi+kYW6IAUJEM7T1auU=;
	b=DJ20lkf3biAAba63jb8Ubsrg0H1aOS2dNkUWwAIUgpb4HHGggiDhBLNHzoaEwXQ34k
	d4ITxqc+N6AWvmNFMmiP6NeLRimwikm6Upk+iQL79jMg8daAMXDcDR1y3hPRdofvJRoh
	IJcFUxfBW/1DE4wAQnMCSc4f5Jkqyae2nfLaLHQ13HMVeNWEaLOsRRAdutiWQe5jcsVi
	XVi5V/zgjAdZT/W15CYGSDoqozbUgT3UyRTyk+/pE6fFxQ5DOEoBQqC8Gs/XEw/B+zHa
	KA9FKjgNxxnkbeV+3EYyml0M5kZvP9cGJkQmitQkaqYMp8hvfwU6WC636lWp7NzBtfXE
	0OYw==
X-Gm-Message-State: ALoCoQk1j17aFZ9oD+8JTAL4h93dwp0JQyYOFh8ZtT6rTvu9MbEdezrTGu0Wokga+W0pFved3VQ9
MIME-Version: 1.0
X-Received: by 10.107.19.94 with SMTP id b91mr20859668ioj.144.1440493639713;
	Tue, 25 Aug 2015 02:07:19 -0700 (PDT)
Received: by 10.107.18.155 with HTTP; Tue, 25 Aug 2015 02:07:19 -0700 (PDT)
X-Originating-IP: [115.187.38.221]
Date: Tue, 25 Aug 2015 14:37:19 +0530
Message-ID: <CAED3CWipF8u5g3LUrqfyHxvEk4Lu+d12ZOJZnoBUw6iZZOg-ZQ@mail.gmail.com>
From: Upal Chakraborty <bitcoin@upalc.com>
To: bitcoin-dev@lists.linuxfoundation.org
Content-Type: multipart/alternative; boundary=001a113f3c70b25ba2051e1f0fd0
X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,HTML_MESSAGE,
	RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
	smtp1.linux-foundation.org
Cc: greg@xiph.org
Subject: [bitcoin-dev] Dynamically Controlled Bitcoin Block Size Max Cap
	[BIP 1xx - Draft]
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: Tue, 25 Aug 2015 09:07:21 -0000

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

Github: https://github.com/UpalChakraborty/bips/blob/master/BIP-DynamicMaxBlockSize.mediawiki

<pre>
  BIP: 1xx
  Title: Dynamically Controlled Bitcoin Block Size Max Cap
  Author: Upal Chakraborty <bitcoin@upalc.com>
  Status: Draft
  Type: Standards Track
  Created: 2015-08-24
</pre>

==Abstract==

This BIP proposes replacing the fixed one megabyte maximum block size
with a dynamically controlled maximum block size that may increase or
decrease with difficulty change depending on various network factors.
I have two proposals regarding this...

i. Depending only on previous block size calculation.

ii. Depending on previous block size calculation and previous Tx fee
collected by miners.

==Motivation==

With increased adoption, transaction volume on bitcoin network is
bound to grow. If the one megabyte max cap is not changed to a
flexible one which changes itself with changing network demand, then
adoption will hamper and bitcoin's growth may choke up. Following
graph shows the change in average block size since inception...
https://blockchain.info/charts/avg-block-size?timespan=all&showDataPoints=false&daysAverageString=1&show_header=true&scale=0&address=

==Specification==

===Proposal 1 : Depending only on previous block size calculation===

  If more than 50% of block's size, found in the first 2000 of the
last difficulty period, is more than 90% MaxBlockSize
      Double MaxBlockSize
  Else if more than 90% of block's size, found in the first 2000 of
the last difficulty period, is less than 50% MaxBlockSize
      Half MaxBlockSize
  Else
      Keep the same MaxBlockSize

===Proposal 2 : Depending on previous block size calculation and
previous Tx fee collected by miners===

  TotalBlockSizeInLastButOneDifficulty = Sum of all Block size of
first 2008 blocks in last 2 difficulty period
  TotalBlockSizeInLastDifficulty = Sum of all Block size of second
2008 blocks in last 2 difficulty period (This actually includes 8
blocks from last but one difficulty)

  TotalTxFeeInLastButOneDifficulty = Sum of all Tx fees of first 2008
blocks in last 2 difficulty period
  TotalTxFeeInLastDifficulty = Sum of all Tx fees of second 2008
blocks in last 2 difficulty period (This actually includes 8 blocks
from last but one difficulty)

  If ( ( (Sum of first 4016 block size in last 2 difficulty
period)/4016 > 50% MaxBlockSize) AND (TotalTxFeeInLastDifficulty >
TotalTxFeeInLastButOneDifficulty) AND (TotalBlockSizeInLastDifficulty
> TotalBlockSizeInLastButOneDifficulty) )
      MaxBlockSize = TotalBlockSizeInLastDifficulty * MaxBlockSize /
TotalBlockSizeInLastButOneDifficulty
  Else If ( ( (Sum of first 4016 block size in last 2 difficulty
period)/4016 < 50% MaxBlockSize) AND (TotalTxFeeInLastDifficulty <
TotalTxFeeInLastButOneDifficulty) AND (TotalBlockSizeInLastDifficulty
< TotalBlockSizeInLastButOneDifficulty) )
      MaxBlockSize = TotalBlockSizeInLastDifficulty * MaxBlockSize /
TotalBlockSizeInLastButOneDifficulty
  Else
      Keep the same MaxBlockSize

==Rationale==

These two proposals have been derived after discussion on
[https://bitcointalk.org/index.php?topic=1154536.0 BitcoinTalk] and
[http://lists.linuxfoundation.org/pipermail/bitcoin-dev/2015-August/010285.html
bitcoin-dev mailing list]. The original idea and its evolution in the
light of various arguements can be found
[http://upalc.com/maxblocksize.php here].

===Proposal 1 : Depending only on previous block size calculation===

This solution is derived directly from the indication of the problem.
If transaction volume increases, then we will naturally see bigger
blocks. On the contrary, if there are not enough transaction volume,
but maximum block size is high, then only few blocks may sweep the
mempool. Hence, if block size is itself taken into consideration, then
maximum block size can most rationally be derived. Moreover, this
solution not only increases, but also decreases the maximum block
size, just like difficulty.

===Proposal 2 : Depending on previous block size calculation and
previous Tx fee collected by miners===

This solution takes care of stable mining subsidy. It will not
increase maximum block size, if Tx fee collection is not increasing
and thereby creating a Tx fee pressure on the market. On the other
hand, though the block size max cap is dynamically controlled, it is
very difficult to game by any party because the increase or decrease
of block size max cap will take place in the same ratio of average
block size increase or decrease.

==Compatibility==

This is a hard-forking change to the Bitcoin protocol; anybody running
code that fully validates blocks must upgrade before the activation
time or they will risk rejecting a chain containing
larger-than-one-megabyte blocks.

==Other solutions considered==

[http://gtf.org/garzik/bitcoin/BIP100-blocksizechangeproposal.pdf
Making Decentralized Economic Policy] - by Jeff Garzik

[https://bitcointalk.org/index.php?topic=1078521.0 Elastic block cap
with rollover penalties] - by Meni Rosenfeld

[https://github.com/bitcoin/bips/blob/master/bip-0101.mediawiki
Increase maximum block size] - by Gavin Andresen

[https://gist.github.com/sipa/c65665fc360ca7a176a6 Block size
following technological growth] - by Pieter Wuille

[https://lightning.network/lightning-network-paper.pdf The Bitcoin
Lightning Network: Scalable Off-Chain Instant Payments] - by Joseph
Poon & Thaddeus Dryja

==Deployment==

If consensus is achieved, deployment can be made at a future block
number at which difficulty will change.

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

<div dir=3D"ltr"><pre style=3D"color:rgb(0,0,0)">Github: <a href=3D"https:/=
/github.com/UpalChakraborty/bips/blob/master/BIP-DynamicMaxBlockSize.mediaw=
iki">https://github.com/UpalChakraborty/bips/blob/master/BIP-DynamicMaxBloc=
kSize.mediawiki</a></pre><pre style=3D"color:rgb(0,0,0)">&lt;pre&gt;
  BIP: 1xx
  Title: Dynamically Controlled Bitcoin Block Size Max Cap
  Author: Upal Chakraborty &lt;<a href=3D"mailto:bitcoin@upalc.com">bitcoin=
@upalc.com</a>&gt;
  Status: Draft
  Type: Standards Track
  Created: 2015-08-24
&lt;/pre&gt;

=3D=3DAbstract=3D=3D

This BIP proposes replacing the fixed one megabyte maximum block size with =
a dynamically controlled maximum block size that may increase or decrease w=
ith difficulty change depending on various network factors. I have two prop=
osals regarding this...

i. Depending only on previous block size calculation.

ii. Depending on previous block size calculation and previous Tx fee collec=
ted by miners.

=3D=3DMotivation=3D=3D

With increased adoption, transaction volume on bitcoin network is bound to =
grow. If the one megabyte max cap is not changed to a flexible one which ch=
anges itself with changing network demand, then adoption will hamper and bi=
tcoin&#39;s growth may choke up. Following graph shows the change in averag=
e block size since inception...

<a href=3D"https://blockchain.info/charts/avg-block-size?timespan=3Dall&amp=
;showDataPoints=3Dfalse&amp;daysAverageString=3D1&amp;show_header=3Dtrue&am=
p;scale=3D0&amp;address=3D">https://blockchain.info/charts/avg-block-size?t=
imespan=3Dall&amp;showDataPoints=3Dfalse&amp;daysAverageString=3D1&amp;show=
_header=3Dtrue&amp;scale=3D0&amp;address=3D</a>

=3D=3DSpecification=3D=3D

=3D=3D=3DProposal 1 : Depending only on previous block size calculation=3D=
=3D=3D

  If more than 50% of block&#39;s size, found in the first 2000 of the last=
 difficulty period, is more than 90% MaxBlockSize
      Double MaxBlockSize
  Else if more than 90% of block&#39;s size, found in the first 2000 of the=
 last difficulty period, is less than 50% MaxBlockSize
      Half MaxBlockSize
  Else
      Keep the same MaxBlockSize

=3D=3D=3DProposal 2 : Depending on previous block size calculation and prev=
ious Tx fee collected by miners=3D=3D=3D
 =20
  TotalBlockSizeInLastButOneDifficulty =3D Sum of all Block size of first 2=
008 blocks in last 2 difficulty period
  TotalBlockSizeInLastDifficulty =3D Sum of all Block size of second 2008 b=
locks in last 2 difficulty period (This actually includes 8 blocks from las=
t but one difficulty)
 =20
  TotalTxFeeInLastButOneDifficulty =3D Sum of all Tx fees of first 2008 blo=
cks in last 2 difficulty period
  TotalTxFeeInLastDifficulty =3D Sum of all Tx fees of second 2008 blocks i=
n last 2 difficulty period (This actually includes 8 blocks from last but o=
ne difficulty)
 =20
  If ( ( (Sum of first 4016 block size in last 2 difficulty period)/4016 &g=
t; 50% MaxBlockSize) AND (TotalTxFeeInLastDifficulty &gt; TotalTxFeeInLastB=
utOneDifficulty) AND (TotalBlockSizeInLastDifficulty &gt; TotalBlockSizeInL=
astButOneDifficulty) )
      MaxBlockSize =3D TotalBlockSizeInLastDifficulty * MaxBlockSize / Tota=
lBlockSizeInLastButOneDifficulty
  Else If ( ( (Sum of first 4016 block size in last 2 difficulty period)/40=
16 &lt; 50% MaxBlockSize) AND (TotalTxFeeInLastDifficulty &lt; TotalTxFeeIn=
LastButOneDifficulty) AND (TotalBlockSizeInLastDifficulty &lt; TotalBlockSi=
zeInLastButOneDifficulty) )
      MaxBlockSize =3D TotalBlockSizeInLastDifficulty * MaxBlockSize / Tota=
lBlockSizeInLastButOneDifficulty
  Else
      Keep the same MaxBlockSize

=3D=3DRationale=3D=3D

These two proposals have been derived after discussion on [<a href=3D"https=
://bitcointalk.org/index.php?topic=3D1154536.0">https://bitcointalk.org/ind=
ex.php?topic=3D1154536.0</a> BitcoinTalk] and [<a href=3D"http://lists.linu=
xfoundation.org/pipermail/bitcoin-dev/2015-August/010285.html">http://lists=
.linuxfoundation.org/pipermail/bitcoin-dev/2015-August/010285.html</a> bitc=
oin-dev mailing list]. The original idea and its evolution in the light of =
various arguements can be found [<a href=3D"http://upalc.com/maxblocksize.p=
hp">http://upalc.com/maxblocksize.php</a> here].

=3D=3D=3DProposal 1 : Depending only on previous block size calculation=3D=
=3D=3D

This solution is derived directly from the indication of the problem. If tr=
ansaction volume increases, then we will naturally see bigger blocks. On th=
e contrary, if there are not enough transaction volume, but maximum block s=
ize is high, then only few blocks may sweep the mempool. Hence, if block si=
ze is itself taken into consideration, then maximum block size can most rat=
ionally be derived. Moreover, this solution not only increases, but also de=
creases the maximum block size, just like difficulty.

=3D=3D=3DProposal 2 : Depending on previous block size calculation and prev=
ious Tx fee collected by miners=3D=3D=3D

This solution takes care of stable mining subsidy. It will not increase max=
imum block size, if Tx fee collection is not increasing and thereby creatin=
g a Tx fee pressure on the market. On the other hand, though the block size=
 max cap is dynamically controlled, it is very difficult to game by any par=
ty because the increase or decrease of block size max cap will take place i=
n the same ratio of average block size increase or decrease.

=3D=3DCompatibility=3D=3D

This is a hard-forking change to the Bitcoin protocol; anybody running code=
 that fully validates blocks must upgrade before the activation time or the=
y will risk rejecting a chain containing larger-than-one-megabyte blocks.

=3D=3DOther solutions considered=3D=3D

[<a href=3D"http://gtf.org/garzik/bitcoin/BIP100-blocksizechangeproposal.pd=
f">http://gtf.org/garzik/bitcoin/BIP100-blocksizechangeproposal.pdf</a> Mak=
ing Decentralized Economic Policy] - by Jeff Garzik

[<a href=3D"https://bitcointalk.org/index.php?topic=3D1078521.0">https://bi=
tcointalk.org/index.php?topic=3D1078521.0</a> Elastic block cap with rollov=
er penalties] - by Meni Rosenfeld

[<a href=3D"https://github.com/bitcoin/bips/blob/master/bip-0101.mediawiki"=
>https://github.com/bitcoin/bips/blob/master/bip-0101.mediawiki</a> Increas=
e maximum block size] - by Gavin Andresen

[<a href=3D"https://gist.github.com/sipa/c65665fc360ca7a176a6">https://gist=
.github.com/sipa/c65665fc360ca7a176a6</a> Block size following technologica=
l growth] - by Pieter Wuille

[<a href=3D"https://lightning.network/lightning-network-paper.pdf">https://=
lightning.network/lightning-network-paper.pdf</a> The Bitcoin Lightning Net=
work: Scalable Off-Chain Instant Payments] - by Joseph Poon &amp; Thaddeus =
Dryja

=3D=3DDeployment=3D=3D

If consensus is achieved, deployment can be made at a future block number a=
t which difficulty will change.</pre></div>

--001a113f3c70b25ba2051e1f0fd0--