From 2a9e9503cd8604d36f966b95005ef7a88ee979c6 Mon Sep 17 00:00:00 2001 From: "t.khan" Date: Fri, 13 Jan 2017 18:23:15 -0500 Subject: [PATCH 1/5] Create bip-tkhan-block75.mediawiki --- bip-tkhan-block75.mediawiki | 77 +++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 bip-tkhan-block75.mediawiki diff --git a/bip-tkhan-block75.mediawiki b/bip-tkhan-block75.mediawiki new file mode 100644 index 00000000..c8f21cf4 --- /dev/null +++ b/bip-tkhan-block75.mediawiki @@ -0,0 +1,77 @@ +
+  BIP: ?
+  Layer: Consensus (hard fork)
+  Title: ‘Block75’ - Max block size like difficulty
+  Author: t.khan 
+  Comments-Summary: No comments yet.
+  Comments-URI: TBD
+  Status: Draft
+  Type: Standards Track
+  Created: 2017-01-13
+  License:  BSD-2, GNU-AP
+
+ +==Abstract== + +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. + +==Motivation== + +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. + +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. + +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. + +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. + + +==Specification== + +The max block size will be recalculated every 2016 blocks, along with difficulty, using Block75’s simple algorithm: + + +new max block size = x + (x * (AVERAGE_CAPACITY - TARGET_CAPACITY)) + + +* TARGET_CAPACITY = 0.75    //Block75's target of keeping blocks 75% full +* AVERAGE_CAPACITY = average percentage full of the last 2016 blocks, as a decimal +* x = current max block size + + +All code which generates/validates blocks or uses/references the current hardcoded limits will need to be changed to support Block75. + +==Rationale== + +The 75% full block target was selected because: +* it is the middle ground between blocks being too small (average 100% full) and blocks being unnecessarily large (average 50% full) +* it can handle short-term spikes in transaction volume of up to 33% +* it limits the growth of max block size to less than 25% over the previous period +* it will maintain average transaction fees at a stable level similar to that of May/June 2016 + +The 2016 block (~2 weeks) period was selected because: +* it has been shown to be reasonably adaptive to changing network resources (re: difficulty) +* 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 +* it minimizes any effect a malicious party could have in an attempt to manipulate max block size + +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. + +==Other solutions considered== +A hardcoded increase to max block size (2MB, 8MB, etc.), rejected because: +* only a temporary solution, whatever limit was chosen would inevitably become a problem again +* would cause transaction fees to vary wildly over time + +Allow miners to vote for max block size, rejected because: +* overly complex and political +* human involvement makes this slow to respond to changing transaction volumes +* focuses power over max block size to a relatively small group of people +* unpredictable transaction fees caused by this would create uncertainty in the ecosystem + +==Backward Compatibility== +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. + +==Activation== +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. + +==Copyright== +This BIP is dual-licensed under the BSD 2-clause license and the GNU All-Permissive License. From 95dfd21ea2a292a4a27b05988054753f80923d09 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Sat, 14 Jan 2017 07:03:49 +0000 Subject: [PATCH 2/5] scripts/buildtable: Check for extraneous spaces after header name --- scripts/buildtable.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/buildtable.pl b/scripts/buildtable.pl index 981346b2..0de4a366 100755 --- a/scripts/buildtable.pl +++ b/scripts/buildtable.pl @@ -107,6 +107,7 @@ while (++$bipnum <= $topbip) { $field = $1; $val = $2; die "Duplicate $field field in $fn" if exists $found{$field}; + die "Too many spaces in $fn" if $val =~ /^\s/; } elsif (m[^ ( +)(.*\S)$]) { die "Continuation of non-field in $fn" unless defined $field; die "Too many spaces in $fn" if length $1 != 2 + length $field; From 0262ba0288ead694442e45f5cefeabd21c965fa0 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Sat, 14 Jan 2017 07:02:41 +0000 Subject: [PATCH 3/5] BIP 104: Use ASCII quotes in Title --- bip-tkhan-block75.mediawiki | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bip-tkhan-block75.mediawiki b/bip-tkhan-block75.mediawiki index c8f21cf4..1aa91e86 100644 --- a/bip-tkhan-block75.mediawiki +++ b/bip-tkhan-block75.mediawiki @@ -1,7 +1,7 @@
   BIP: ?
   Layer: Consensus (hard fork)
-  Title: ‘Block75’ - Max block size like difficulty
+  Title: 'Block75' - Max block size like difficulty
   Author: t.khan 
   Comments-Summary: No comments yet.
   Comments-URI: TBD

From 5d80de82cf5a8d115ad1798b94618ca30d6cca0d Mon Sep 17 00:00:00 2001
From: Luke Dashjr 
Date: Sat, 14 Jan 2017 07:03:16 +0000
Subject: [PATCH 4/5] BIP 104: Fix License header

---
 bip-tkhan-block75.mediawiki | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/bip-tkhan-block75.mediawiki b/bip-tkhan-block75.mediawiki
index 1aa91e86..69d966e4 100644
--- a/bip-tkhan-block75.mediawiki
+++ b/bip-tkhan-block75.mediawiki
@@ -8,7 +8,8 @@
   Status: Draft
   Type: Standards Track
   Created: 2017-01-13
-  License:  BSD-2, GNU-AP
+  License: BSD-2-Clause
+           GNU-All-Permissive
 
==Abstract== From 834db1b0fbcff8ca97c28192e33c6b49063adcb8 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Sat, 14 Jan 2017 07:01:54 +0000 Subject: [PATCH 5/5] Assign BIP 104 for Block75 --- README.mediawiki | 7 +++++++ bip-tkhan-block75.mediawiki => bip-0104.mediawiki | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) rename bip-tkhan-block75.mediawiki => bip-0104.mediawiki (98%) diff --git a/README.mediawiki b/README.mediawiki index 3ffa4665..1398ca38 100644 --- a/README.mediawiki +++ b/README.mediawiki @@ -435,6 +435,13 @@ Those proposing changes should consider that ultimately consent may rest with th | Standard | Draft |- +| [[bip-0104.mediawiki|104]] +| Consensus (hard fork) +| 'Block75' - Max block size like difficulty +| t.khan +| Standard +| Draft +|- | [[bip-0105.mediawiki|105]] | Consensus (hard fork) | Consensus based block size retargeting algorithm diff --git a/bip-tkhan-block75.mediawiki b/bip-0104.mediawiki similarity index 98% rename from bip-tkhan-block75.mediawiki rename to bip-0104.mediawiki index 69d966e4..00db9a3b 100644 --- a/bip-tkhan-block75.mediawiki +++ b/bip-0104.mediawiki @@ -1,10 +1,10 @@
-  BIP: ?
+  BIP: 104
   Layer: Consensus (hard fork)
   Title: 'Block75' - Max block size like difficulty
   Author: t.khan 
   Comments-Summary: No comments yet.
-  Comments-URI: TBD
+  Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0104
   Status: Draft
   Type: Standards Track
   Created: 2017-01-13