Author

Topic: Proof of Work (Read 882 times)

member
Activity: 73
Merit: 10
December 23, 2014, 04:59:18 AM
#7
Ok, thanks I'll try to write a tutorial with the information given here.
legendary
Activity: 1135
Merit: 1166
December 23, 2014, 04:35:22 AM
#6
Yes, but to build the header I need to know the nBits and I don't know where to find that value.
It is a representation of the difficulty in a particular format.  You can look at the code to find out, or probably there are also guides/docs somewhere about it.
member
Activity: 73
Merit: 10
December 23, 2014, 04:27:33 AM
#5
Yes, but to build the header I need to know the nBits and I don't know where to find that value.
legendary
Activity: 1652
Merit: 1016
December 23, 2014, 04:23:27 AM
#4
The block header will be exactly 80 bytes in length.
You need to hash the header in binary format, not text format.
member
Activity: 73
Merit: 10
December 23, 2014, 04:01:15 AM
#3
Thanks for the reply.
There is one piece of information from the block header I don't know where to get it from. It says the target threshold is needed, but does not say what it is. Is it the current difficulty?

copper member
Activity: 1498
Merit: 1528
No I dont escrow anymore.
December 23, 2014, 03:42:41 AM
#2
A little intro into PoW can be found in the wiki [1], more can be found in the whitepaper[2] and the dev guide [3].
In short: you hash the header [4] which includes the nounce as well as the merkle root hash (thus a different set of transactions result in a different blockhash even if the nonce is the same) the previous blocks hash etc. (see [4] for details)


[1] https://en.bitcoin.it/wiki/Proof_of_work
[2] https://bitcoin.org/bitcoin.pdf   -  chapter 4
[3] https://bitcoin.org/en/developer-guide#proof-of-work
[4] https://bitcoin.org/en/developer-reference#block-headers
member
Activity: 73
Merit: 10
December 23, 2014, 03:06:38 AM
#1
Hello,

I'm having a hard time trying to find what is exactly being hashed ( plus the nonce ) to find the string with enough 0's.
I've tried the previous tx hash, the current and previous Merkle root, but no luck.

Does anyone know?

Thanks
Jump to: