Getwork: Difference between revisions

From Bitcoin Wiki
Jump to navigation Jump to search
Bytemaster (talk | contribs)
Created page with "Just ignore the midstate until you understand the internals of SHA256. calculate: hash = SHA256(SHA256(data)) If that meets the difficulty, you win! If not, increment the port..."
 
Sgornick (talk | contribs)
Add a description.
Line 1: Line 1:
Just ignore the midstate until you understand the internals of SHA256.
An RPC method used by a miner to get hashing work to try to solve.
 
==Pseudocode==
 
(Just ignore the midstate until you understand the internals of SHA256.)


calculate: hash = SHA256(SHA256(data))
calculate: hash = SHA256(SHA256(data))


If that meets the difficulty, you win!
If that meets the [[difficulty]], you win!


If not, increment the portion of the data that starts 640 bits in (bytes 76 to 79), and try again.
If not, increment the portion of the data that starts 640 bits in (bytes 76 to 79), and try again.


If the incremented portion overflows, get new work.
If the incremented portion overflows, get new work.

Revision as of 08:03, 8 June 2011

An RPC method used by a miner to get hashing work to try to solve.

Pseudocode

(Just ignore the midstate until you understand the internals of SHA256.)

calculate: hash = SHA256(SHA256(data))

If that meets the difficulty, you win!

If not, increment the portion of the data that starts 640 bits in (bytes 76 to 79), and try again.

If the incremented portion overflows, get new work.