Can a Bitcoin block be less than 1mb?

4

Can a Bitcoin block be less than 1mb?

To my understanding, a miner receives broadcasts. However, if not enough transactions come in, then would it just prematurely hash the block?

jxieeducation

Posted 2015-11-01T03:26:50.260

Reputation: 43

What do you mean by "prematurely"? Most miners hash every second they possibly can, otherwise their mining power is wasted.David Schwartz 2015-11-02T11:31:27.350

Answers

8

Yes. Let's calculate the minimum size of a block:

  • The block header must be exactly 80 bytes. This is the only part of the block that miners actually mine; the rest of the block is data that the header securely references.

  • The transaction count. This isn't part of the block header and it isn't part of the block data, but it's part of the peer-to-peer protocol block message so it gets counted towards the block size. For blocks with 253 or fewer transactions, this is 1 byte.

  • The coinbase transaction, the only required transaction in a block. The coinbase transaction has the following fields with these minimum values:

    • 4 bytes -- version field
    • 1 byte -- number of inputs (always 1 for coinbase transactions)
    • 32 bytes -- outpoint txid; always 32 0x00 bytes for coinbase transactions
    • 4 bytes -- outpoint index; always 4 0xff bytes for coinbase transactions
    • 1 byte -- number of bytes in coinbase field (input script); always 1 byte for coinbase transactions because there's a 100-byte limit
    • 4 bytes -- block height as a data push; required by BIP34
    • 4 bytes -- sequence number
    • 1 byte -- number of outputs, we're not going to have any (making the block reward and transaction fees paid in this block permanently unspendable; no real miner would do this)
    • 4 bytes -- locktime
    • Total: 55 bytes

Total minimum block size: 80 + 1 + 55 = 136 bytes

Practically, the smallest reasonable blocks are in the 180-byte range.

David A. Harding

Posted 2015-11-01T03:26:50.260

Reputation: 10 154

2

Empty vout would make the transaction invalid. You would need to have one output of 0 BTC, 0 length, null script for a total 9 bytes (8 byte value, one byte VarInt). This would also be an anyone can spend output as a null script can be satisfied by pushing anything to the stack.

Anonymous 2015-11-01T07:07:32.427

0

Sure.

This is one such block. It's 312 kB.

Nick ODell

Posted 2015-11-01T03:26:50.260

Reputation: 26 536

0

Blocks have to have at least one transaction: They must contain a coinbase which is the transaction that spends the block reward.

For example this block with only one transaction is only 0.246 kB.

Murch

Posted 2015-11-01T03:26:50.260

Reputation: 41 609