Subject: [bitcoin-dev] BIP proposal - Max block size

From: Erik <[email-masked]>
Date: Fri, 13 Nov 2015 14:07:33 +0100

Hi devs. I was discussing the BIP proposals concerning max block size
yesterday in the #bitcoin channel. I believe that BIP101 fully utilized
will outperform consumer hardware soon or later and thereby centralize
Bitcoin. I would therefore like to do a different proposal:

Motivations:
* BIP101 propose a doubling of the block max size every second year.
This is very fast and may make the blockchain to grow faster than
consumer hardware can cope with.
* BIP102 is only a one-time solution, thus a new discussion of the next
block max size will need to arise soon after it has been implemented.
* BIP100 is an interesting solution in that the miners vote on the block
max size. Althoigh it has several cons: 1) The block max size can never
extend 32 MiB, even if we are so far in the future that it is need for
larger blocks. 2) The block max size could reach a size of 32 MiB in a
rather fast manner if pools vote for it, even though consumer hardware
today isn't really ready for the growth it implicates. 3) Block max size
can be pushed backwards, which will make TX fees higher, cause a lot of
orphaned low-fee TXes. It could make some smaller mining pools dependant
on lots of TXes with fees unprofitable. It is a serious flaw which could
damage the trust of the network.
* We does not for sure know how the evolution will proceed and if there
will be storage for the larger block chain in the future.
* There is a benefit of having a limit on the amount of transactions
that will be processed in that the fees will rise.
* Also there is a large problem if the fees rise too high because it
will prevent mainstream users from using the network. There will also be
a lot of orphan TXes which will cause uncertainity and fear of losses
among users that don't know how bitcoin works.
* Pruning is a problem if the blockchain grows too fast because some,
although a few, nodes still must store the complete data -> centralization.

Concepts:
There is always a growth in the block max size. Never a decrease.
The growth rate desicion should be in the hands of the miners.
It's good to have limits on the block max size to keep back spam TXes.
Use rules that makes a more smooth and predictable growth.

Rules:
1) Main target growth is 2^(1/2) every second year, or a doubling of the
block max size every four years.
2) The growth rate every second year will strictly be limited by the
formula 2^2 > growth > linear growth.
3) The target growth could be modified with positive or negative votes,
but it will not exceed the limits of 2) in any direction. Miners could
also choose to not vote.
4) The linear y=kx+m will be formed from the genesis block date with
size 1 MiB (m) through the last retarget block date with current size.
5) Target growth is based on votes from the last 26280 blocks (half a year).
6) Block max size grows at the same time as block difficulty retarget
(2016 blocks) with the formula 2^(((1/2)+(1/2*amount positive
votes)-(1/2*amount negative votes))/52). If the votes propose a lower
growth than the linear, use the linear growth instead. Block size is
floored to byte precision.
7) Amount positive/negative votes are calculated as following: number of
votes, positive or negative / 26280.
8) When this rule are put in force, the block max size will immidiately
be set to 4 MiB.

Notes:
* The number 52 came from 52 weeks/year * 2 years / 2 weeks. It measures
number of week pairs or difficulty retargets per two years.
* When there are no votes, the growth speed is set as main target as in
1). Also blocks mined before the implementation counts as blocks with no
votes.

Examples:
* After implementation, the block max size will be 4 MiB.
* At the first retarget, if no miner has left a vote, or equal number of
votes exists for positive and negative side. Then the next block max
size is 4096 KiB*2^((1/2)/52)=4123.3905 KiB (or exactly 4 222 351 bytes)
* If the block max size is exactly 11 MiB, it has been exactly 10 years
and 2 weeks since the genesis block, the next block is a retarget and
every vote is negative. Then 2^(((1/2)-(1/2))/52) = 1. It is lower than
the linear, then the next block max size will follow the linear derived
from: (11 MiB - 1 MiB) / (10.00 years) = 1 = k. Formula for a linear is
y=kx+m. m is the genesis block max size in MiB. Then y = 1 * (10+1/52) +
1 = 11.019 [MiB] (or exactly 11 554 500 bytes)
* If everyone in the past example continue voting negative for the next
four years, then the block max size will then be y = 1*14 + 1 = 15 [MiB].
* If the block max size was 10 MiB four years ago and every miner
instead has put positive votes into the block chain since 4.5 years,
then the block max size now is 10 MiB * 2^( ((1/2+1/2)/(52)) * 2) = 10
MiB * 4 = 40 MiB
* If there was 2628 negative votes and 5256 positive votes in the last
26280 blocks, then the formula will look like:
size*2^(((1/2)+(1/2*0.2)-(1/2*0.1))/52)

Pros:
Provides a long term solution that give opportunities to the network to
itself cope with the actual state and hardware limits of the future
network. No need to make a hard fork to adapt to other growth rates
within this proposal's limits.
Provides a smooth growth rate based on a large consensus, thus making
the growth for the near future almost predictable. No big jumps in block
max size provides stability to the network.
Miners can choose pools that votes in a way that conforms to the miners
interest.
Eliminates fluctuating block size as could happen with BIP100 proposal.

Cons:
A few single, large entities could either vote for smaller growth of
blocks for a long time, causing TX congestion and mistrust in the
bitcoin network. On the contrary they could vote for a larger growth of
blocks, causing the blockchain to be too large for consumer hardware. It
will then result in fewer nodes and in worst cases closing of small
pools. These cases seems to be extremely unlikely partly because of the
time and mining power that will be needed, partly also because of limits
in how much the votes can adjust the growth rate. It would therefore not
pose a large risk.

Sincerely,
Erik Fors