<p>This would indicate an empty block (no transactions). So only the coinbase transaction should be used to construct merkle root. In that case, the merkle root is the coinbase transaction’s hash.</p>
<p>For example block <a href="https://mempool.space/block/0000000000000000001240682db04d3a2e1894074e2855701445fc478901bd89?showDetails=true&amp;view=actual#details" rel="nofollow noreferrer">512,048 was an empty block</a>, and you can see that the coinbase transaction hash and Merkle root are the same:</p>
<p><a href="https://i.sstatic.net/OUzRT.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/OUzRT.png" alt="Example of a block’s details showing that coinbase transaction hash and Merkle root are identical" /></a></p>

CC BY-SA 4.0
2019-03-01T00:04:44.483Z
2023-08-18T16:49:59.030Z
2023-08-18T16:49:59.030Z
Fraggle
<p>Is there any help/tutorial on how to build the Merkle root from stratum data?</p>

<p>The Slushpool's stratum protocol has an example of a mining job but it does not contain any Merkle branches and I don't know if I am generating the Merkle root correctly.</p>

<p>Here is the string from Slushpool:</p>

<pre><code>{"params": ["bf", "4d16b6f85af6e2198f44ae2a6de67f78487ae5611b77c6c0440b921e00000000",
"01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff20020862062f503253482f04b8864e5008",
"072f736c7573682f000000000100f2052a010000001976a914d23fcdf86f7e756a64a7a9688ef9903327048ed988ac00000000", [],
"00000002", "1c2ac4af", "504e86b9", false], "id": null, "method": "mining.notify"}
</code></pre>

<merkle-tree><java>
How to build Merkle root from merkle branches?
Nikos
# How to build Merkle root from merkle branches?

(Asked by: username_0 on 2016-10-27)

Is there any help/tutorial on how to build the Merkle root from stratum data?

The Slushpool's stratum protocol has an example of a mining job but it does not contain any Merkle branches and I don't know if I am generating the Merkle root correctly.

Here is the string from Slushpool:

```
{"params": ["bf", "4d16b6f85af6e2198f44ae2a6de67f78487ae5611b77c6c0440b921e00000000",
"01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff20020862062f503253482f04b8864e5008",
"072f736c7573682f000000000100f2052a010000001976a914d23fcdf86f7e756a64a7a9688ef9903327048ed988ac00000000", [],
"00000002", "1c2ac4af", "504e86b9", false], "id": null, "method": "mining.notify"}

```

**Tags:** merkle-tree, java


---

## 1 answers

### Answer by username_1 on 2019-03-01. Score: 1

This would indicate an empty block (no transactions). So only the coinbase transaction should be used to construct merkle root. In that case, the merkle root is the coinbase transaction’s hash.

For example block [512,048 was an empty block](https://mempool.space/block/0000000000000000001240682db04d3a2e1894074e2855701445fc478901bd89?showDetails=true&view=actual#details), and you can see that the coinbase transaction hash and Merkle root are the same:

[![Example of a block’s details showing that coinbase transaction hash and Merkle root are identical](https://i.sstatic.net/OUzRT.png)](https://i.sstatic.net/OUzRT.png)


---

