Update documentation for LNS commands

This commit is contained in:
Doyle 2020-02-25 11:28:47 +11:00
parent 0ed361c742
commit 2d79c1effe
1 changed files with 22 additions and 4 deletions

View File

@ -30,11 +30,8 @@
// Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
#pragma once
#include "cryptonote_config.h"
#include "cryptonote_protocol/cryptonote_protocol_defs.h"
#include "cryptonote_basic/cryptonote_basic.h"
#include "cryptonote_basic/subaddress_index.h"
#include "crypto/hash.h"
#include "wallet_rpc_server_error_codes.h"
#include "wallet2.h"
@ -2857,9 +2854,20 @@ namespace wallet_rpc
};
LOKI_RPC_DOC_INTROSPECT
// Buy a Loki Name Service mapping. Specifying `owner` is optional and defaults to the purchasing wallet if empty or not specified. The `owner` is a ED25519 public key, derived from the wallets spend key.
struct COMMAND_RPC_BUY_LNS_MAPPING
{
static constexpr char const description[] =
R"(Buy a Loki Name System mapping. Loki Name System allows multiple owners that are authorised to update the underlying mapping. By default if no owner is specified, the purchasing wallet's public spend key is set as the loki_owner.
- For Session, the recommended owner is the ed25519 public key of the user's Session ID set to ed_owner
In future, support for mappings on Blockchain wallets and Lokinet addresses will be available. Tentatively,
- for Wallets, the recommended owner is the monero ed25519 public key of the user's wallet spend key set to loki_owner
- for Lokinet, the recommended default owner is the ed25519 public key of the user's Lokinet key set to ed_owner
When specifying multiple owners, 1 ed25519 public key and 1 monero public spend key is supported per mapping. Updating the value that a name maps to requires one of the owner keys to sign the update transaction.
For information on updating & signing, refer to COMMAND_RPC_UPDATE_LNS_MAPPING)";
struct request_t
{
std::string type; // The mapping type, either "blockchain", "lokinet", "session" or if custom, a value between [65-65536] (0-2 map to the predefined mappings listed earlier).
@ -2920,6 +2928,16 @@ namespace wallet_rpc
// Update the underlying value in the name->value mapping via Loki Name Service.
struct COMMAND_RPC_UPDATE_LNS_MAPPING
{
static constexpr char const description[] =
R"(Update a Loki Name System mapping's underlying value. The owner (public key) of the mapping must be able to validate.
The signature is generated from signing a hash generated by using Libsodium's generichash on the {prev_txid field (in the current mapping to update), value (new value to update to)} in binary.
Depending on the owner's public key(s) associated with the mapping the signature can sign the hash in 2 ways. If the owner public key associated with the mapping is-
- a monero public key, the signature is generated by using Monero's crypto::generate_signature on the hash
- a ed25519 public key, the signature is generated by using Libsodium's crypto_sign_detached on the hash
Providing the signature is an optional field and if not provided, will default to attempting to sign using the wallet's Monero-style public spend keys.)";
struct request_t
{
std::string type; // The mapping type, currently only "session" is supported.