2

When sending a getwork request, one always includes an id value. Does this value have any meaning? Will it cause problems to have multiple miners use the same id? Furthermore, if I wanted to send some extra information to a mining pool server, would id be an okay place to do it or should I add my own extra field?

1

If you are talking about the Bitcoin API, getwork only requires data field, which is a place to put your solution.

However, I do believe that you are talking about the id field of a JSON RPC command. It is used to identify a response to a given request. Generally, it might not be the best place to put extra information. There are already a few extensions to the getwork protocol that you might want to use instead.

  • I'm a little confused about the difference between the Bitcoin API and the JSON RPC API; I'm talking about the command a miner sends to the pool to get (or submit) work. Does this mean that if two miners both use the same id field and both find valid shares around the same time, only the share resulting from the more recent getwork request will be accepted by the pool? And is there a problem with adding an extra field to send extra information (not info supported by any current extension), or will that confuse pool servers? – ConstableJoe Dec 7 '12 at 16:46
  • @ConstableJoe The difference between Bitcoin API and JSON RPC, is the same as difference between HTML and HTTP - one builds on top of the other. JSON tells you how to send your data, it's like an envelope you address. Bitcoin API is like the stuff you put in that envelope - it can be a letter, but also confetti, strings or something else. Generally, you don't want to mess with the envelope when you can mess with its insides. – ThePiachu Dec 7 '12 at 20:34
  • @ConstableJoe The id is used to identify the message, but from what I found most people just set it to 1 and it works fine. It might be useful when you are sending many packets. Then you yourself would know what you are receiving and so forth. I guess it's mainly useful for asynchronous communication or something. Adding extra information might confuse the pool. Generally, the pool received an array of data - if it sees a non-empty array, it assumes it's a solution and tries to read it. If it is not formatted like one, the result will most likely be an error. – ThePiachu Dec 7 '12 at 20:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.