<p>The <code>submitblock</code> method takes a raw serialized block as its only parameter. You can find detailed documentation on these <a href="https://bitcoin.org/en/developer-reference#serialized-blocks" rel="nofollow">here</a> and <a href="https://en.bitcoin.it/wiki/Genesis_block" rel="nofollow">here</a>.</p>

<p>For example, this is the raw genesis block in bitcoin:</p>

<pre><code>0100000000000000000000000000000000000000000000000000000000000000000000003BA3EDFD7A7B12B27AC72C3E67768F617FC81BC3888A51323A9FB8AA4B1E5E4A29AB5F49FFFF001D1DAC2B7C0101000000010000000000000000000000000000000000000000000000000000000000000000FFFFFFFF4D04FFFF001D0104455468652054696D65732030332F4A616E2F32303039204368616E63656C6C6F72206F6E206272696E6B206F66207365636F6E64206261696C6F757420666F722062616E6B73FFFFFFFF0100F2052A01000000434104678AFDB0FE5548271967F1A67130B7105CD6A828E03909A67962E0EA1F61DEB649F6BC3F4CEF38C4F35504E51EC112DE5C384DF7BA0B8D578A4C702B6BF11D5FAC00000000
</code></pre>

<p>And when you split is apart into its pieces:</p>

<pre><code>version:     01000000
prev block:  0000000000000000000000000000000000000000000000000000000000000000 
merkle root: 3BA3EDFD7A7B12B27AC72C3E67768F617FC81BC3888A51323A9FB8AA4B1E5E4A
timestamp:   29AB5F49
bits:        FFFF001D
nonce        1DAC2B7C
num txs:     01
tx1:         01000000010000000000000000000000000000000000000000000000000000000000000000FFFFFFFF4D04FFFF001D0104455468652054696D65732030332F4A616E2F32303039204368616E63656C6C6F72206F6E206272696E6B206F66207365636F6E64206261696C6F757420666F722062616E6B73FFFFFFFF0100F2052A01000000434104678AFDB0FE5548271967F1A67130B7105CD6A828E03909A67962E0EA1F61DEB649F6BC3F4CEF38C4F35504E51EC112DE5C384DF7BA0B8D578A4C702B6BF11D5FAC00000000
</code></pre>

CC BY-SA 3.0
2018-02-11T04:56:56.187Z
And, according to BIP 22 if the server provided a workid, it MUST be included with submissions as the second parameter. Currently, Bitcoin Core states that this value is ignored.
Willtech
CC BY-SA 3.0
2016-03-04T13:52:10.923Z
2016-03-04T13:52:10.923Z
morsecoder
<p>The input to <code>submitblock</code> is a &quot;serialized&quot; raw block in HEX. The format for a &quot;serialized&quot; block is here (hard to find!)....</p>
<p><a href="https://developer.bitcoin.org/reference/block_chain.html#serialized-blocks" rel="nofollow noreferrer">https://developer.bitcoin.org/reference/block_chain.html#serialized-blocks</a></p>
<p>The raw transactions included at the end of the &quot;serialized&quot; block format are themselves formatted like this...</p>
<p><a href="https://developer.bitcoin.org/reference/transactions.html#raw-transaction-format" rel="nofollow noreferrer">https://developer.bitcoin.org/reference/transactions.html#raw-transaction-format</a></p>

CC BY-SA 4.0
2021-06-20T18:36:39.303Z
2021-06-20T18:36:39.303Z
bigjosh
<p>I'm trying to understand how mining works. For learning purpose I'm using Bitcoin Core as solo mining pool. Getblocktemplate will return data that is enough to start mining witch is simple founding correct nonce. But what is next step?</p>

<p>I found in bitcoin core method submitblock that have one argument / block data. I didn't found any example how that data should be build. Please give me some advice.</p>

<bitcoin-core><solo-mining>
How to use Bitcoin Core's submitblock method
Robert
# How to use Bitcoin Core's submitblock method

(Asked by: username_0 on 2016-02-28)

I'm trying to understand how mining works. For learning purpose I'm using Bitcoin Core as solo mining pool. Getblocktemplate will return data that is enough to start mining witch is simple founding correct nonce. But what is next step?

I found in bitcoin core method submitblock that have one argument / block data. I didn't found any example how that data should be build. Please give me some advice.

**Tags:** bitcoin-core, solo-mining


---

## 2 answers

### Answer by username_1 on 2016-03-04. Score: 3

The submitblock method takes a raw serialized block as its only parameter. You can find detailed documentation on these here and here.
For example, this is the raw genesis block in bitcoin:
0100000000000000000000000000000000000000000000000000000000000000000000003BA3EDFD7A7B12B27AC72C3E67768F617FC81BC3888A51323A9FB8AA4B1E5E4A29AB5F49FFFF001D1DAC2B7C0101000000010000000000000000000000000000000000000000000000000000000000000000FFFFFFFF4D04FFFF001D0104455468652054696D65732030332F4A616E2F32303039204368616E63656C6C6F72206F6E206272696E6B206F66207365636F6E64206261696C6F757420666F722062616E6B73FFFFFFFF0100F2052A01000000434104678AFDB0FE5548271967F1A67130B7105CD6A828E03909A67962E0EA1F61DEB649F6BC3F4CEF38C4F35504E51EC112DE5C384DF7BA0B8D578A4C702B6BF11D5FAC00000000

And when you split is apart into its pieces:
version:     01000000
prev block:  0000000000000000000000000000000000000000000000000000000000000000 
merkle root: 3BA3EDFD7A7B12B27AC72C3E67768F617FC81BC3888A51323A9FB8AA4B1E5E4A
timestamp:   29AB5F49
bits:        FFFF001D
nonce        1DAC2B7C
num txs:     01
tx1:         01000000010000000000000000000000000000000000000000000000000000000000000000FFFFFFFF4D04FFFF001D0104455468652054696D65732030332F4A616E2F32303039204368616E63656C6C6F72206F6E206272696E6B206F66207365636F6E64206261696C6F757420666F722062616E6B73FFFFFFFF0100F2052A01000000434104678AFDB0FE5548271967F1A67130B7105CD6A828E03909A67962E0EA1F61DEB649F6BC3F4CEF38C4F35504E51EC112DE5C384DF7BA0B8D578A4C702B6BF11D5FAC00000000

> **Comments:**
> **username_2**: And, according to BIP 22 if the server provided a workid, it MUST be included with submissions as the second parameter. Currently, Bitcoin Core states that this value is ignored.  

---

### Answer by username_3 on 2021-06-20. Score: 0

The input to `submitblock` is a "serialized" raw block in HEX. The format for a "serialized" block is here (hard to find!)....

<https://developer.bitcoin.org/reference/block_chain.html#serialized-blocks>

The raw transactions included at the end of the "serialized" block format are themselves formatted like this...

<https://developer.bitcoin.org/reference/transactions.html#raw-transaction-format>


---

