Skip to content

Commit 872bda3

Browse files
committed
Merge BIP 104: 'Block75' - Max block size like difficulty
2 parents 04875c6 + 834db1b commit 872bda3

File tree

3 files changed

+86
-0
lines changed

3 files changed

+86
-0
lines changed

README.mediawiki

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,13 @@ Those proposing changes should consider that ultimately consent may rest with th
435435
| Standard
436436
| Draft
437437
|-
438+
| [[bip-0104.mediawiki|104]]
439+
| Consensus (hard fork)
440+
| 'Block75' - Max block size like difficulty
441+
| t.khan
442+
| Standard
443+
| Draft
444+
|-
438445
| [[bip-0105.mediawiki|105]]
439446
| Consensus (hard fork)
440447
| Consensus based block size retargeting algorithm

bip-0104.mediawiki

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<pre>
2+
BIP: 104
3+
Layer: Consensus (hard fork)
4+
Title: 'Block75' - Max block size like difficulty
5+
Author: t.khan <[email protected]>
6+
Comments-Summary: No comments yet.
7+
Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0104
8+
Status: Draft
9+
Type: Standards Track
10+
Created: 2017-01-13
11+
License: BSD-2-Clause
12+
GNU-All-Permissive
13+
</pre>
14+
15+
==Abstract==
16+
17+
Automatic adjustment of max block size with the target of keeping blocks 75% full, based on the average block size of the previous 2016 blocks. This would be done on the same schedule as difficulty.
18+
19+
==Motivation==
20+
21+
Blocks are already too full and cannot support further transaction growth. While SegWit and Lightning (and other off-chain solutions) will help, they will not solve this problem.
22+
23+
Bitcoin needs a reasonably effective and predictable way of managing the maximum block size which allows moderate growth, keeps max block size as small as possible, and prevents wild swings in transaction fees.
24+
25+
The every two-week and automatic adjustment of difficulty has proven to be a reasonably effective and predictable way of managing how quickly blocks are mined. It works well because humans aren’t involved (except for setting the original target of a 10 minute per block average), and therefore it isn’t political or contentious. It’s simply a response to changing network resources.
26+
27+
It’s clear at this point that human beings should not be involved in the determination of max block size, just as they’re not involved in deciding the difficulty. Therefore, it is logical and consistent with Bitcoin’s design to implement a permanent solution which, as with the difficulty adjustment, is simply an automatic response to changing transaction volumes. With the target of keeping blocks 75% full on average, this is the goal of Block75.
28+
29+
30+
==Specification==
31+
32+
The max block size will be recalculated every 2016 blocks, along with difficulty, using Block75’s simple algorithm:
33+
34+
<code>
35+
new max block size = x + (x * (AVERAGE_CAPACITY - TARGET_CAPACITY))
36+
</code>
37+
38+
* TARGET_CAPACITY = 0.75    //Block75's target of keeping blocks 75% full
39+
* AVERAGE_CAPACITY = average percentage full of the last 2016 blocks, as a decimal
40+
* x = current max block size
41+
42+
43+
All code which generates/validates blocks or uses/references the current hardcoded limits will need to be changed to support Block75.
44+
45+
==Rationale==
46+
47+
The 75% full block target was selected because:
48+
* it is the middle ground between blocks being too small (average 100% full) and blocks being unnecessarily large (average 50% full)
49+
* it can handle short-term spikes in transaction volume of up to 33%
50+
* it limits the growth of max block size to less than 25% over the previous period
51+
* it will maintain average transaction fees at a stable level similar to that of May/June 2016
52+
53+
The 2016 block (~2 weeks) period was selected because:
54+
* it has been shown to be reasonably adaptive to changing network resources (re: difficulty)
55+
* the frequent and gradual adjustments that result will be relatively easy for miners and node operators to predict and adapt to, as any unforeseen consequences will be visible well in advance
56+
* it minimizes any effect a malicious party could have in an attempt to manipulate max block size
57+
58+
The Block75 algorithm will adjust the max block size up and down in response to transaction volume, including changes brought on by SegWit and Lightning. This is important as it will keep average transaction fees stable, thereby allowing miners and businesses using Bitcoin more certainty regarding future income/expenses.
59+
60+
==Other solutions considered==
61+
A hardcoded increase to max block size (2MB, 8MB, etc.), rejected because:
62+
* only a temporary solution, whatever limit was chosen would inevitably become a problem again
63+
* would cause transaction fees to vary wildly over time
64+
65+
Allow miners to vote for max block size, rejected because:
66+
* overly complex and political
67+
* human involvement makes this slow to respond to changing transaction volumes
68+
* focuses power over max block size to a relatively small group of people
69+
* unpredictable transaction fees caused by this would create uncertainty in the ecosystem
70+
71+
==Backward Compatibility==
72+
This BIP is not backward compatible (hard fork). Any code which fully validates blocks must be upgraded prior to activation, as failure to do so will result in rejection of blocks over the current 1MB limit.
73+
74+
==Activation==
75+
To help negate some of the risks associated with a hard fork and to prevent a single relatively small mining pool from preventing Block75's adoption, activation would occur at the next difficulty adjustment once 900 of the last 1,000 blocks mined signal support and a grace period of 4,032 blocks (~1 month) has elapsed.
76+
77+
==Copyright==
78+
This BIP is dual-licensed under the BSD 2-clause license and the GNU All-Permissive License.

scripts/buildtable.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
$field = $1;
108108
$val = $2;
109109
die "Duplicate $field field in $fn" if exists $found{$field};
110+
die "Too many spaces in $fn" if $val =~ /^\s/;
110111
} elsif (m[^ ( +)(.*\S)$]) {
111112
die "Continuation of non-field in $fn" unless defined $field;
112113
die "Too many spaces in $fn" if length $1 != 2 + length $field;

0 commit comments

Comments
 (0)