However, I think it makes sense to provide an RPC interface to the auxpow of a block. IMHO, "getblock" (in verbose mode - JSON output) should return the auxpow as part of the block somehow. Here are two possibilities I see:
1) Return the full auxpow as raw hex string. Would help to make the data returned "complete", but I'm not sure if it is that helpful. After all, the hex string can be gotten from the raw block hex relatively easily as well.
2) Try to return data split into pieces in the JSON output. This makes it simpler to use in client applications, and is consistent with the rest of the block also being in JSON format.
Of course, also 1+2 could be done. What do you think, which is better? I'm going to implement it for Namecoin Core.
For 2, the question is also how the JSON format of an auxpow should look like. I suggest the following:
Code: Select all
{
"tx": <JSON of the PoW block's coinbase, like "getrawtransaction ... 1">,
"index": 0, // This must be 0, could leave out.
"merklebranch": [...], // Merkle branch of coinbase tx.
"chainindex": n, // Index in the Merkle tree of auxpow chains.
"chainmerklebranch": [...], // Corresponding Merkle branch.
"parentblock": "..." // Raw hex of parent block header (where PoW is done)
}