<p>Look at <a href="https://blockchain.info/block/000000000000000004f0cc322f551e39676f781186441614da3281bbc7d373e0" rel="nofollow noreferrer">a block on a block explorer</a>. </p>

<p><a href="https://i.sstatic.net/oBJOa.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/oBJOa.png" alt="enter image description here"></a></p>

<p>Here the Prev_Hash is called 'Previous Block' and the Tx_Root is called 'Merkle Root'.</p>

<p>For more technical info, take a look at the <a href="https://en.bitcoin.it/wiki/Protocol_documentation" rel="nofollow noreferrer">Protocol Documentation</a>.</p>

CC BY-SA 3.0
2016-04-16T01:06:32.077Z
Awesome, thanks. Can I use `getblock` to access this via the Blockchain API? And also how can I find the hash of the latest block? Thanks!
Anthony
CC BY-SA 3.0
2016-04-16T01:09:20.763Z
I'm not an expert on Blockchain's API, but their documentation is here: https://blockchain.info/api/blockchain_api. For the latest block, it looks like you can use: https://blockchain.info/latestblock.
morsecoder
CC BY-SA 3.0
2016-04-16T01:14:04.353Z
Whoops, I meant to say use `getblock` to access this via the Bitcoin API, typo.
Anthony
CC BY-SA 3.0
2016-04-17T08:32:11.347Z
You mean the Bitcoin Core RPC command `getblock`? Yes, it reports those values.
Pieter Wuille
CC BY-SA 3.0
2016-04-16T01:01:59.680Z
2016-04-16T01:01:59.680Z
morsecoder
<p><a href="https://bitcoin.stackexchange.com/a/13347/27951">https://bitcoin.stackexchange.com/a/13347/27951</a></p>

<p>Based upon the answer here, it seems there's values per block with each <code>Prev_Hash</code> and also <code>Tx_Root</code></p>

<p>There doesn't seem to be much documentation for how to access these. How can I find the <code>Prev_Hash</code> and the <code>Tx_Root</code> of the most recent block for example?</p>

<p>Thanks</p>

CC BY-SA 3.0
2016-04-16T00:50:58.260Z
Do you want to access the values from code? Or just see them? You can see the values on a block explorer, but to decode the values from a raw block you'd need to understand the message [protocol format](https://en.bitcoin.it/wiki/Protocol_documentation).
morsecoder
CC BY-SA 3.0
2016-04-16T00:58:03.700Z
I'd like to see them for now but additionally access them by code eventually. I've found the `getblock` method which can be used to display the merkle tree, but how do I find the `blockHash` parameter to pass to that method, for say the last block or last 10 blocks? Not sure where I can find those `blockHash`es
Anthony
<bitcoind><blockchain>
How to find values of Prev_Hash and Tx_Root
Anthony
# How to find values of Prev_Hash and Tx_Root

(Asked by: username_0 on 2016-04-15)

<https://bitcoin.stackexchange.com/a/13347/27951>

Based upon the answer here, it seems there's values per block with each `Prev_Hash` and also `Tx_Root`

There doesn't seem to be much documentation for how to access these. How can I find the `Prev_Hash` and the `Tx_Root` of the most recent block for example?

Thanks

**Tags:** bitcoind, blockchain

> **Comments:**
> **username_1**: Do you want to access the values from code? Or just see them? You can see the values on a block explorer, but to decode the values from a raw block you'd need to understand the message [protocol format](https://en.bitcoin.it/wiki/Protocol_documentation).  
> **username_0**: I'd like to see them for now but additionally access them by code eventually. I've found the `getblock` method which can be used to display the merkle tree, but how do I find the `blockHash` parameter to pass to that method, for say the last block or last 10 blocks? Not sure where I can find those `blockHash`es  

---

## 1 answers

### Answer by username_1 on 2016-04-16. Score: 1 | Accepted answer

Look at [a block on a block explorer](https://blockchain.info/block/000000000000000004f0cc322f551e39676f781186441614da3281bbc7d373e0).

[![enter image description here](https://i.sstatic.net/oBJOa.png)](https://i.sstatic.net/oBJOa.png)

Here the Prev\_Hash is called 'Previous Block' and the Tx\_Root is called 'Merkle Root'.

For more technical info, take a look at the [Protocol Documentation](https://en.bitcoin.it/wiki/Protocol_documentation).

> **Comments:**
> **username_0**: Awesome, thanks. Can I use `getblock` to access this via the Blockchain API? And also how can I find the hash of the latest block? Thanks!  
> **username_1**: I'm not an expert on Blockchain's API, but their documentation is here: https://blockchain.info/api/blockchain_api. For the latest block, it looks like you can use: https://blockchain.info/latestblock.  
> **username_0**: Whoops, I meant to say use `getblock` to access this via the Bitcoin API, typo.  
> **username_2**: You mean the Bitcoin Core RPC command `getblock`? Yes, it reports those values.  

---

