<p>To submit a valid block to the block chain you don't use the hash, just the block. That's the block header plus the transactions.</p>

<p>Use bitcoind's submitblock RPC call.</p>

<pre><code>&gt; bitcoind help submitblock
submitblock &lt;hex data&gt; [optional-params-obj]
[optional-params-obj] parameter is currently ignored.
Attempts to submit new block to network.
See https://en.bitcoin.it/wiki/BIP_0022 for full specification.
</code></pre>

<p>So you hex encode the block and send it as lone parameter to submitblock. That's all.</p>

<p>As the help text says, <code>submitblock</code> is further documented in <a href="https://en.bitcoin.it/wiki/BIP_0022" rel="noreferrer">BIP22</a></p>

CC BY-SA 3.0
2013-03-06T09:04:05.153Z
So the hash you create is just part of the overall block?
ghostJago
CC BY-SA 3.0
2013-03-06T12:21:39.213Z
The hash is not part of the block. The block is the block header + transactions. There are many hashes used in bit coin, but the one you mine is the hash of the block header. It's not part of the block, but derived from it. What is in the block header though is the hash of the *previous* block. That's how the blocks are linked together in a chain.
Dr.Haribo
CC BY-SA 4.0
2021-02-20T16:30:58.960Z
What are the endpoints?
WJA
CC BY-SA 3.0
2013-03-05T17:33:07.053Z
2013-03-05T17:33:07.053Z
Dr.Haribo
<p>So as an exercise I want to build a mining client, just because I'm curious.</p>

<p>I understand that I'm supposed to create a hash, but once I have the hash, where do I send it? </p>

<p>How do I submit it back to the block chain?</p>

CC BY-SA 3.0
2013-03-03T12:24:03.953Z
You can look at `bitcoind` sources if you want https://github.com/bitcoin/bitcoin
o0'.
<blockchain><json-rpc><block><mining-software><relay>
I built a miner, got a hash block, now what? Where do I send it?
ghostJago
# I built a miner, got a hash block, now what? Where do I send it?

(Asked by: username_0 on 2013-03-03)

So as an exercise I want to build a mining client, just because I'm curious.

I understand that I'm supposed to create a hash, but once I have the hash, where do I send it?

How do I submit it back to the block chain?

**Tags:** blockchain, json-rpc, block, mining-software, relay

> **Comments:**
> **username_1**: You can look at `bitcoind` sources if you want https://github.com/bitcoin/bitcoin  

---

## 1 answers

### Answer by username_2 on 2013-03-05. Score: 6 | Accepted answer

To submit a valid block to the block chain you don't use the hash, just the block. That's the block header plus the transactions.

Use bitcoind's submitblock RPC call.

```
> bitcoind help submitblock
submitblock <hex data> [optional-params-obj]
[optional-params-obj] parameter is currently ignored.
Attempts to submit new block to network.
See https://en.bitcoin.it/wiki/BIP_0022 for full specification.

```

So you hex encode the block and send it as lone parameter to submitblock. That's all.

As the help text says, `submitblock` is further documented in [BIP22](https://en.bitcoin.it/wiki/BIP_0022)

> **Comments:**
> **username_0**: So the hash you create is just part of the overall block?  
> **username_2**: The hash is not part of the block. The block is the block header + transactions. There are many hashes used in bit coin, but the one you mine is the hash of the block header. It's not part of the block, but derived from it. What is in the block header though is the hash of the *previous* block. That's how the blocks are linked together in a chain.  
> **username_3**: What are the endpoints?  

---

