namecoin/namecoin-core

RPC to make a name (non-)existence proof

Opened this issue · 1 comments

Once namecoin/meta#69 is fleshed out, it would be good to have a RPC call to generate such a proof.

I suggest a simple syntax: name_makeproof d/myname

Response would be something like:

{
    "base_state": <HEX STRING>,
    "proof": <ANOTHER HEX STRING>
}

In the future, if the proof scheme changes (hope not), an optional parameter to specify version could be added. The options parameter could be used for this, like in other RPC calls.

It may be prudent to include the block height in the response.

It would also be a good thing to have some way to get just the root-level hash. Either this could be a separate RPC, or it could be obtained by calling name_makeproof without any arguments (or with the empty string as a "name"). with null as the name argument

We would need an option for whether to outsource to network if not fully synced yet (default: yes); see #421. If we did not, we could end up in a loop: "I don't have IBD, I'll ask someone who does ... I don't have IBD either, I'll ask someone who does ..."