<p>The number of transactions in the header is always zero, per the <a href="https://en.bitcoin.it/wiki/Protocol_specification#Block_Headers" rel="nofollow">specification</a>. The <code>-gen</code> option has no effect on the <code>getwork</code> RPC call.</p>

<p>I'm not sure what you think is wrong with that information, but if it's just the zero transaction count, that's always that way. If it's the fact that you only get the headers you need to hash, it's always that way. Of course the <code>nonce</code> is 0 because the client has no idea what the nonce should be. (That's the point of <a href="https://en.bitcoin.it/wiki/Block_hashing_algorithm" rel="nofollow">mining</a>.)</p>

CC BY-SA 3.0
2012-01-13T22:41:37.397Z
I thought it was wrong, because the wiki on API calls referred to "data" field as "block data", whereas more correctly it would be "block header data".
ThePiachu
CC BY-SA 3.0
2012-01-13T22:30:03.897Z
2012-01-13T22:30:03.897Z
David Schwartz
<p>I recently tried playing around with the getwork command for JSON-RPC and I'm trying to understand what I got out of it. According to the <a href="https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list" rel="noreferrer">API Call List wiki entry</a>, the "data" field should contain the block data to be hashed.</p>

<p>The data field I got was:</p>

<p>00000001a10bacc7e639d1c69a01014bc5db6f2604b3477a3f273a4e019a232700000000a5942372cc60477c8a276e59c8f1a3f58654ea2f6c4402bf1b18e48455b5b8f64f10868b1c07475200000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000</p>

<p>Which after being dissected a bit according to <a href="https://en.bitcoin.it/wiki/Protocol_specification#block" rel="noreferrer">the protocol</a> would yield:</p>

<pre><code>00000001 - version
a10bacc7e639d1c69a01014bc5db6f2604b3477a3f273a4e019a232700000000 - prev_block
a5942372cc60477c8a276e59c8f1a3f58654ea2f6c4402bf1b18e48455b5b8f6 - merkle_root
4f10868b - timestamp
1c074752 - bits
00000000 - nonce
00 - txn_count of 0?
0000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000 - ??
</code></pre>

<p>Is there something wrong with the data I'm getting? Would the client respond differently if I run it with the -gen option?</p>

<block><raw-data><getwork><json-rpc>
JSON-RPC getwork data field
ThePiachu
# JSON-RPC getwork data field

(Asked by: username_0 on 2012-01-13)

I recently tried playing around with the getwork command for JSON-RPC and I'm trying to understand what I got out of it. According to the [API Call List wiki entry](https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list), the "data" field should contain the block data to be hashed.

The data field I got was:

00000001a10bacc7e639d1c69a01014bc5db6f2604b3477a3f273a4e019a232700000000a5942372cc60477c8a276e59c8f1a3f58654ea2f6c4402bf1b18e48455b5b8f64f10868b1c07475200000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000

Which after being dissected a bit according to [the protocol](https://en.bitcoin.it/wiki/Protocol_specification#block) would yield:

```
00000001 - version
a10bacc7e639d1c69a01014bc5db6f2604b3477a3f273a4e019a232700000000 - prev_block
a5942372cc60477c8a276e59c8f1a3f58654ea2f6c4402bf1b18e48455b5b8f6 - merkle_root
4f10868b - timestamp
1c074752 - bits
00000000 - nonce
00 - txn_count of 0?
0000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000 - ??

```

Is there something wrong with the data I'm getting? Would the client respond differently if I run it with the -gen option?

**Tags:** block, raw-data, getwork, json-rpc


---

## 1 answers

### Answer by username_1 on 2012-01-13. Score: 4 | Accepted answer

The number of transactions in the header is always zero, per the [specification](https://en.bitcoin.it/wiki/Protocol_specification#Block_Headers). The `-gen` option has no effect on the `getwork` RPC call.

I'm not sure what you think is wrong with that information, but if it's just the zero transaction count, that's always that way. If it's the fact that you only get the headers you need to hash, it's always that way. Of course the `nonce` is 0 because the client has no idea what the nonce should be. (That's the point of [mining](https://en.bitcoin.it/wiki/Block_hashing_algorithm).)

> **Comments:**
> **username_0**: I thought it was wrong, because the wiki on API calls referred to "data" field as "block data", whereas more correctly it would be "block header data".  

---

