user44642: In Bitcoin, the target is a 256-bit unsigned integer stored using a compact representation similar to a 32-bit floating-point with the following parameters:

1 sign bit (is there any use?)
8-bit exponent with offset binary 3 (why?)
base 256 (by using this base, couldn't the exponent be 5-bit long? By definition, the maximum target is set to 2^224 - 1 = 256^28 - 1)


user208: It looks like the format was designed for other purposes than Bitcoin's target, and used unmodified in the code.
If you want a rationale for why a compact representation in the first place: not to waste space in block headers, presumably. We now know that there is little need for having the target stored in block headers at all (header-first sync does not need it), but before that, it was needed for certain DoS protections.
The particular choice indeed seems a bit odd; the sign bit is certainly unnecessary, and the ranges seem a bit off. However, it's not a terrible choice for a simple generic 32-bit floating point number.

44642: <p>In Bitcoin, the target is a 256-bit unsigned integer stored using a compact representation similar to a 32-bit floating-point with the following parameters:</p>

<ul>
<li>1 sign bit (is there any use?)</li>
<li>8-bit exponent with offset binary 3 (why?)</li>
<li>base 256 (by using this base, couldn't the exponent be 5-bit long? By definition, the maximum target is set to 2^224 - 1 = 256^28 - 1)</li>
</ul>
 208: <p>It looks like the format was designed for other purposes than Bitcoin's target, and used unmodified in the code.</p>

<p>If you want a rationale for why a compact representation in the first place: not to waste space in block headers, presumably. We now know that there is little need for having the target stored in block headers at all (header-first sync does not need it), but before that, it was needed for certain DoS protections.</p>

<p>The particular choice indeed seems a bit odd; the sign bit is certainly unnecessary, and the ranges seem a bit off. However, it's not a terrible choice for a simple generic 32-bit floating point number.</p>
