Title: miner client - just to understand mining Post by: questionstorm on October 27, 2012, 05:33:21 PM Hi,
I'm trying to implement a simple miner just to understand the steps of minimg bitcoins. The implementation is a bit simplistic because the goal is to understand mining, not to make a fast miner. This is the code skeleton: Code: #!/usr/bin/env ruby I'd like to ask a little help how to do it. getwork['data'] is a 256 length hexa string (128 byte), and I'm not sure what parts of that data have to be hashed, and how to combine it with the nonce. In the above code I just use the first 76 bytes (152 hexa digits) of the data, but I'm afraid it's not what I should do. As you can see I don't know how to send back when I find a hash. I suppose I should use the submitblock request, but what is the proper way to do this? What is exactly the first paramether of that call? What are midstate and hash1 good for? How do these things speed up mining? I know that getwork is an ancient way, and there are so-called extensions to the protocol, long polling, and other scary things. Is there a brief introductory documentation about all these things somewhere? Title: Re: miner client - just to understand mining Post by: awesomey on October 28, 2012, 03:48:11 AM You might try this forum category: Development & Technical Discussion (https://bitcointalk.org/index.php?board=6.0)
|