<p>Let's use the following block for a reference:
<a href="http://blockexplorer.com/rawblock/00000000000000001e8d6829a8a21adc5d38d0a473b144b6765798e61f98bd1d" rel="nofollow">http://blockexplorer.com/rawblock/00000000000000001e8d6829a8a21adc5d38d0a473b144b6765798e61f98bd1d</a></p>

<p>According to my understanding (correct if wrong), I need to perform a byteSwap on each child, perform a hexToAscii, concatenate, then perform a double sha256.  I am doing this in JAVA, an suspect that my hexToAscii method is off. I was hoping I could give some results to see if someone can verify where the problem is.</p>

<pre><code>String childNode = "0d0eb1b4c4b49fd27d100e9cce555d4110594661b1b8ac05a4b8879c84959bd4";
byteSwap(childNode); //d49b95849c87b8a405acb8b161465910415d55ce9c0e107dd29fb4c4b4b10e0d
hexToAscii(byteSwap(childNode)); //Ô¸¤¬¸±aFYA]UÎ}Ò´Ä´±
</code></pre>

<p>And just to verify that my hexToAscii result is correct, can someone check the sha256 hash of the result? I feel that there are encoding issues with my implementation</p>

<pre><code>sha256(hexToAscii(byteSwap(childNode)));
//e799dc13aaeaa1c2797596f5d4bf6c408b97a8595bf32c27c9186125454560d9
</code></pre>

<p>Would appreciate any advice if something seems off! Thanks!</p>

CC BY-SA 3.0
2013-12-01T18:53:55.397Z
How does your hex to ASCII code look like?
Daniel S.
CC BY-SA 3.0
2013-12-01T18:55:49.370Z
You can save the result of hexToAscii to a file and then use a hexeditor to verify your data (or hexdump -C <filename> if you have it installed, e.g. on ubuntu). Moreover, you can post this question at stackoverflow, where it will receive way more attention.
Daniel S.
CC BY-SA 3.0
2013-12-01T20:14:24.203Z
It would actually be better for someone who has a working bitcoin implementation to verify.  This way we can directly compare results. Thanks though.  Additionally, my methodology is still in question, and someone with a working knowledge of the implementation might correct me.
Tyrick
CC BY-SA 3.0
2013-12-04T11:57:10.940Z
So you're stuck with this problem, you get ideas what to do, and you still +want+ it to be solved in that way that you really want. Mh.
Daniel S.
<java><merkle-tree>
Verifying mrkl_root from two children nodes in JAVA
Tyrick
# Verifying mrkl_root from two children nodes in JAVA

(Asked by: username_0 on 2013-12-01)

Let's use the following block for a reference:
<http://blockexplorer.com/rawblock/00000000000000001e8d6829a8a21adc5d38d0a473b144b6765798e61f98bd1d>

According to my understanding (correct if wrong), I need to perform a byteSwap on each child, perform a hexToAscii, concatenate, then perform a double sha256. I am doing this in JAVA, an suspect that my hexToAscii method is off. I was hoping I could give some results to see if someone can verify where the problem is.

```
String childNode = "0d0eb1b4c4b49fd27d100e9cce555d4110594661b1b8ac05a4b8879c84959bd4";
byteSwap(childNode); //d49b95849c87b8a405acb8b161465910415d55ce9c0e107dd29fb4c4b4b10e0d
hexToAscii(byteSwap(childNode)); //Ô¸¤¬¸±aFYA]UÎ}Ò´Ä´±

```

And just to verify that my hexToAscii result is correct, can someone check the sha256 hash of the result? I feel that there are encoding issues with my implementation

```
sha256(hexToAscii(byteSwap(childNode)));
//e799dc13aaeaa1c2797596f5d4bf6c408b97a8595bf32c27c9186125454560d9

```

Would appreciate any advice if something seems off! Thanks!

**Tags:** java, merkle-tree

> **Comments:**
> **username_1**: How does your hex to ASCII code look like?  
> **username_1**: You can save the result of hexToAscii to a file and then use a hexeditor to verify your data (or hexdump -C <filename> if you have it installed, e.g. on ubuntu). Moreover, you can post this question at stackoverflow, where it will receive way more attention.  
> **username_0**: It would actually be better for someone who has a working bitcoin implementation to verify.  This way we can directly compare results. Thanks though.  Additionally, my methodology is still in question, and someone with a working knowledge of the implementation might correct me.  
> **username_1**: So you're stuck with this problem, you get ideas what to do, and you still +want+ it to be solved in that way that you really want. Mh.  

---

## 0 answers

