From 02bf452d8f689b061fbccae7ef93a46c32f4c7c8 Mon Sep 17 00:00:00 2001
From: librelois <elois@ifee.fr>
Date: Sun, 16 Sep 2018 15:51:34 +0200
Subject: [PATCH] [ref] rework human-readable format for peers & heads

---
 rfc/0006_ws2p_v2.md | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/rfc/0006_ws2p_v2.md b/rfc/0006_ws2p_v2.md
index 1805d15..900a20b 100644
--- a/rfc/0006_ws2p_v2.md
+++ b/rfc/0006_ws2p_v2.md
@@ -393,15 +393,17 @@ Signed document declaring all the endpoints of a peer.
 The document is represented by an array of bytes containing (peer_card_size + 2) bytes.  
 to sign the document it is necessary to calculate the hash sha256 of this bytes array then to sign the hash obtained with the issuer's private key.
 
-### Peer card BMA JSON format
+### Peer card JSON format
+
+This human-readable format will be used by all APIs that wish to provide peer cards in a human-readable format. For example, Client APIs.
 
     {
         "version": Number(VERSION),
         "currency": Number(CURRENCY_CODE),
         "node_id": String(NODE_ID in base16),
-        "algorithm": Number(ALGORITHM),
+        "algorithm": String(name of pubkey/sig algorithm)
         "pubkey": String(ISSUER_PUBLIC_KEY in base58),
-        "block": String(BLOCK_NUMBER ++ "-" ++ BLOCK_HASH in base16),
+        "blockstamp": String(BLOCK_NUMBER ++ "-" ++ BLOCK_HASH in base16),
         "endpoinds": Array([
             String(ENDPOINT_1 in endpoint utf8 format),
             String(ENDPOINT_2 in endpoint utf8 format),
@@ -416,9 +418,9 @@ Example :
         "version": 11,
         "currency": 1,
         "node_id": "15af24db",
-        "algorithm": 1,
+        "algorithm": "Ed25519",
         "pubkey": "D9D2zaJoWYWveii1JRYLVK3J4Z7ZH3QczoKrnQeiM6mx"
-        "block": "128310-000002A569DCEED62227CAC0ABDFE6B2647B21B3193A40398CD12BC2A95C24D9",
+        "blockstamp": "128310-000002A569DCEED62227CAC0ABDFE6B2647B21B3193A40398CD12BC2A95C24D9",
         "endpoinds": [
             "WS2P 2 1 TLS 3 DEF LOW ABF 443 g1.durs.info ws2p"
         ],
@@ -771,13 +773,15 @@ step := Number of head rebounds (unsigned field).
 
 #### HEAD v3 JSON format
 
+This human-readable format will be used by all APIs that wish to provide HEADs v3 in a human-readable format. For example, Client APIs.
+
     {
         "api_outgoing_conf": Number,
         "api_incoming_conf": Number,
         "free_mirror_rooms": Number,
         "low_priority_rooms": Number,
         "node_id": Number,
-        "algorithm": Number(pubkey.algorithm)
+        "algorithm": String(name of pubkey/sig algorithm)
         "pubkey": String(pubkey.pubkey_content in base58),
         "blockstamp": String(BlockId-BlockHash in base16),
         "software_name": String,
-- 
GitLab