<p>The input to <code>submitblock</code> is a full serialized block, encoded in hexadecimal.</p>
<p>Block serialization consists of:</p>
<ul>
<li>The block header (80 bytes)</li>
<li>A CompactSize encoding of the number of transactions</li>
<li>The transactions, one by one, concatenated one after the other.</li>
</ul>

CC BY-SA 4.0
2023-03-04T21:57:19.720Z
Sorry for my stupid question.
But what do you mean by serialized block?
Did you mean raw block in binary format?
(What you actually mean encoded hexadecimal means that convert this binary data to hexadecimal)
Ali
CC BY-SA 4.0
2023-03-04T22:04:01.757Z
Yes, all of that. I think of transactions and blocks as abstract data structures (collections of information with amounts and scripts, not bytes). The protocol defines a specific way of converting these data structures to binary data, a process known as serialization (and deserialization).
Pieter Wuille
CC BY-SA 4.0
2023-03-04T14:02:41.787Z
2023-03-04T14:02:41.787Z
Pieter Wuille
<p>I have installed Bitcoin Core on my laptop.</p>
<p>Now open bitcoin daemon and do following:</p>
<p>First i run <strong>getbestblockhash</strong> to get the last block hash on the Blockchain. We call this hash as <em><strong>BestBlockHash</strong></em>.</p>
<p>After that i run:
getblock <em><strong>BestBlockHash</strong></em> 0</p>
<p>The daemon return <strong>huge continues hex string data</strong>, which is consist of <strong>block header</strong> and <strong>block body</strong>(which is the transactions data)</p>
<p><em>Now my question!</em></p>
<p>Is this exactly the <strong>input of the submitblock function</strong>? (which the miner who mine this block, entered this)</p>
<p><em>My purpose in asking this question is to know exactly what the input of the submitblock function looks like.</em></p>
<p>Thanks in advance,</p>

CC BY-SA 4.0
2023-03-02T22:37:01.557Z
I would suspect that this is the case, but if I wanted to verify this, I would call `bitcoin-cli help submitblock`. I assume that one should then see a help text that points towards [BIP22](https://bips.xyz/22).
Murch
CC BY-SA 4.0
2023-03-02T22:54:02.097Z
Tanks for your reply, yeawh actually i have tried all these ways, But I am still confused that what is the submitblock input parameters exactly.
Ali
<json-rpc><bitcoin-cli><raw-transaction><daemon>
Submitblock input parameters similar to getblock?
Ali
# Submitblock input parameters similar to getblock?

(Asked by: username_0 on 2023-03-02)

I have installed Bitcoin Core on my laptop.

Now open bitcoin daemon and do following:

First i run **getbestblockhash** to get the last block hash on the Blockchain. We call this hash as ***BestBlockHash***.

After that i run:
getblock ***BestBlockHash*** 0

The daemon return **huge continues hex string data**, which is consist of **block header** and **block body**(which is the transactions data)

*Now my question!*

Is this exactly the **input of the submitblock function**? (which the miner who mine this block, entered this)

*My purpose in asking this question is to know exactly what the input of the submitblock function looks like.*

Thanks in advance,

**Tags:** json-rpc, bitcoin-cli, raw-transaction, daemon

> **Comments:**
> **username_1**: I would suspect that this is the case, but if I wanted to verify this, I would call `bitcoin-cli help submitblock`. I assume that one should then see a help text that points towards [BIP22](https://bips.xyz/22).  
> **username_0**: Tanks for your reply, yeawh actually i have tried all these ways, But I am still confused that what is the submitblock input parameters exactly.  

---

## 1 answers

### Answer by username_2 on 2023-03-04. Score: 2 | Accepted answer

The input to `submitblock` is a full serialized block, encoded in hexadecimal.

Block serialization consists of:

* The block header (80 bytes)
* A CompactSize encoding of the number of transactions
* The transactions, one by one, concatenated one after the other.

> **Comments:**
> **username_0**: Sorry for my stupid question. But what do you mean by serialized block? Did you mean raw block in binary format? (What you actually mean encoded hexadecimal means that convert this binary data to hexadecimal)  
> **username_2**: Yes, all of that. I think of transactions and blocks as abstract data structures (collections of information with amounts and scripts, not bytes). The protocol defines a specific way of converting these data structures to binary data, a process known as serialization (and deserialization).  

---

