<p>I tried to make sense of the data you submitted:</p>
<p>000000200f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206a2db7dd515bcb1592ad65c2d5963e217120876d742f7b10d77d1a481017f4fb1ffff7f20a228fa6462a200000101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff00000000010000000000000001000000000000000000000000a228fa64</p>
<p>Here's how far I got before giving up</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>Hex</th>
<th>Should be</th>
<th>Concerns</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>00000020</code></td>
<td>block version?</td>
<td><strong><em>Digit</em> order looks reversed!</strong></td>
</tr>
<tr>
<td><code>0f9188f13cb7b2c7</code> <code>1f2a335e3a4fc328</code> <code>bf5beb436012afca</code> <code>590b1a11466e2206</code></td>
<td>ID of prior block</td>
<td></td>
</tr>
<tr>
<td><code>a2db7dd515bcb159</code> <code>2ad65c2d5963e217</code> <code>120876d742f7b10d</code> <code>77d1a481017f4fb1</code></td>
<td>merkle root</td>
<td></td>
</tr>
<tr>
<td><code>ffff7f20</code></td>
<td>timestamp</td>
<td><strong>This looks wrong! Looks like target bits in wrong place</strong></td>
</tr>
<tr>
<td><code>a228fa64</code></td>
<td>target bits</td>
<td><strong>Probably misplaced timestamp or nonce?</strong></td>
</tr>
<tr>
<td><code>62a20000</code></td>
<td>nonce</td>
<td><strong>Could be a valid timestamp in wrong place?</strong></td>
</tr>
<tr>
<td><code>01</code></td>
<td>block contains 1 transaction</td>
<td></td>
</tr>
<tr>
<td><code>01000000</code></td>
<td>tx version</td>
<td></td>
</tr>
<tr>
<td><code>01</code></td>
<td>tx has one input</td>
<td></td>
</tr>
<tr>
<td><code>0000000000000000</code> <code>0000000000000000</code> <code>0000000000000000</code> <code>0000000000000000</code></td>
<td>referenced txid (all 0 for coinbase input)</td>
<td></td>
</tr>
<tr>
<td><code>ffffffff</code></td>
<td>vout index (for coinbase input)</td>
<td></td>
</tr>
<tr>
<td><code>00</code></td>
<td>length of unlocking script</td>
<td><strong>What about BIP34?</strong></td>
</tr>
<tr>
<td><code>00000001</code></td>
<td>sequence?</td>
<td><strong>Normally <code>ffffffff</code></strong></td>
</tr>
<tr>
<td><code>00</code></td>
<td>number of outputs</td>
<td><strong>Can't be zero!</strong></td>
</tr>
<tr>
<td><code>00000000</code></td>
<td>Locktime</td>
<td></td>
</tr>
<tr>
<td><code>00</code> <code>00</code> <code>01</code> <code>00</code> <code>00</code> <code>00</code> <code>00</code> <code>00</code> <code>00</code> <code>00</code> <code>00</code> <code>00</code> <code>00</code> <code>00</code> <code>00</code></td>
<td></td>
<td><strong>Surplus data?</strong></td>
</tr>
<tr>
<td><code>a228fa64</code></td>
<td></td>
<td><strong>Repeat of data in target bits! So potentially intended as a locktime?</strong></td>
</tr>
</tbody>
</table>
</div>
<p>Maybe I am mistaken but that data doesn't look right to me</p>
<p>I recommend reading</p>
<ul>
<li><a href="https://developer.bitcoin.org/reference/block_chain.html#block-headers" rel="nofollow noreferrer">https://developer.bitcoin.org/reference/block_chain.html#block-headers</a></li>
<li><a href="https://bitcoin.stackexchange.com/q/108187/13866">Some doubts regarding the structure of the Coinbase Transaction?</a></li>
</ul>

