<p>The merkle root of a block is the hash of all of the transactions. If there is one transaction, then the hash of all of the transactions is the hash of that one transaction. So the merkle root and the txid of the only transaction in a one transaction block will be the same.</p>

CC BY-SA 3.0
2017-10-19T04:28:32.927Z
2017-10-19T04:28:32.927Z
Ava Chow
<p>I know that merkle hash for one transaction tx is:</p>

<p>sha256(sha256(tx))</p>

<p>In this block:
<a href="https://blockchain.info/block/000000000000000001291219dde8ed705903e8c101f416c68a439e5171ede5bc" rel="nofollow noreferrer">https://blockchain.info/block/000000000000000001291219dde8ed705903e8c101f416c68a439e5171ede5bc</a></p>

<p>there is only one transaction, but the merkle root equals to transaction hash!!!</p>

<p>So, how merkle root can be calculated???</p>

CC BY-SA 3.0
2017-10-19T03:59:06.093Z
You've answered your own question. The Merkle root of for a single transaction is just the transaction hash, by definition.
Pieter Wuille
<development><block><protocol><block-header><merkle-tree>
Merkle Root for 1-transaction block!
Sh Sh
# Merkle Root for 1-transaction block!

(Asked by: username_0 on 2017-10-19)

I know that merkle hash for one transaction tx is:

sha256(sha256(tx))

In this block:
<https://blockchain.info/block/000000000000000001291219dde8ed705903e8c101f416c68a439e5171ede5bc>

there is only one transaction, but the merkle root equals to transaction hash!!!

So, how merkle root can be calculated???

**Tags:** development, block, protocol, block-header, merkle-tree

> **Comments:**
> **username_1**: You've answered your own question. The Merkle root of for a single transaction is just the transaction hash, by definition.  

---

## 1 answers

### Answer by username_2 on 2017-10-19. Score: 5 | Accepted answer

The merkle root of a block is the hash of all of the transactions. If there is one transaction, then the hash of all of the transactions is the hash of that one transaction. So the merkle root and the txid of the only transaction in a one transaction block will be the same.


---

