The following JSON-RPC message structures are required for the self-select mode implementation.
// 1. Miner login request
{
"method": "login",
"params": {
"login": "wallet address",
"pass": "password",
"agent": "user-agent/0.1",
"mode": "self-select"
},
"jsonrpc": "2.0",
"id": 1
}
// 2. Pool response to login (includes new fields)
{
"result": {
"job": {
"pool_wallet": "pool wallet address",
"extra_nonce": "extra nonce hex",
"target": "target hex",
"job_id": "job id"
},
"id": "client id",
"status": "OK"
},
"jsonrpc": "2.0",
"id": 1
}
// 3. Miner submits the block template
{
"method": "block_template",
"params": {
"id": "client id",
"job_id": "job id",
"blob": "block template hex",
"height": N,
"difficulty": N,
"prev_hash": "prev hash hex"
},
"jsonrpc": "2.0",
"id": 1
}
// 4. Pool response to block_template
{
"result": {
"status": "OK",
"error": null
},
"jsonrpc": "2.0",
"id": 1
}
// 5. Standard submit (no changes)
{
"method": "submit",
"params": {
"id": "client id",
"job_id": "job id",
"nonce": "deadbeef",
"result": "hash hex"
},
"jsonrpc": "2.0",
"id": 1
}
// 6. Pool requests new job (includes new fields)
{
"method": "job",
"params": {
"pool_wallet": "pool wallet address",
"extra_nonce": "extra nonce hex",
"target": "target hex",
"job_id": "job id"
},
"jsonrpc": "2.0",
"id": 1
}