CC BY-SA 4.0
2023-09-09T12:22:59.257Z
The vout index for a coinbase input actually has to be 0xffffffff.
Pieter Wuille
CC BY-SA 4.0
2023-09-09T14:46:19.337Z
@Pieter thanks for pointing that out, answer corrected accordingly
RedGrittyBrick
CC BY-SA 4.0
2023-09-09T10:27:17.550Z
2023-09-09T15:38:55.100Z
2023-09-09T15:38:55.100Z
RedGrittyBrick
<p>I'm sending this json to bitcoind server running in regtest mode:</p>
<pre class="lang-json prettyprint-override"><code>{&quot;jsonrpc&quot;: 2.0,
 &quot;id&quot;: &quot;cumainer&quot;,
 &quot;method&quot;: &quot;submitblock&quot;,
 &quot;params&quot;: [&quot;000000200f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206a2db7dd515bcb1592ad65c2d5963e217120876d742f7b10d77d1a481017f4fb1ffff7f20a228fa6462a200000101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff00000000010000000000000001000000000000000000000000a228fa64&quot;] 
}
</code></pre>
<p>First 80 bytes are my block header, 1 meaning the number of transactions and my coinbase transaction in raw hex.</p>
<p>My regtest server is fresh and it has only one block.</p>
<p>For some reason I always get &quot;high-hash&quot; result from the server.
However if I take first 80 bytes (block header size) of my &quot;params&quot; string and double hash it I get a string with few zeros at the beggining. <code>getblocktemplate</code> request gives me the first difficulty (0x207fffff = the easiest one) and I'm sending it back in little endian order as stated on <code>submitblock</code> reference (I actually tried sending in big-endian too).</p>
<p>So the double sha256 hash of my block header is clearly smaller than the target.
What does this error mean then ? What I am doing wrong ? Is it the byte order? Maybe the problem is actually with the merkle root hash ?</p>

<solo-mining><getblocktemplate>
Keep getting high-hash error from bitcoind
Viaceslavus
# Keep getting high-hash error from bitcoind

(Asked by: username_0 on 2023-09-07)

I'm sending this json to bitcoind server running in regtest mode:

```json
{"jsonrpc": 2.0,
 "id": "cumainer",
 "method": "submitblock",
 "params": ["000000200f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206a2db7dd515bcb1592ad65c2d5963e217120876d742f7b10d77d1a481017f4fb1ffff7f20a228fa6462a200000101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff00000000010000000000000001000000000000000000000000a228fa64"] 
}

```

First 80 bytes are my block header, 1 meaning the number of transactions and my coinbase transaction in raw hex.

My regtest server is fresh and it has only one block.

For some reason I always get "high-hash" result from the server.
However if I take first 80 bytes (block header size) of my "params" string and double hash it I get a string with few zeros at the beggining. `getblocktemplate` request gives me the first difficulty (0x207fffff = the easiest one) and I'm sending it back in little endian order as stated on `submitblock` reference (I actually tried sending in big-endian too).

So the double sha256 hash of my block header is clearly smaller than the target.
What does this error mean then ? What I am doing wrong ? Is it the byte order? Maybe the problem is actually with the merkle root hash ?

**Tags:** solo-mining, getblocktemplate


---

## 1 answers

### Answer by username_1 on 2023-09-09. Score: 2

I tried to make sense of the data you submitted:

000000200f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206a2db7dd515bcb1592ad65c2d5963e217120876d742f7b10d77d1a481017f4fb1ffff7f20a228fa6462a200000101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff00000000010000000000000001000000000000000000000000a228fa64

Here's how far I got before giving up

| Hex | Should be | Concerns |
| --- | --- | --- |
| `00000020` | block version? | ***Digit* order looks reversed!** |
| `0f9188f13cb7b2c7` `1f2a335e3a4fc328` `bf5beb436012afca` `590b1a11466e2206` | ID of prior block |  |
| `a2db7dd515bcb159` `2ad65c2d5963e217` `120876d742f7b10d` `77d1a481017f4fb1` | merkle root |  |
| `ffff7f20` | timestamp | **This looks wrong! Looks like target bits in wrong place** |
| `a228fa64` | target bits | **Probably misplaced timestamp or nonce?** |
| `62a20000` | nonce | **Could be a valid timestamp in wrong place?** |
| `01` | block contains 1 transaction |  |
| `01000000` | tx version |  |
| `01` | tx has one input |  |
| `0000000000000000` `0000000000000000` `0000000000000000` `0000000000000000` | referenced txid (all 0 for coinbase input) |  |
| `ffffffff` | vout index (for coinbase input) |  |
| `00` | length of unlocking script | **What about BIP34?** |
| `00000001` | sequence? | **Normally `ffffffff`** |
| `00` | number of outputs | **Can't be zero!** |
| `00000000` | Locktime |  |
| `00` `00` `01` `00` `00` `00` `00` `00` `00` `00` `00` `00` `00` `00` `00` |  | **Surplus data?** |
| `a228fa64` |  | **Repeat of data in target bits! So potentially intended as a locktime?** |

Maybe I am mistaken but that data doesn't look right to me

I recommend reading

* <https://developer.bitcoin.org/reference/block_chain.html#block-headers>
* [Some doubts regarding the structure of the Coinbase Transaction?](https://bitcoin.stackexchange.com/q/108187/13866)

> **Comments:**
> **username_2**: The vout index for a coinbase input actually has to be 0xffffffff.  
> **username_1**: @username_2 thanks for pointing that out, answer corrected accordingly  

---

