Author

Topic: Documentation needed for a pool (wire level protocol)? (Read 1872 times)

full member
Activity: 140
Merit: 100
Mining software must communicate with a pool/proxy/bitcoind for two reasons; to get work and to submit work.

The most common protocol (supported by every mining software I've seen) for that is JSON-RPC: http://en.wikipedia.org/wiki/JSON-RPC.

This is the request a miner makes to the server to get new work:
Code:
{"params": [], "method": "getwork", "id": "json"}

An example response by the server:
Code:
{"id":"json","error":null,"result":{"midstate":"b07ab2ccf48b89a0217384c1299d8b7e7cc9bb7ac16dd1366d9955669cb253aa","target":"ffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000","data":"0000000146f6a6158418099f9c3a68ffec435166cfdb9eef51479153000001ee000000004d3a3c9c00dc8b69df7c0e9b4f3fa4ea587cddd2392d186e9dca1b5ea1669ea74e03844d1a13218500000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000","hash1":"00000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000010000"}}

An example of the request made by a miner to submit results:
Code:
{"params": ["000000019a086f0290f4b6d34a6e1b8a4b9974d585819abcd8e8f3d400000b5d00000000aaf9271bb6c2892dd5f96a71da1ed4be9b234f74a8de246acd91851a6639e1904e0384731a132185d1684680000000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000"], "method": "getwork", "id": "json"}

is there a full documentation for this communication? I am especially inerested actually in:
* All commands and return codes
* How to handle authentication etc.

Or do I ahve t oget some code from a miner and try to reverse engineer this part?

And the server's response (if the result was correct):
Code:
{"id":"json","error":null,"result":true}
hero member
Activity: 560
Merit: 517
Mining software must communicate with a pool/proxy/bitcoind for two reasons; to get work and to submit work.

The most common protocol (supported by every mining software I've seen) for that is JSON-RPC: http://en.wikipedia.org/wiki/JSON-RPC.

This is the request a miner makes to the server to get new work:
Code:
{"params": [], "method": "getwork", "id": "json"}

An example response by the server:
Code:
{"id":"json","error":null,"result":{"midstate":"b07ab2ccf48b89a0217384c1299d8b7e7cc9bb7ac16dd1366d9955669cb253aa","target":"ffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000","data":"0000000146f6a6158418099f9c3a68ffec435166cfdb9eef51479153000001ee000000004d3a3c9c00dc8b69df7c0e9b4f3fa4ea587cddd2392d186e9dca1b5ea1669ea74e03844d1a13218500000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000","hash1":"00000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000010000"}}

An example of the request made by a miner to submit results:
Code:
{"params": ["000000019a086f0290f4b6d34a6e1b8a4b9974d585819abcd8e8f3d400000b5d00000000aaf9271bb6c2892dd5f96a71da1ed4be9b234f74a8de246acd91851a6639e1904e0384731a132185d1684680000000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000"], "method": "getwork", "id": "json"}

And the server's response (if the result was correct):
Code:
{"id":"json","error":null,"result":true}
sr. member
Activity: 378
Merit: 250
As long as you don't talk SQL, you'll survive.
full member
Activity: 140
Merit: 100
Can anyone pont me to some relevant documentation for the protocols needed for a pool / miner proxy?

I.e. whom to talk to (i assume a bitcoin server), what protocols / ports etc. to use.

Just trying to get a decent start here. Any lightweight sample code pointer also welcome... just I dont really talk PHP Wink

Regards

Wink NetTecture
Jump to: