Author

Topic: protocol specs on wiki (Read 1144 times)

kjj
legendary
Activity: 1302
Merit: 1026
May 22, 2011, 11:57:39 PM
#5
Keep in mind that the most significant bits are on the right.  The first hash has a leading zero, which is actually a trailing zero.  It is important to the second round.
administrator
Activity: 5222
Merit: 13032
May 22, 2011, 10:56:00 PM
#4
Yes, the comments need to be removed. To make that example, I just used this online tool:
http://www.fileformat.info/tool/hash.htm
newbie
Activity: 24
Merit: 0
May 22, 2011, 10:46:35 PM
#3
Any chance you could show me how you did those hashes? If it were an endian problem, I'd expect to get the wrong hash for "hello" on both cases, not just one.

For the block you posted, I didnt get the right hash in either case. Am I to remove the the " previous block" text and just leave the values when I do the computation?
administrator
Activity: 5222
Merit: 13032
May 22, 2011, 10:37:28 PM
#2
Probably endianness problems.

Looking at this block:
http://blockexplorer.com/rawblock/000000000000479de7df494b25c838f0e102d696e08ad2bb74066d7a7ae69511
Its binary header is:
Code:
01000000 version
1d8f4ec0443e1f19f305e488c1085c95de7cc3fd25e0d2c5bb5d000000000000 previous block
9762547903d36881a86751f3f5049e23050113f779735ef82734ebf0b4450081 Merkle root
d8c8c84d timestamp
b3936a1a bits
334b035b nonce

Hashed once:
0cdb93c3412d2f30eb7d8dfd13d3142eaa8738c0de2337ac8a80c623715d9c07
Hashed twice:
1195e67a7a6d0674bbd28ae096d602e1f038c8254b49dfe79d47000000000000
newbie
Activity: 24
Merit: 0
May 22, 2011, 10:16:10 PM
#1
I was trying to use an online sha-256 calculator to verify blocks, but I have had no luck. I was just stringing together the "header" and applying the sha-256 algorithm twice. Then I noticed that I get different results to "hello" than is displayed on the wiki. It shows two rounds of the hash algorithm. I get a match for the first round, but not on the second. Any idea what is going on here? Thanks

https://en.bitcoin.it/wiki/Protocol_specification
Jump to: