<p>What pool are you using? As an example, if you hit (POST a request to) eligius pool (<a href="http://gbt.mining.eligius.st:9337" rel="nofollow">http://gbt.mining.eligius.st:9337</a>) with the body as </p>

<p>{"id": 0, "method": "getblocktemplate", "params": [{"capabilities": ["coinbasetxn", "workid", "coinbase/append"]}]}</p>

<p>as taken from <a href="https://en.bitcoin.it/wiki/Getblocktemplate" rel="nofollow">https://en.bitcoin.it/wiki/Getblocktemplate</a> you will get a coinbasetxn field returned in the json. </p>

CC BY-SA 3.0
2016-01-06T05:53:33.253Z
You got me :) I'm calling my own bitcoind service. I do not get it back. Perhaps there is a configuration setting. This is what I submit.
.\bitcoin-cli.exe getblocktemplate '{\"id\": 0, \"method\": \"getblocktemplate\",  \"params\": [{\"capabilities\": [\"coinbasetxn\", \"workid\", \"coinbase/append\"],\"mutable\": [\"coinbase/append\"] }]}'
n8CodeGuru
CC BY-SA 3.0
2016-01-06T03:37:30.517Z
2016-01-06T03:37:30.517Z
cloudnthings
<p>The coinbase transaction is on the top of the list. I was not able to verify the merkle chain because I think I have not reversed the endianess of the hash. I am using the same python code I got from the provided examples. I have not verified that this is the issue yet as I am not sure if I need to put the coinbase txn at the front or the end before the.</p>

<p>I am using dblsha(coinbase).encode('hex') perhaps there is another python method that does not reverse endianess.</p>

CC BY-SA 3.0
2016-01-06T17:00:18.503Z
2016-01-06T17:00:18.503Z
n8CodeGuru
<p>How do you build a merkle root without a coinbase transaction? I compute the merkle root without the coinbase portion and I get a different root then the submitter. </p>

CC BY-SA 3.0
2016-01-06T02:20:38.737Z
Could you clarify the intent behind your question? Calculating the merkle root in the Bitcoin protocol includes the coinbase.
Nick ODell
CC BY-SA 3.0
2016-01-06T02:23:34.093Z
Same as question http://bitcoin.stackexchange.com/q/28133/31696 actually. I ask for coinbasetxn and do not get it from the pool. Is the pool set up wrong? (i.e I specify the mutable key to return it but it does not)
n8CodeGuru
CC BY-SA 3.0
2016-01-06T16:53:29.347Z
basically I am trying to verify I have everything right to compute merkle root if I where to submit a block. So I examine another submission. For an example I use block 391971 and I find that the coinbase transaction is actually at the top. So I change my code to generate the merkle root without a coinbase txn to verify I check the result I get for getrawtransaction of the coinbase transaction and double has that using dblsha(coinbase).encode('hex') now what I get is the little endian form of the hash. I am using the same python code in the exampe
n8CodeGuru
<bitcoind><getblocktemplate>
How to compute merkle root without coinbasetxn?
n8CodeGuru
# How to compute merkle root without coinbasetxn?

(Asked by: username_0 on 2016-01-06)

How do you build a merkle root without a coinbase transaction? I compute the merkle root without the coinbase portion and I get a different root then the submitter.

**Tags:** bitcoind, getblocktemplate

> **Comments:**
> **username_1**: Could you clarify the intent behind your question? Calculating the merkle root in the Bitcoin protocol includes the coinbase.  
> **username_0**: Same as question http://bitcoin.stackexchange.com/q/28133/31696 actually. I ask for coinbasetxn and do not get it from the pool. Is the pool set up wrong? (i.e I specify the mutable key to return it but it does not)  
> **username_0**: basically I am trying to verify I have everything right to compute merkle root if I where to submit a block. So I examine another submission. For an example I use block 391971 and I find that the coinbase transaction is actually at the top. So I change my code to generate the merkle root without a coinbase txn to verify I check the result I get for getrawtransaction of the coinbase transaction and double has that using dblsha(coinbase).encode('hex') now what I get is the little endian form of the hash. I am using the same python code in the exampe  

---

## 2 answers

### Answer by username_2 on 2016-01-06. Score: 1

What pool are you using? As an example, if you hit (POST a request to) eligius pool (<http://gbt.mining.eligius.st:9337>) with the body as

{"id": 0, "method": "getblocktemplate", "params": [{"capabilities": ["coinbasetxn", "workid", "coinbase/append"]}]}

as taken from <https://en.bitcoin.it/wiki/Getblocktemplate> you will get a coinbasetxn field returned in the json.

> **Comments:**
> **username_0**: You got me :) I'm calling my own bitcoind service. I do not get it back. Perhaps there is a configuration setting. This is what I submit. .\bitcoin-cli.exe getblocktemplate '{\"id\": 0, \"method\": \"getblocktemplate\",  \"params\": [{\"capabilities\": [\"coinbasetxn\", \"workid\", \"coinbase/append\"],\"mutable\": [\"coinbase/append\"] }]}'  

---

### Answer by username_0 on 2016-01-06. Score: 0

The coinbase transaction is on the top of the list. I was not able to verify the merkle chain because I think I have not reversed the endianess of the hash. I am using the same python code I got from the provided examples. I have not verified that this is the issue yet as I am not sure if I need to put the coinbase txn at the front or the end before the.

I am using dblsha(coinbase).encode('hex') perhaps there is another python method that does not reverse endianess.


---

