<blockquote>
<p>However, can it be 0 given the way the target is encoded in <code>nBits</code>?</p>
</blockquote>
<p>Yes. The encoding in nBits for target 0 is 0x00000000.</p>
<blockquote>
<p>Since the smallest legal value for the lower 24 bits is 0x008000 and if we take into account that the minimal exponent is only 3, it look like the lowest possible value for target is 0x008000, that is for <code>nBits</code> 0x03008000.</p>
</blockquote>
<p>The rule about the mantissa needing to be at least <code>0x008000</code> only applies when the value is nonzero. It's there to make sure numbers have a unique encoding, but as this example point out, it would preclude encoding <code>0</code> if applied the same way for it.</p>
<p>So, the values are:</p>
<ul>
<li><code>0x00000000</code> (0),</li>
<li><code>0x01010000</code> (1),</li>
<li><code>0x01020000</code> ... <code>0x017F0000</code> (2 - 127)</li>
<li><code>0x02008000</code> (128)</li>
<li><code>0x02008100</code> (129)</li>
<li><code>0x02008200</code> ... <code>0x027FFF00</code> (130 - 32767)</li>
<li><code>0x03008000</code> (32768) and so on...</li>
</ul>

CC BY-SA 4.0
2024-01-31T12:52:26.900Z
I thought that the smallest possible value for the exponent is `0x03`. What is then the correct `nBits` for the number 500 (in base 256 = 01F4) or the number 154 (in base 256 = 9A)? 0x020001F4 and 0x0100009A?
LeaBit
CC BY-SA 4.0
2024-01-31T12:57:07.200Z
Shouldn't base 256 have 256 possible distinct symbols for each digit?
RedGrittyBrick
CC BY-SA 4.0
2024-01-31T13:29:06.967Z
The encoding for 500 would be `0x0201F400` and the encoding of 154 would be `0x02009A00`. The encoding of the number 5 would be `0x01050000`. I realized I made a mistake in my answer above; the mantissa will actually always be between 0x008000 and 0x7FFFFF inclusive, except when encoding 0. I've amended my answer.
Pieter Wuille
CC BY-SA 4.0
2024-01-31T13:33:31.247Z
@RedGrittyBrick Indeed. In the encoding of 500 (`0x0201F400`), the exponent is the `0x02` up front (shifted by 3, so the actual exponent is -1), and the mantissa is `0x01F400` (ignoring that its top bit is actually a sign bit), whose "digits" are `0x01`, `0xF4`, and `0x00`. So the encoded number is (`0x00` + `0xF4` * 256 + `0x01` * 256^2) * 256^(`0x02` - 3) = 500.
Pieter Wuille
CC BY-SA 4.0
2024-01-31T14:43:19.063Z
@PieterWuille Did you make a mistake for 154, isn't it `0x019A0000` instead of `0x02009A00`?
LeaBit
CC BY-SA 4.0
2024-01-31T15:04:12.280Z
No, `0x019A0000` represents -26 (the high bit of the mantissa is the sign).
Pieter Wuille
CC BY-SA 4.0
2024-01-31T15:42:49.087Z
Thanks, I added some numbers. I think it can be useful. I hope everything is correct in written.
LeaBit
CC BY-SA 4.0
2024-01-31T12:39:04.603Z
2024-01-31T15:46:20.363Z
2024-01-31T15:46:20.363Z
Pieter Wuille
<p>Similar question was asked <a href="https://bitcoin.stackexchange.com/questions/83231/mining-what-is-the-lowest-possible-target-could-it-be-a-block-hash-of-all-zero">here</a> but the answer doesn't really provide an answer.</p>
<hr />
<p>This <a href="https://bitcoin.stackexchange.com/a/11097/145749">answer</a> says that the lowest possible value for target is &quot;<em>all zeros plus a one</em>&quot;. <em>Pieter Wuille</em> in the comment denied it and  wrote that the target can even be 0.</p>
<p>However, can it be 0 given the way the target is encoded in <code>nBits</code>? Since the smallest legal value for the lower 24 bits is 0x008000 and if we take into account that the minimal exponent is only 3, it look like the lowest possible value for target is 0x008000, that is for <code>nBits</code> 0x03008000.</p>
<p><strong>Therefore, what is the lowest possible target value, ie for nBits?</strong></p>

<difficulty>
What is the lowest possible value for target?
LeaBit
# What is the lowest possible value for target?

(Asked by: username_0 on 2024-01-31)

Similar question was asked [here](https://bitcoin.stackexchange.com/questions/83231/mining-what-is-the-lowest-possible-target-could-it-be-a-block-hash-of-all-zero) but the answer doesn't really provide an answer.

---

This [answer](https://bitcoin.stackexchange.com/a/11097/145749) says that the lowest possible value for target is "*all zeros plus a one*". *username_1 username_1* in the comment denied it and wrote that the target can even be 0.

However, can it be 0 given the way the target is encoded in `nBits`? Since the smallest legal value for the lower 24 bits is 0x008000 and if we take into account that the minimal exponent is only 3, it look like the lowest possible value for target is 0x008000, that is for `nBits` 0x03008000.

**Therefore, what is the lowest possible target value, ie for nBits?**

**Tags:** difficulty


---

## 1 answers

### Answer by username_1 on 2024-01-31. Score: 6 | Accepted answer

> However, can it be 0 given the way the target is encoded in `nBits`?

Yes. The encoding in nBits for target 0 is 0x00000000.

> Since the smallest legal value for the lower 24 bits is 0x008000 and if we take into account that the minimal exponent is only 3, it look like the lowest possible value for target is 0x008000, that is for `nBits` 0x03008000.

The rule about the mantissa needing to be at least `0x008000` only applies when the value is nonzero. It's there to make sure numbers have a unique encoding, but as this example point out, it would preclude encoding `0` if applied the same way for it.

So, the values are:

* `0x00000000` (0),
* `0x01010000` (1),
* `0x01020000` ... `0x017F0000` (2 - 127)
* `0x02008000` (128)
* `0x02008100` (129)
* `0x02008200` ... `0x027FFF00` (130 - 32767)
* `0x03008000` (32768) and so on...

> **Comments:**
> **username_0**: I thought that the smallest possible value for the exponent is `0x03`. What is then the correct `nBits` for the number 500 (in base 256 = 01F4) or the number 154 (in base 256 = 9A)? 0x020001F4 and 0x0100009A?  
> **username_2**: Shouldn't base 256 have 256 possible distinct symbols for each digit?  
> **username_1**: The encoding for 500 would be `0x0201F400` and the encoding of 154 would be `0x02009A00`. The encoding of the number 5 would be `0x01050000`. I realized I made a mistake in my answer above; the mantissa will actually always be between 0x008000 and 0x7FFFFF inclusive, except when encoding 0. I've amended my answer.  
> **username_1**: @username_2 Indeed. In the encoding of 500 (`0x0201F400`), the exponent is the `0x02` up front (shifted by 3, so the actual exponent is -1), and the mantissa is `0x01F400` (ignoring that its top bit is actually a sign bit), whose "digits" are `0x01`, `0xF4`, and `0x00`. So the encoded number is (`0x00` + `0xF4` * 256 + `0x01` * 256^2) * 256^(`0x02` - 3) = 500.  
> **username_0**: @username_1 Did you make a mistake for 154, isn't it `0x019A0000` instead of `0x02009A00`?  
> **username_1**: No, `0x019A0000` represents -26 (the high bit of the mantissa is the sign).  
> **username_0**: Thanks, I added some numbers. I think it can be useful. I hope everything is correct in written.  

---

