# New getwork

Post by: satoshi on November 23, 2010, 07:50:12 PM<br>
Last edit: November 24, 2010, 04:43:43 PM by satoshi

I uploaded a redesign of m0mchil's getwork to SVN rev 189 (version 31601)

m0mchil's external bitcoin miner idea has solved a lot of problems. &nbsp;GPU programming is immature and hard to compile, and I didn't want to add additional dependencies to the build. &nbsp;getwork allows these problems to be solved separately, with different programs for different hardware and OSes. &nbsp;It's also convenient that server farms can run a single Bitcoin node and the rest only run getwork clients.

The interface has a few changes:

getwork \[data\]<br>
If \[data\] is not specified, returns formatted hash data to work on:<br>
&nbsp;&nbsp;"midstate" : precomputed hash state after hashing the first half of the data<br>
&nbsp;&nbsp;"data" : block data<br>
&nbsp;&nbsp;"hash1" : formatted hash buffer for second hash<br>
&nbsp;&nbsp;"target" : little endian hash target<br>
If \[data\] is specified, tries to solve the block and returns true if it was successful. &nbsp;\[data\] is the same 128 byte block data that was returned in the "data" field, but with the nonce changed.

Notes:<br>
\- It does not return work when you submit a possible hit, only when called without parameter.<br>
\- The block field has been separated into data and hash1.<br>
\- data is 128 bytes, which includes the first half that's already hashed by midstate.<br>
\- hash1 is always the same, but included for convenience.<br>
\- Logging of "ThreadRPCServer method=getwork" is disabled, it would be too much junk in the log.

---

Source file: bitcoin-forum-satoshi-nakamoto.tgz

External link: https://bitcointalk.org/index.php?topic=1901.msg23876#msg23876
