Compact Target (Bits): Definition and How Bitcoin Stores Mining
The Compact Target (Bits) field—commonly called nBits or simply Bits—is a 4-byte value stored in every Bitcoin block header that represents the current target threshold in a compressed format. Bitcoin nodes decode this value to determine the maximum valid block hash for that block.
Compact Target (Bits) Explained in Simple Terms
Every Bitcoin block contains a difficulty target that miners must satisfy.
This target is actually a very large 256-bit number.
Instead of storing the entire number in every block header, Bitcoin stores a much shorter version called Bits.
When a Bitcoin node receives a block, it:
reads the Bits field
expands it into the full target threshold
verifies that the block hash is less than or equal to that target
The Bits field saves space while still allowing every node to reconstruct the exact mining target.
Think of it like scientific notation.
Instead of writing a very large number in full, you store a compact representation that can later be expanded into its original value.
How Compact Target (Bits) Works
The Bits field allows Bitcoin to represent the mining target efficiently.
The process works as follows:
Difficulty Calculated
The Bitcoin protocol determines the target threshold during a difficulty adjustment.Target Compressed
The full 256-bit target is encoded into the 4-byte Bits format.Block Header Created
The Bits value is stored in the block header.Mining Begins
Miners search for a block hash below the decoded target.Block Validation
Every node decodes the Bits value and verifies the Proof of Work.
The process can be summarized as:
Difficulty → Target Threshold → Compact Bits → Mining → Validation
Example of Compact Target (Bits) in Practice
Suppose a block header contains the following Bits value:
0x17030C31
Bitcoin nodes decode this compact value into the full 256-bit target threshold.
During block validation, the node compares the block hash with the decoded target.
If:
Block Hash ≤ Target Threshold
the Proof of Work is valid.
Otherwise, the block is rejected.
Users normally never need to perform this conversion manually because Bitcoin software handles it automatically.
Why the Compact Target Matters
The Bits field is essential because it:
stores the mining target efficiently
reduces block header size
allows every node to reconstruct the target threshold
supports Proof of Work validation
records the difficulty target used for each block
Without the compact representation, every block header would need to store a much larger target value.
What Does the Bits Field Contain?
The Bits field stores a compact representation consisting of:
an exponent
a coefficient (sometimes called the mantissa)
Together, these values encode the full target threshold.
Bitcoin software expands the compact value into the complete 256-bit target before validating the block.
Compact Target vs Target Threshold
Compact Target (Bits)
Represents:
the compressed encoding of the mining target.
Stored in:
every Bitcoin block header.
Size:
4 bytes
Target Threshold
Represents:
the full 256-bit value that determines whether a block hash is valid.
Used during:
Proof of Work verification.
The Bits field is simply a compact way of storing the full target threshold.
Compact Target and Mining Difficulty
The target threshold and mining difficulty are directly related.
When mining difficulty increases:
the target threshold becomes smaller
the Bits value changes accordingly
When mining difficulty decreases:
the target threshold becomes larger
a different Bits value is stored
Bitcoin recalculates the target approximately every 2,016 blocks, and each new block records the appropriate Bits value for that difficulty period.
Can Miners Change the Bits Field?
No.
The Bits field must match the difficulty target defined by the Bitcoin consensus rules.
If a miner creates a block with an incorrect Bits value:
Bitcoin nodes reject the block
it is not added to the blockchain
Every full node independently verifies that the Bits field is correct.