I am trying to use stratum to do pool mining.


Here, for multiple cases, we have List of Merkle branches to be empty. I am confused in calculating the Merkle Tree Root and would appreciate some insight on how to proceed from here.

For example, I have the following mining.notify request with no Merkle Tree Branches.

{ params:
   [ '0000002548928482',
     true ],
  id: null,
  method: 'mining.notify' }

I am using the NiceHash CryptoNight Pool.


My goal is to construct the mining blob from the given information.

I have seen this, How to Generate a Blob for PoW Hashing and am facing issues with tree_root_hash = compute_merkle_tree_root_hash(transaction_ids)


To my understanding from here, https://bitcoin.stackexchange.com/questions/22929/full-example-data-for-scrypt-stratum-client

I apply keccak 256 to coinbase = coinb1 + extranonce1 + extranonce2 + coinb2 to get hash

Followed by,

for each Merkle_branch
    byte = hash + merkle_branch
    hash = keccak256(byte)

to get the Merkle Tree Root Hash, is this correct?

1 Answer 1


If the transaction pool is empty, a mined block will still have 1 transaction (the miner's transaction claiming the block reward).

So to compute the Merkle tree root, you call the tree hashing function on the single hash of the miner transaction, which is in fact equivalent to doing nothing (Merkle tree root = miner transaction id).

  • Thanks for your answer. While I think I understand conceptually, I still have some implementation issues. I've added an example, here would I call the tree hashing function on Generation transaction (Part 1 concatenated with Part 2) to generate the Merkle tree root?
    – Cheran
    Commented Jul 3, 2018 at 9:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.