The charts are generated based on historical Bitcoin livenet block sizes (CSV). The orange line represents the maximum block size. Each black dot on the graph represents a block, where the y coordinate as the bytes of the block and the x as the block height. Each graph is biased by 100,000 bytes on the y-axis for illustration purposes, so that viewers can see that there is a line distinct from the x-axis.
These graphs show various range of previous blocks used to calculate the median. The maximum block size is the median doubled with an additional 100,000 bytes added, and recalculated once a week.
The graphs show various multipliers applied to the median. They all use a sample size of 3 months (12,960 blocks), with 100,000 bytes added, and calculated once a week.
The graphs show variations of the interval that the maximum block size is calculated, in a similar way that the mining difficulty changes once every 2016 blocks. All graphs use a three month median multiplied by 2 with 100,000 bytes added.
These graphs show variations of methods for calculating the moving median and average. All graphs use a sample size of three months multiplied by 2, with 100,000 bytes added, and recalculated for every block.
function movingMedian(range) {
range.sort(function(a, b) {
return a - b;
});
var even = (range.length % 2 === 0);
var m;
if (even) {
var mid = range.length / 2;
var sum = range[mid] + range[mid + 1];
m = Math.round(sum / 2);
} else {
var mid = Math.floor(range.length / 2);
m = range[mid];
}
return m;
}
function movingAverage(range) {
var total = range.length;
var sum = range.reduce(function(a, b) {
return a + b;
}, 0);
return Math.round(sum / total);
}
function exponentialMovingAverage(blockSize, numberOfBlocks, lastBlockSizeAverage) {
var k = 2 / (numberOfBlocks + 1);
return blockSize * k + lastBlockSizeAverage * (1 - k);
}
function weightedAverage(range) {
var triangle = range.reduce(function(a, b, n) {
return a + n;
}, 0);
var result = 0;
for (var i = 0; i < range.length; i++) {
result = result + (range[i] * (i + 1) / triangle);
}
return Math.round(result);
}