From 69509f40cd6a4d5c14a7c402b04495a1de5ab2c2 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Mon, 4 Oct 2021 01:28:16 -0300 Subject: [PATCH] fix NIP-01 top-level JSON array messages. --- nips/01.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/nips/01.md b/nips/01.md index b76350c..7e6b791 100644 --- a/nips/01.md +++ b/nips/01.md @@ -44,12 +44,13 @@ To obtain the `event.id`, we `sha256` the serialized event. The serialization is ### Communication between clients and relays -Relays expose a websocket endpoint at its domain under the `/ws` path (say, `ws(s)://relay.domain/ws`) to which clients can connect. +Relays expose a websocket endpoint to which clients can connect. -Clients can send either 3 types of messages, according to the following patterns: - * `EVENT `, used to publish events. - * `REQ ...`, used to request events and subscribe to new updates. - * `CLOSE `, used to stop previous subscriptions. +Clients can send either 3 types of messages, which must be JSON arrays, according to the following patterns: + + * `["EVENT", `], used to publish events. + * `["REQ", , ...`], used to request events and subscribe to new updates. + * `["CLOSE", ]`, used to stop previous subscriptions. `` is a random string that should be used to represent a subscription. The same