Subject: [bitcoin-dev] Variable Block Size Proposal

From: "Justin M. Wray" <[email-masked]>
Date: Sat, 29 Aug 2015 01:41:03 -0400

Hey Bitcoiners!

While I am an avid Bitcoin supporter, long-term user, and have done
development work on tools and platforms surrounding Bitcoin, I have
been very busy these past few weeks and haven't had a chance to fully
(or closely) monitor the Block Size debate.

I'm familiar with the basics, and have read abstracts about the
front-running proposals (BIP 100, 101, and 102). Though I've honestly
not read those in depth either. With that said, I was driving
the other day and thought of a potential idea. I'll be clear, this is
just an idea, and I haven't fully fleshed it out. But I thought I'd
throw it out there and see what people thought.

My Goal:

Provide a variable block size that provides for sustainable, long-term
growth, and balances the block propagation, while also being mindful
of potential spam attacks.

The Proposal:

Every 2016 blocks (approximately every two weeks, at the same time the
difficulty is adjusted), the new block size parameters are calculated.

The calculation determines the average (mean) size of the past 2016
blocks. This "average" size is then doubled (200%) and used as the
maximum block size for the subsequent 2016 blocks. At any point, if
the new maximum size is calculated to be below 1MB, 1MB is used
instead (which prevents regression from our current state).

Introduce a block minimum, the minimum will be 25% of the current
maximum, calculated at the same time (that is, every 2016 blocks, at
the same time the maximum is calculated). All blocks must be at least
this size in order to be valid, for blocks that do not have enough
transactions to meet the 25%, padding will be used. This devalues the
incentive to mine empty blocks in either an attempt to deflate the
block size, or to obtain a propagation advantage. Miners will be
incentivized to include transactions, as the block must meet the
minimum. This should ensure that even miners wishing to always mine
the minimum are still confirming Bitcoin transactions.

At the block in which this is introduced the maximum would stay at 1MB
for the subsequent 2016 blocks. With the minimum being enforced of 256KB
.

Example:

    * Average Block Size for the last 2016 blocks: 724KB
    * New Maximum: 1448KB
    * New Minimum: 362KB

Example: (Regression Prevention)

    * Average Block Size for the last 2016 blocks: 250KB
    * New Maximum: 1MB
    * New Minimum: 256KB

The Future:

I believe that the 1MB regression prevention might need to be changed
in the future, to prevent a large mining population from continually
deflating the block size (and keeping us at the 1MB limit).

For this, the hard limit could be changed in the future manually,
through a process similar to the current one, though hopefully with
far less urgency and hysteria.

Another option is to add an additional calculation, preventing the new
maximum from being lower than 75% of the current maximum. This would
substantially slow down a block-size deflation attack.

 Example of Block-Size Deflation Attack Prevention:

 * Average Block Size for the last 2016 blocks:  4MB
 * New Maximum:  8MB
 * New Minimum:  2MB

 * Average Block Size for the last 2016 blocks:  2MB
 * New Maximum:  6MB  (2 * 200% = 4, 4< 75% of 8, So use 8 * .75 = 6)
 * New Minimum:  1.5MB

This would provide a maximum growth of 200% per recalculation, but a
maximum shrinkage of 75%.

Request For Comments:

I'd love to hear your thoughts. Why wouldn't this work? What portion
is flawed? Will the miners support such a proposal? Would this even
solve the block size issue?

I will note that I don't find the 100% and 25% to be hard and fast in
my idea. Those we're just the values that initially jumped out at me.
I could easily see the minimum being anything below 50% (above 50% and
the network can never adjust to smaller block sizes). I could also see
the maximum being anything over 100%.  Lastly, if a inflation attack
is a valid concern, a hard upper limit could be set (or the historical
32MB limit could remain).

I think the great part about this variable approach is that the
network can adjust to address spikes in volume and readjust once those
spikes dissipate.

- -- 
Thanks!

- -----
Justin M. Wray