<p>The `submitheader RPC checks the header against the candidate chain tip to check if it is valid(i.e has sufficient PoW).</p>
<blockquote>
<p>Is that a legacy function? Or can it still be used?</p>
</blockquote>
<p>This can still be used today. Its primary use in quickly checking if a certain header is valid without actually checking the entire block (compared to <code>submitblock</code>). This is computationally much cheaper than checking the entire block which involves checking the double spends, transaction signature verification, Merkle root calculations etc.</p>
<p>For example, you can implement the chain sync logic using headers-first outside <code>bitcoind</code> using this RPC. And according to the <a href="https://github.com/bitcoin/bitcoin/pull/13399" rel="nofollow noreferrer">submitheaders PR</a>, it was required for implementation of BetterHash protocol.</p>

CC BY-SA 4.0
2023-03-19T10:50:38.387Z
re "has sufficient PoW": Looking through [0], it appears that min_pow_checked is assumed as true without actually checking the PoW first?

A comment on the PR which introduced min_pow_checked[1] mentions that: "min_pow_checked can be setup to true .. when the block have been submitted by a RPC caller (like in submitheader())".

Should I take that to mean PoW is assumed to be already verified by the caller?

[0] https://github.com/bitcoin/bitcoin/blob/50171df26c719c128dfb9c6a288ca7956562ba8e/src/rpc/mining.cpp#L1026
[1] https://github.com/bitcoin/bitcoin/pull/25717#discussion_r961860152
shesek
CC BY-SA 4.0
2021-03-09T23:10:25.250Z
2021-07-22T17:43:08.800Z
2021-07-22T17:43:08.800Z
sanket1729
<p>I understand what the usage is for submit block, but submit header exists in the RPC API reference.  Is that a legacy function?  Or can it still be used?</p>
<p>Thanks</p>

CC BY-SA 4.0
2021-03-05T04:41:01.227Z
See https://github.com/bitcoin/bitcoin/pull/13399
sanket1729
CC BY-SA 4.0
2021-03-07T12:34:48.780Z
@sanket1729 That answers it. I would give the bounty to you if you post the link as an answer.
MCCCS
<bitcoin-core><json-rpc><mining-theory>
What is the purpose of submit header relative to submit block?
minutiae
# What is the purpose of submit header relative to submit block?

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

I understand what the usage is for submit block, but submit header exists in the RPC API reference. Is that a legacy function? Or can it still be used?

Thanks

**Tags:** bitcoin-core, json-rpc, mining-theory

> **Comments:**
> **username_1**: See https://github.com/bitcoin/bitcoin/pull/13399  
> **username_2**: @username_1 That answers it. I would give the bounty to you if you post the link as an answer.  

---

## 1 answers

### Answer by username_1 on 2021-03-09. Score: 4

The `submitheader RPC checks the header against the candidate chain tip to check if it is valid(i.e has sufficient PoW).

> Is that a legacy function? Or can it still be used?

This can still be used today. Its primary use in quickly checking if a certain header is valid without actually checking the entire block (compared to `submitblock`). This is computationally much cheaper than checking the entire block which involves checking the double spends, transaction signature verification, Merkle root calculations etc.

For example, you can implement the chain sync logic using headers-first outside `bitcoind` using this RPC. And according to the [submitheaders PR](https://github.com/bitcoin/bitcoin/pull/13399), it was required for implementation of BetterHash protocol.

> **Comments:**
> **username_3**: re "has sufficient PoW": Looking through [0], it appears that min_pow_checked is assumed as true without actually checking the PoW first?  A comment on the PR which introduced min_pow_checked[1] mentions that: "min_pow_checked can be setup to true .. when the block have been submitted by a RPC caller (like in submitheader())".  Should I take that to mean PoW is assumed to be already verified by the caller?  [0] https://github.com/bitcoin/bitcoin/blob/50171df26c719c128dfb9c6a288ca7956562ba8e/src/rpc/mining.cpp#L1026 [1] https://github.com/bitcoin/bitcoin/pull/25717#discussion_r961860152  

---

