<p>First of all, you need to use <code>gettxoutproof</code></p>

<pre><code>$ bitcoin-cli help gettxoutproof
gettxoutproof ["txid",...] ( "blockhash" )

Returns a hex-encoded proof that "txid" was included in a block.
...
</code></pre>

<p>you receive data including your transaction id with another txids (privacy purpose).
then you need create empty merkle tree and place txids inside leafs, check this <a href="https://bitcoin.org/en/developer-examples#parsing-a-merkleblock" rel="nofollow noreferrer">link</a> to know how you can do it. You need to work even with little and big endian</p>

<p>After that you have to concat leafs and do SHA256 twice until the merkle root.</p>

CC BY-SA 4.0
2020-05-04T12:30:36.830Z
2020-05-04T12:30:36.830Z
monkeyUser
<p>How could I verify my transaction from the root of Merkle Tree.</p>

CC BY-SA 4.0
2020-05-04T10:28:06.107Z
You can't with just the root of the tree. You need both the root and the path to have a proof.
Antoine Poinsot
CC BY-SA 4.0
2020-05-04T10:38:57.697Z
@vrnvav97 the tx that you want verify is on mainnet or testnet? If yes could you post the tx id so we can show a complete working example?
aqquadro
CC BY-SA 4.0
2020-05-04T12:13:35.843Z
@darosior ok so i need a path also to verify my tx.
vrnvav97
CC BY-SA 4.0
2020-05-04T12:14:29.620Z
@aqquadro its nowhere, i was clearing my doubts. But can u show any other working example?
vrnvav97
<transactions><merkle-tree>
How to find my transaction from root of Merkle Tree
vrnvav97
# How to find my transaction from root of Merkle Tree

(Asked by: username_0 on 2020-05-04)

How could I verify my transaction from the root of Merkle Tree.

**Tags:** transactions, merkle-tree

> **Comments:**
> **username_1**: You can't with just the root of the tree. You need both the root and the path to have a proof.  
> **username_2**: @username_0 the tx that you want verify is on mainnet or testnet? If yes could you post the tx id so we can show a complete working example?  
> **username_0**: @darosior ok so i need a path also to verify my tx.  
> **username_0**: @username_2 its nowhere, i was clearing my doubts. But can u show any other working example?  

---

## 1 answers

### Answer by username_3 on 2020-05-04. Score: 1

First of all, you need to use `gettxoutproof`

```
$ bitcoin-cli help gettxoutproof
gettxoutproof ["txid",...] ( "blockhash" )

Returns a hex-encoded proof that "txid" was included in a block.
...

```

you receive data including your transaction id with another txids (privacy purpose).
then you need create empty merkle tree and place txids inside leafs, check this [link](https://bitcoin.org/en/developer-examples#parsing-a-merkleblock) to know how you can do it. You need to work even with little and big endian

After that you have to concat leafs and do SHA256 twice until the merkle root.


---

