Block

A block is a collection of transactions that have been committed to the blockchain as a bundle. The transactions do not necessarily have to be related to one another and, generally, are only associated by virtue of when they were submitted to the Bitcoin Cash network.

Every block contains one coinbase transaction, followed by zero or more additional transactions. The coinbase transaction is created by the miner of the block and provides an opportunity for them to receive the block reward for successfully mining a block, along with any fees collected from the transactions in the block. For more information, see Mining.

Block Headers

Block are identified by the SHA-256 hash of their header. Since the block header contains the root of a Merkle Tree of the transactions in the block, this means the hash is ultimately dependent on both the meta-information about the block as well as the full contents of all of its component transactions.

For more information see Block Header.

Coinbase Transaction

The coinbase transaction provides a mechanism for miners to:

To accomplish this, the coinbase transaction is required to have a single input. However, unlike other transactions, this input is not expected to provide the satoshis that appear in the outputs. Instead, the satoshis that appear in the outputs of the coinbase transaction are collected from two places: the block reward and transactions fees.

The block reward is provided automatically to the block and represents a continually decreasing incentive for miners. The block reward started at 5,000,000,000 satoshis (50 BCH) and decreases by half every 210,000 blocks. Specifically, the block reward for a block at height h is 5000000000 >> floor(h / 210000) satoshis, where >> is a bitwise right shift by the number of halvings so far (each shift halves the value, rounding down).

The block reward is a 64-bit integer, so a shift of 64 or more would move every bit out of the value; the reward is therefore defined as zero once floor(h / 210000) is 64 or more.

Transaction fees are often required by the network for transactions to be relayed across the network. Satoshis provided as inputs to a transaction, but not consumed by its outputs, are collected by the coinbase transaction as implicit inputs.

The coinbase message is provided in the inputs unlocking script. The unlocking script is required to begin with a push of the block height which can then be followed why whatever data is desired. The block height is encoded as a minimally-encoded script number: little-endian, using the fewest bytes possible, with the most significant bit of the last byte acting as the sign bit (so a 0x00 byte is appended when the most significant byte would otherwise be 0x80 or greater). The OP_DATA_X operation is used to push the necessary number of bytes to encode the length. The unlocking script must begin with exactly these bytes; for example, block height 556767 (0x087EDF) is pushed as 03 DF 7E 08. This requirement was added with version 2 blocks as a part of BIP-34 and is enforced from block height 227931 on mainnet.

Each coinbase transaction may only have one transaction input.

Each coinbase transaction's unlocking script must be less than or equal to 100 bytes.

Block Size

Since HF-20240515 the maximum block size is determined by the Adaptive Blocksize Limit Algorithm (ABLA). The limit for each block is computed from the ABLA state (control block size and elastic buffer size) of the previous block, which in turn depends on the sizes of preceding blocks. The limit never falls below 32,000,000 bytes, and is temporarily capped at 2,000,000,000 bytes.

Block Size History

Before HF-20240515 the limit was a fixed 32,000,000 bytes (since HF-20180515), 8,000,000 bytes (since BCH-UAHF), and 1,000,000 bytes before that.

Transaction Count

The maximum number of transactions within a block is approximately the block size limit divided by the minimum transaction size: 65 bytes since HF-20230515, 100 bytes from HF-20181115 until then, and no minimum before that. Other rules limit the number of transactions that may be within a block, including the number of signature checks (SigChecks, since HF-20200515): at most floor(max_block_size / 141) per block, where max_block_size is the block's current size limit, and at most 3,000 per transaction.