TeachMeBitcoin

Precision & Consensus Limits

From TeachMeBitcoin, the free encyclopedia Reading time: 2 min

Precision Loss & Consensus Limits

The Compact Target Format (Bits) is highly efficient, but it comes with a trade-off: Precision Loss. Because the mantissa is only 3 bytes long, the network cannot adjust the difficulty with infinite granularity.

1. The 24-Bit Mantissa

With only 3 bytes (24 bits) for the mantissa, the target can only be specified with about 7 decimal digits of precision. * If the exact mathematical result of a Difficulty Adjustment requires changes in the 4th, 5th, or 6th byte of the target, those changes are lost. * The network always "rounds down" to the nearest value that can be represented by the 3-byte mantissa.

2. Cumulative Rounding Errors

Over many years, these tiny rounding errors could theoretically cause the difficulty to drift away from the ideal "10-minute" average. However, the errors are so small (less than 0.00001% per adjustment) that they are considered negligible compared to the volatility of hashrate.

3. The 4x Adjustment Limit

To prevent massive swings in difficulty caused by bugs or temporary network partitions, Bitcoin enforces a strict limit: * The target can never become more than 4 times easier (4x increase). * The target can never become more than 4 times harder (1/4 reduction).

4. Minimum Difficulty (Mainnet)

Bitcoin has a "Maximum Target" (Minimum Difficulty). Even if the hashrate drops to zero, the difficulty will never go below the value set in the Genesis block (0x1d00ffff). This prevents "low-hashrate" attacks where an attacker could easily mine their own private chain and attempt to reorganize the network.

Limit Value Purpose
Mantissa Size 24 Bits Header space efficiency.
Max Adjustment 4.0x / 0.25x Network stability.
Max Target 0x1d00ffff Security floor.

[!NOTE] On Testnet, the rules are slightly different. If no block is found for 20 minutes, the difficulty automatically resets to 1.0 to allow developers to continue testing without needing massive ASICs.

In the final section, we will build a Python Bits Decompressor to perform these conversions automatically.

☕ 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!