News:

Are you new to Groestlcoin and have questions you are afraid to ask?
Check out the New Users board and post there.
Welcome to all newcomers.

Main Menu

Merkle root

Started by Mikhail, April 06, 2018, 02:19:07 AM

Previous topic - Next topic

Mikhail

Hello everybody!

I am trying to calculate Merkle root of block #1814622. I got raw data from the Blockchain:
00000020
7573FFF2B563EB3E47485E7FF45770878EB51EAA7E4B8F50A36C1F0000000000
8805576AF81068D9BEEF3F26BD8704EB90075BD2E1814F17B948F3EE30B7A93C
394DF459 F5A0001C 02327E31
01 01000000 0001 01
0000000000000000000000000000000000000000000000000000000000000000 FFFFFFFF20035EB01B043A4DF4590828070942780000000D2F537570724E6F76612E63632F
00000000 02 0000000000000000 266A24AA21A9EDE2F61C3F71D1DEFD3FA999DFA36953755C690689799962B48BEBD836974E8CF90065CD1D00000000 1976A914F7FDC51CB004C521FC2E4430CFCC73A53FD309BB88AC
01 20 0000000000000000000000000000000000000000000000000000000000000000 00000000

Merkle root is 8805576AF81068D9BEEF3F26BD8704EB90075BD2E1814F17B948F3EE30B7A93C

This block contains only one transaction - coinbase transaction.
So I excluded marker 0x00, flag 0x01, number of whitness items 0x01, witness item size 0x20 and WTXID 0x00...00 (all removed elements are underlined) and found the coinbase transaction (bold):
01000000 01
0000000000000000000000000000000000000000000000000000000000000000 FFFFFFFF 20035EB01B043A4DF4590828070942780000000D2F537570724E6F76612E63632F 00000000 020000000000000000266A24AA21A9EDE2F61C3F71D1DEFD3FA999DFA36953755C690689799962B48BEBD836974E8CF90065CD1D00000000 1976A914F7FDC51CB004C521FC2E4430CFCC73A53FD309BB88AC 00000000
Then I doublehashed it with SHA256 and got A4E4CF472E7D300698D8D0851C51A465D90A54EE5E0C6BA02CFDE0E8E0F467F3 which is not what I was looking for.
Could you explain what am I doing wrong?

jackielove4u

#1
Merkle root of block #1814622 is: 3ca9b730eef348b9174f81e1d25b0790eb0487bd263fefbed96810f86a570588
You need to reverse the order (on 8805576AF81068D9BEEF3F26BD8704EB90075BD2E1814F17B948F3EE30B7A93C) from little to big endian

Block #1814622 contains only the coinbase transaction. When generating the merkle root for a block which contains a single transaction (only coinbase transaction) the merkle root is the same as the transaction id for the coinbase transaction

Quote from: Mikhail on April 06, 2018, 02:19:07 AM
Hello everybody!

I am trying to calculate Merkle root of block #1814622. I got raw data from the Blockchain:
00000020
7573FFF2B563EB3E47485E7FF45770878EB51EAA7E4B8F50A36C1F0000000000
8805576AF81068D9BEEF3F26BD8704EB90075BD2E1814F17B948F3EE30B7A93C
394DF459 F5A0001C 02327E31
01 01000000 0001 01
0000000000000000000000000000000000000000000000000000000000000000 FFFFFFFF20035EB01B043A4DF4590828070942780000000D2F537570724E6F76612E63632F
00000000 02 0000000000000000 266A24AA21A9EDE2F61C3F71D1DEFD3FA999DFA36953755C690689799962B48BEBD836974E8CF90065CD1D00000000 1976A914F7FDC51CB004C521FC2E4430CFCC73A53FD309BB88AC
01 20 0000000000000000000000000000000000000000000000000000000000000000 00000000

Merkle root is 8805576AF81068D9BEEF3F26BD8704EB90075BD2E1814F17B948F3EE30B7A93C

This block contains only one transaction - coinbase transaction.
So I excluded marker 0x00, flag 0x01, number of whitness items 0x01, witness item size 0x20 and WTXID 0x00...00 (all removed elements are underlined) and found the coinbase transaction (bold):
01000000 01
0000000000000000000000000000000000000000000000000000000000000000 FFFFFFFF 20035EB01B043A4DF4590828070942780000000D2F537570724E6F76612E63632F 00000000 020000000000000000266A24AA21A9EDE2F61C3F71D1DEFD3FA999DFA36953755C690689799962B48BEBD836974E8CF90065CD1D00000000 1976A914F7FDC51CB004C521FC2E4430CFCC73A53FD309BB88AC 00000000
Then I doublehashed it with SHA256 and got A4E4CF472E7D300698D8D0851C51A465D90A54EE5E0C6BA02CFDE0E8E0F467F3 which is not what I was looking for.
Could you explain what am I doing wrong?