<p>Your rendition is longer if nothing else, the entire header is only 80 bytes long. The encoding of "bits" is historical and is left over from the pre-release 0.1.0 client. There's other things in the header which could have been encoded better (the nonce should have been longer, and the version read as a bitfield not an int, and an aux merkle root would have been nice), but as it is there's no really great reason to change anything due to the amount of inertia behind the current formation. </p>

CC BY-SA 3.0
2015-04-04T05:06:27.443Z
What do you mean by `aux` merkle root? Also, it'd be nice to have accurate times in both the header (and associated w/ individual Txs)
Wizard Of Ozzie
CC BY-SA 3.0
2015-04-04T07:14:00.650Z
A dedicated part of the merkle tree just for axillary data like UTXO commitments. Timestamps on transactions would be completely meaningless, they only exist to allow for difficulty adjustments. There's no use for them that wouldn't rely on them being correct to some degree, if there was a way of making sure the timestamps were correct we wouldn't need a block chain to begin with.
Claris
CC BY-SA 3.0
2017-04-12T19:54:32.393Z
"historical"? Does this mean there is no current use for `bits` in the block header? I am wondering why it is there at all, assuming a full node syncs from block 0 and can calculate difficulty on its own for each block...
pinhead
CC BY-SA 3.0
2015-04-03T10:53:16.747Z
2017-05-04T12:21:25.970Z
2017-05-04T12:21:25.970Z
Claris
<p>Why is the target converted to "Bits" and not stored in full in the block header?</p>

<p>For example, why:</p>

<pre><code>{
"hash" : "000000000003ba27aa200b1cecaad478d2b00432346c3f1f3986da1afd33e506",
"height" : 100000,
"bits" : "1b04864c",
"difficulty" : 14484.16236123,
}
</code></pre>

<p>and not:</p>

<pre><code>{
"hash" : "000000000003ba27aa200b1cecaad478d2b00432346c3f1f3986da1afd33e506",
"height" : 100000,
"target" : "000000000004864c000000000000000000000000000000000000000000000000",
"difficulty" : 14484.16236123,
}
</code></pre>

<p>Is it to save space?</p>

CC BY-SA 3.0
2015-04-03T18:55:58.210Z
There isn't a need for that level of accuracy, but there is a need to conserve space in the header, because clients typically store the block headers in RAM.
morsecoder
<difficulty><block-header>
Why is the target stored in compact form in the block header?
inersha
# Why is the target stored in compact form in the block header?

(Asked by: username_0 on 2015-04-03)

Why is the target converted to "Bits" and not stored in full in the block header?

For example, why:

```
{
"hash" : "000000000003ba27aa200b1cecaad478d2b00432346c3f1f3986da1afd33e506",
"height" : 100000,
"bits" : "1b04864c",
"difficulty" : 14484.16236123,
}

```

and not:

```
{
"hash" : "000000000003ba27aa200b1cecaad478d2b00432346c3f1f3986da1afd33e506",
"height" : 100000,
"target" : "000000000004864c000000000000000000000000000000000000000000000000",
"difficulty" : 14484.16236123,
}

```

Is it to save space?

**Tags:** difficulty, block-header

> **Comments:**
> **username_1**: There isn't a need for that level of accuracy, but there is a need to conserve space in the header, because clients typically store the block headers in RAM.  

---

## 1 answers

### Answer by username_2 on 2015-04-03. Score: 3 | Accepted answer

Your rendition is longer if nothing else, the entire header is only 80 bytes long. The encoding of "bits" is historical and is left over from the pre-release 0.1.0 client. There's other things in the header which could have been encoded better (the nonce should have been longer, and the version read as a bitfield not an int, and an aux merkle root would have been nice), but as it is there's no really great reason to change anything due to the amount of inertia behind the current formation.

> **Comments:**
> **username_3**: What do you mean by `aux` merkle root? Also, it'd be nice to have accurate times in both the header (and associated w/ individual Txs)  
> **username_2**: A dedicated part of the merkle tree just for axillary data like UTXO commitments. Timestamps on transactions would be completely meaningless, they only exist to allow for difficulty adjustments. There's no use for them that wouldn't rely on them being correct to some degree, if there was a way of making sure the timestamps were correct we wouldn't need a block chain to begin with.  
> **username_4**: "historical"? Does this mean there is no current use for `bits` in the block header? I am wondering why it is there at all, assuming a full node syncs from block 0 and can calculate difficulty on its own for each block...  

---

