Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 86A5A5AC for ; Mon, 5 Dec 2016 15:27:34 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-ua0-f182.google.com (mail-ua0-f182.google.com [209.85.217.182]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id F24C4165 for ; Mon, 5 Dec 2016 15:27:33 +0000 (UTC) Received: by mail-ua0-f182.google.com with SMTP id b35so350947189uaa.3 for ; Mon, 05 Dec 2016 07:27:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=CyQM76TjyNwEORJT/ppGyc+VHXP0WcbeH931UI3+Olk=; b=dgXeWMTMFHe4WRKVrsz/gLYXXV7FA6cyBF74M8YGIk2St0iMYei25kMC5FSvfpOkv5 60gksDKyiTN7TaHqJerE0to7tWaYBU9yDq7fSmb4nOnSqaItwvCMUVDJMB6ldNH+U0+z TLOkfx9X5EqvAhzn55a995ArFrks7dBfEjd7igDi0be2EKU00THo0QoMB3/VCmoIc8k2 1nebb1ycTQ53+Ef5BWvS7Ev7OlQWnpAsmXXecmiYV9P0oJKSiVYFX2ENlolyocDU4iaU mrgMB6jchf6KoZ1YmUxkrLpZXpNj9rtVroadPrfccs3fy2X17DfhgasZJoBDwioKZPfc TZ6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=CyQM76TjyNwEORJT/ppGyc+VHXP0WcbeH931UI3+Olk=; b=OU/9zAzB5y6w+CcpV5y8l4A8gCJ3KNurmQmbwdMQn1mQ1HKN3ZVd4o5R0J5SNPcfk5 zaTzW9MOTNNwvkK+qw2hF2TR0xoByAW9N0S6lDYNem+YdO086MeQXpqHvqyvGp+bG3cg Qp/7NZbA5pPzA0LkG8sNON1XBLW4jTpqhfFYslrGiOPxoIHTcKomSfr7dHN3XY7Z19WU vlRDIcdVeMD4w9JB2MhsZuCDQ4QzDm8uSy+anu3nhVE0J0eqT2EhdTHlBUW4SO8U0tQM beoeikYh8UL000NpfCcxIa6VU829nhE5z/93T4fWMMwWN8EcPGXtkgyG8RFE5ZfY4Sib mRIQ== X-Gm-Message-State: AKaTC03dk1s+mYMmqarfgJjqeUTw022WfnijBGs+YD3peTveyKbJgoY5Rbss78PVl/9HJAYHMpAREuY2iBJhBA== X-Received: by 10.176.86.23 with SMTP id y23mr34612032uaa.88.1480951653003; Mon, 05 Dec 2016 07:27:33 -0800 (PST) MIME-Version: 1.0 Received: by 10.103.49.144 with HTTP; Mon, 5 Dec 2016 07:27:32 -0800 (PST) From: "t. khan" Date: Mon, 5 Dec 2016 10:27:32 -0500 Message-ID: To: bitcoin-dev@lists.linuxfoundation.org Content-Type: multipart/alternative; boundary=f403045daa6634f4ac0542eaed44 X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org X-Mailman-Approved-At: Sat, 10 Dec 2016 10:21:47 +0000 Subject: [bitcoin-dev] Managing block size the same way we do difficulty (aka Block75) X-BeenThere: bitcoin-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Bitcoin Protocol Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2016 15:27:34 -0000 --f403045daa6634f4ac0542eaed44 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable BIP Proposal - Managing Bitcoin=E2=80=99s block size the same way we do dif= ficulty (aka Block75) The every two-week adjustment of difficulty has proven to be a reasonably effective and predictable way of managing how quickly blocks are mined. Bitcoin needs a reasonably effective and predictable way of managing the maximum block size. It=E2=80=99s clear at this point that human beings should not be involved i= n the determination of max block size, just as they=E2=80=99re not involved in de= ciding the difficulty. Instead of setting an arbitrary max block size (1MB, 2MB, 8MB, etc.) or passing the decision to miners/pool operators, the max block size should be adjusted every two weeks (2016 blocks) using a system similar to how difficulty is calculated. Put another way: let=E2=80=99s stop thinking about what the max block size = should be and start thinking about how full we want the average block to be regardless of size. Over the last year, we=E2=80=99ve had averages of 75% o= r higher, so aiming for 75% full seems reasonable, hence naming this concept =E2=80=98Block75=E2=80=99. The target capacity over 2016 blocks would be 75%. If the last 2016 blocks are more than 75% full, add the difference to the max block size. Like this= : MAX_BLOCK_BASE_SIZE =3D 1000000 TARGET_CAPACITY =3D 750000 AVERAGE_OVER_CAP =3D average block size of last 2016 blocks minus TARGET_CAPACITY To check if a block is valid, =E2=89=A4 (MAX_BLOCK_BASE_SIZE + AVERAGE_OVER= _CAP) For example, if the last 2016 blocks are 85% full (average block is 850 KB), add 10% to the max block size. The new max block size would be 1,100 KB until the next 2016 blocks are mined, then reset and recalculate. The 1,000,000 byte limit that exists currently would remain, but would effectively be the minimum max block size. Another two weeks goes by, the last 2016 blocks are again 85% full, but now that means they average 935 KB out of the 1,100 KB max block size. This is 93.5% of the 1,000,000 byte limit, so 18.5% would be added to that to make the new max block size of 1,185 KB. Another two weeks passes. This time, the average block is 1,050 KB. The new max block size is calculated to 1,300 KB (as blocks were 105% full, minus the 75% capacity target, so 30% added to max block size). Repeat every 2016 blocks, forever. If Block75 had been applied at the difficulty adjustment on November 18th, the max block size would have been 1,080KB, as the average block during that period was 83% full, so 8% is added to the 1,000KB limit. The current size, after the December 2nd adjustment would be 1,150K. Block75 would allow the max block size to grow (or shrink) in response to transaction volume, and does so predictably, reasonably quickly, and in a method that prevents wild swings in block size or transaction fees. It attempts to keep blocks at 75% total capacity over each two week period, the same way difficulty tries to keep blocks mined every ten minutes. It also keeps blocks as small as possible. Thoughts? -t.k. --f403045daa6634f4ac0542eaed44 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
BIP Proposal - Managing Bitcoin=E2=80=99s block size the s= ame way we do difficulty (aka Block75)

The every two-week adjus= tment of difficulty has proven to be a reasonably effective and predictable= way of managing how quickly blocks are mined. Bitcoin needs a reasonably e= ffective and predictable way of managing the maximum block size.

It=E2=80=99s clear at this point that human beings should not be involved= in the determination of max block size, just as they=E2=80=99re not involv= ed in deciding the difficulty.

Instead of setting = an arbitrary max block size (1MB, 2MB, 8MB, etc.) or passing the decision t= o miners/pool operators, the max block size should be adjusted every two we= eks (2016 blocks) using a system similar to how difficulty is calculated.
Put another way: let=E2=80=99s stop thinking about what the max = block size should be and start thinking about how full we want the average = block to be regardless of size. Over the last year, we=E2=80=99ve had avera= ges of 75% or higher, so aiming for 75% full seems reasonable, hence naming= this concept =E2=80=98Block75=E2=80=99.

The target capacity ov= er 2016 blocks would be 75%. If the last 2016 blocks are more than 75% full= , add the difference to the max block size. Like this:

MAX_BL= OCK_BASE_SIZE =3D 1000000
TARGET_CAPACITY =3D 750000
AVERAGE_= OVER_CAP =3D average block size of last 2016 blocks minus TARGET_CAPACITY

To check if a block is valid, =E2=89=A4 (MAX_BLOCK_BASE_SIZE += AVERAGE_OVER_CAP)

For example, if the last 2016 blocks are 85%= full (average block is 850 KB), add 10% to the max block size. The new max= block size would be 1,100 KB until the next 2016 blocks are mined, then re= set and recalculate. The 1,000,000 byte limit that exists currently would r= emain, but would effectively be the minimum max block size.=C2=A0

Another two weeks goes by, the last 2016 blocks are again 85% full, but = now that means they average 935 KB out of the 1,100 KB max block size. This= is 93.5% of the 1,000,000 byte limit, so 18.5% would be added to that to m= ake the new max block size of 1,185 KB.

Another two weeks passe= s. This time, the average block is 1,050 KB. The new max block size is calc= ulated to 1,300 KB (as blocks were 105% full, minus the 75% capacity target= , so 30% added to max block size).

Repeat every 2016 blocks, = forever.

If Block75 had been applied at the difficulty adjustme= nt on November 18th, the max block size would have been 1,080KB, as the ave= rage block during that period was 83% full, so 8% is added to the 1,000KB l= imit. The current size, after the December 2nd adjustment would be 1,150K.<= br>
Block75 would allow the max block size to grow (or shrink) in r= esponse to transaction volume, and does so predictably, reasonably quickly,= and in a method that prevents wild swings in block size or transaction fee= s. It attempts to keep blocks at 75% total capacity over each two week peri= od, the same way difficulty tries to keep blocks mined every ten minutes. I= t also keeps blocks as small as possible.

Thoughts?

-t.k.
--f403045daa6634f4ac0542eaed44--