user126986: Based on https://en.bitcoin.it/wiki/Getblocktemplate :

Collect your coinbase transaction (modified or not) at the front of the "transactions" list provided by the server. Apply a double-SHA256 hash to each transaction in the list. Now, as long as the list has more than 1 hash remaining, go through each pair and hash them together. That is, concatenate the first two, double-SHA256 that, repeat for the next two, and so on. If you encounter an odd pair (that is, the hash list ends with a single item and no pairing), concatenate it with itself and hash that. Continue to do that until there is only one hash left: that is your merkle root.

But what if the block is empty? Since there is no other transaction other than the coinbase transaction, it means there is only one hash.
Is the merkle root of an empty block the double hash of the coinbase transaction? Or do I still need to do something other than double hashing the coinbase?

user208: If the coinbase transaction is the only transaction in a block, then the block's transaction Merkle root is equal to the coinbase transaction's txid.

126986: <p>Based on <a href="https://en.bitcoin.it/wiki/Getblocktemplate" rel="nofollow noreferrer">https://en.bitcoin.it/wiki/Getblocktemplate</a> :</p>
<blockquote>
<p>Collect your coinbase transaction (modified or not) at the front of the &quot;transactions&quot; list provided by the server. Apply a double-SHA256 hash to each transaction in the list. Now, as long as the list has more than 1 hash remaining, go through each pair and hash them together. That is, concatenate the first two, double-SHA256 that, repeat for the next two, and so on. If you encounter an odd pair (that is, the hash list ends with a single item and no pairing), concatenate it with itself and hash that. Continue to do that until there is only one hash left: that is your merkle root.</p>
</blockquote>
<p>But what if the block is empty? Since there is no other transaction other than the coinbase transaction, it means there is only one hash.</p>
<p>Is the merkle root of an empty block the double hash of the coinbase transaction? Or do I still need to do something other than double hashing the coinbase?</p>
 208: <p>If the coinbase transaction is the only transaction in a block, then the block's transaction Merkle root is equal to the coinbase transaction's txid.</p>
