Author

Topic: Solving Hash Function (Read 690 times)

hero member
Activity: 603
Merit: 500
June 06, 2014, 03:42:38 AM
#7
Right, ok. Think I got that.
Already starting to see why a calculator wouldn't be much use,
and that's before even getting to the SHA.
Serious learning curve ahead of me.
Thanks for the help.

No problem.
IMO, it is not easy to understand how bitcoin works in details, but it should be a fun experience (at least to me lol). Smiley
member
Activity: 112
Merit: 10
June 06, 2014, 03:31:40 AM
#6
Right, ok. Think I got that.
Already starting to see why a calculator wouldn't be much use,
and that's before even getting to the SHA.
Serious learning curve ahead of me.
Thanks for the help.
hero member
Activity: 603
Merit: 500
June 06, 2014, 03:05:35 AM
#5
Is the hextarget different to the difficulty factor? How do you find it?

For the relationship between "target" and "difficulty", please refer to https://en.bitcoin.it/wiki/Difficulty#What_is_the_formula_for_difficulty.3F
member
Activity: 112
Merit: 10
June 06, 2014, 03:01:31 AM
#4
Thanks for the replies,
It'll take me a while to get through it all, especially the hashing process, but i think i'll get it eventually.
Is the hextarget different to the difficulty factor? How do you find it?
hero member
Activity: 603
Merit: 500
June 06, 2014, 02:31:46 AM
#3
Am I right in thinking that you feed the nonce to the hash and if the value returned is lower than the difficulty you win a cuddly toy?
And if so, how is it done, say, on a calculator or on paper?

Long answer: Read DH's post above.
Short answer: The hash need to be lower than target value https://blockexplorer.com/q/hextarget, and you won't be able to compute sha256 hash with a hand calculator or with pen and paper correctly.
legendary
Activity: 3514
Merit: 4895
June 06, 2014, 02:20:10 AM
#2
Hi, could you quickly run through how the math is done with a hash function.

So for the last block solved, the hash was
000000000000000046e8f67e6af143384d02ef9c3196ab21766f305c45273997
The nonce was
3646718036
And the difficulty is
11,756,551,916.90

Am I right in thinking that you feed the nonce to the hash and if the value returned is lower than the difficulty you win a cuddly toy?

Well, sort of.

Place the nonce into the proper place in the block header (see here for a description of the data fields in the block header: http://james.lab6.com/2012/01/12/bitcoin-285-bytes-that-changed-the-world/ )

Then compute the SHA256 hash of that block header.

Then compute the SHA256 hash of the result of that hash result.

If the result is lower than the difficulty target then you win a cuddly toy.

And if so, how is it done, say, on a calculator or on paper?

Here's some pseudo code explaining the SHA2 process:

http://en.wikipedia.org/wiki/SHA2#Pseudocode
member
Activity: 112
Merit: 10
June 06, 2014, 02:10:42 AM
#1
Hi, could you quickly run through how the math is done with a hash function.

So for the last block solved, the hash was
000000000000000046e8f67e6af143384d02ef9c3196ab21766f305c45273997
The nonce was
3646718036
And the difficulty is
11,756,551,916.90

Am I right in thinking that you feed the nonce to the hash and if the value returned is lower than the difficulty you win a cuddly toy?
And if so, how is it done, say, on a calculator or on paper?

Thanks
Jump to: