What is the maximum size a block can be? Is there a minimum size? Can you have a block with 0 transactions included?
2 Answers
The current maximum block size is 1MB (but it could be increased in the future with a protocol change), there is no minimum size per se, but the block needs to have all its components to be valid (check Protocol Specification). Each block needs to have at least one transaction - one paying the miner the reward for mining the block.
-
31MB is sufficient for roughly 2400 transactions (or 4tps). The exact size of an individual transaction depends on the number of in/out addresses. Over the last 1000 blocks, block size has averaged 17KB with 40 transactions putting average transaction at ~420 bytes each. The protocol can support larger block sizes. Commented Oct 26, 2011 at 22:33
-
"Each block needs to have at least one transaction - one paying the miner the reward for mining the block.". How does that work once mining has stopped? Of course, that is still a while off...– ThiloCommented Oct 28, 2011 at 8:49
-
When the mining stops, there won't be blocks to generate;). Mining won't stop, due to the transaction fees and what nots. I'm guessing that over 150 years from now, when new coins won't be created any more, and on an odd block that won't have any fees, the first transaction will be sending 0 coins to yourself. Commented Oct 28, 2011 at 9:54
-
1@Thilo Mining (better term is hashing) never stops. Hashing blocks into the block chain is required part of Bitcoin network. The "end game" goal of Bitcoin is for transaction fees to pay for the cost of the network. Currently fees are insufficient so miners get a block reward which is essentially a subsidy. Those subsidies will slowly decline and be replaced with transaction fees. There is always a coinbase transaction (reward + fees). As ThePiachu pointed out if the block reward & fees are 0 that transactions still exists and simply be 0 BTC sent to the miner. Commented Oct 28, 2011 at 18:10
Since the segwit upgrade, Bitcoin blocks are restricted to 4,000,000 weight units. Witness data counts towards that limit 1:1 (one byte is one weight unit), while non-witness data counts towards that limit 1:4 (one byte is four weight units).
While theoretically a block could therefore be up to 4,000,000 bytes if it consisted only of witness data, there are a few parts of transactions that are never witness data. Many blocks now exceed 1 MB with the average blocksize being around 1.3 MB these days (end of 2022). The biggest block so far was 748,918 with 2,765,062 B.
As ThePiachu explained, every block must have at least the coinbase transaction to be valid.
Update in November 2023:
Since May 2023, the average block size has been around 1.65–1.7 MB. The biggest block so far was 786,501 with 3,978,938 bytes.
You can find a chart of average block sizes on transactionfee.info.