If you want to know more about that big blocksize 20M proposal by Gavin Anderson,
Check these posts:
![](https://ip.bitcointalk.org/?u=https%3A%2F%2Fi.imgur.com%2F9VJ5S58.jpg&t=665&c=hKbQ8qcRY9qkkA)
1
http://www.gavintech.blogspot.hk/2015/01/looking-before-scaling-up-leap.htmlI just had to figure out how to repackage them into bigger blocks. After a couple of false starts over a couple of frustrating days (wouldn't it be nice if our ideas always worked perfectly the first time?), I came up with the following scheme:
First, I hacked the reference implementation and changed some constants related to the block size (MAX_BLOCK_SIZE, DEFAULT_BLOCK_MAX_SIZE, MAX_BLOCKFILE_SIZE). That part is easy.
The tricky bit is how to take transactions from the 1-MB and repackage them in bigger blocks. For most transactions, it is trivial, because ordinary transactions don't care what block they are in.
There are two exceptions:
1. Transactions that use the 'locktime' feature so they are not valid until a particular block height or date. I dealt with these by simply treating all transactions as 'final'.
2. There are special rules for 'coinbase' transactions: there can be only one coinbase transaction per block, it must be the first transaction, etc. My first couple of false starts went down the path of relaxing those rules, but I gave up that approach because I found myself changing more and more code. I think if I was 22 years old I probably would have just forged ahead, unwilling to let go of a couple of days of programming effort because "just one more change and it will probably all start to work..."
I wonder if old programmers throw away more code than young programmers. I bet we do.
Anyway, after a rethink I came up with a much cleaner solution for handling coinbase transactions from the real blockchain: I write them to a 'coinbasetx.dat' file which the hacked bitcoind reads at startup and stores in memory (there are only 73 megabytes of them). As blocks are added to the big-block chain, those coinbases are added to the "unspent transaction output set" so they are available to be spent (and I set the COINBASE_MATURITY constant to zero instead of 100, so they can be spent right away, in the same big block).
I wrote a tool ("gen_megablocks") that creates the coinbasetx.dat file and blk*.dat files that are valid-but-oversized, -regtest-mode blocks.
2
https://blog.bitcoinfoundation.org/a-scalability-roadmap/My rough proposal for optimizing new block announcements resulted in lots of discussion about lots of scaling-up issues. There was some misunderstanding that optimizing new block messages would be a silver bullet that would solve all of the challenges Bitcoin will face as usage grows; this blog post is meant to sketch out one possible path for the behind-the-scenes technical work that is being done (or will need to get done) over the next few years to scale up Bitcoin.
3
http://gavintech.blogspot.de/2015/01/twenty-megabytes-testing-results.htmlBut then we need a concrete proposal for exactly how to increase the size. Here's what I will propose:
Current rules if no consensus as measured by block.nVersion supermajority.
Supermajority defined as: 800 of last 1000 blocks have block.nVersion == 4
Once supermajority attained, block.nVersion < 4 blocks rejected.
After consensus reached: replace MAX_BLOCK_SIZE with a size calculated based on starting at 2^24 bytes (~16.7MB) as of 1 Jan 2015 (block 336,861) and doubling every 6*24*365*2 blocks -- about 40% year-on-year growth. Stopping after 10 doublings.
The perfect exponential function:
size = 2^24 * 2^((blocknumber-336,861)/(6*24*365*2))
... is approximated using 64-bit-integer math as follows:
double_epoch = 6*24*365*2 = 105120
(doublings, remainder) = divmod(blocknumber-336861, double_epoch)
if doublings >= 10 : (doublings, remainder) = (10, 0)
interpolate = floor ((2^24 << doublings) * remainder / double_epoch)
max_block_size = (2^24 << doublings) + interpolate
This is a piecewise linear interpolation between doublings, with maximum allowed size increasing a little bit every block.
![](https://ip.bitcointalk.org/?u=https%3A%2F%2Fi.imgur.com%2Ftyo8MbN.png&t=665&c=QvK5eHYhx2srDw)
4 bitbean source code main.h
https://github.com/nokat/bitbean/blob/master/src/main.hfrom line 34
static const unsigned int MAX_BLOCK_SIZE = 20000000;
static const unsigned int MAX_BLOCK_SIZE_GEN = MAX_BLOCK_SIZE/2;
static const unsigned int MAX_BLOCK_SIGOPS = MAX_BLOCK_SIZE/50;
static const unsigned int MAX_ORPHAN_TRANSACTIONS = MAX_BLOCK_SIZE/100;
static const unsigned int MAX_INV_SZ = 50000;
static const int64_t MIN_TX_FEE = 1000000;
.....
![](https://ip.bitcointalk.org/?u=https%3A%2F%2Fi.imgur.com%2FcLh1EHM.png&t=665&c=T-jCAzo_wM_BwQ)