TeachMeBitcoin

The Bits Field Overview

From TeachMeBitcoin, the free encyclopedia Reading time: 2 min

The Bits Field Overview

The Bits field is the fifth field in the 80-Byte Block Header. It is a 4-byte value that encodes the current Mining Target—the threshold that the block's hash must be below for the block to be considered valid.

1. The Need for Compression

A full Bitcoin target is a 256-bit number (32 bytes). However, the block header is designed to be as small as possible. If the target were stored in its full 32-byte form, the header would be over 100 bytes long.

To solve this, Bitcoin uses a Compact Format that squashes a 32-byte number into just 4 bytes.

2. The Floating-Point Analogy

The "Bits" field works similarly to scientific notation or floating-point numbers. It uses a base and an exponent to represent very large numbers with a small amount of data. * Scientific Notation: $1.23 \times 10^5$ * Bitcoin Bits: $Mantissa \times 256^{(Exponent - 3)}$

3. Little-Endian Storage

Like other header fields, "Bits" is stored in little-endian order in the binary block header. * If the value is 0x17066F2A, it appears on disk as 2A 6F 06 17.

4. Why Miners Need It

Miners must constantly check their computed block hashes against the target. By including the target (in its compact "Bits" form) directly in the header, any node can instantly verify that the miner performed the required amount of work without needing to look up external data.

Property Value
Field Size 4 Bytes
Data Represented 32-Byte Target
Update Frequency Every 2,016 blocks
IMPORTANT

The "Bits" field is set by the Difficulty Adjustment algorithm. If a miner attempts to include a "Bits" value that is easier (higher) than the network-mandated target, their block will be instantly rejected.

In the next section, we will look at the internal structure of these 4 bytes: the Exponent and the Mantissa.

☕ Help support TeachMeBitcoin

TeachMeBitcoin is an ad-free, open-source educational repository curated by a passionate team of Bitcoin researchers and educators for public benefit. If you found our articles helpful, please consider supporting our hosting and ongoing content updates with a clean donation:

Ethereum: 0x578417C51783663D8A6A811B3544E1f779D39A85
Bitcoin: bc1q77k9e95rn669kpzyjr8ke9w95zhk7pa5s63qzz
Solana: 4ycT2ayqeMucixj3wS8Ay8Tq9NRDYRPKYbj3UGESyQ4J
Address copied to clipboard!