Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify NIP-42 flow #846

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions 42.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ NIP-42
Authentication of clients to relays
-----------------------------------

`draft` `optional` `author:Semisol` `author:fiatjaf`
`draft` `optional` `author:Semisol` `author:fiatjaf` `author:arthurfranca` `author:staab`

This NIP defines a way for clients to authenticate to relays by signing an ephemeral event.

Expand Down Expand Up @@ -56,7 +56,14 @@ Relays MUST exclude `kind: 22242` events from being broadcasted to any client.

## Protocol flow

At any moment the relay may send an `AUTH` message to the client containing a challenge. After receiving that the client may decide to
At any moment the relay may send an `AUTH` message to the client containing a challenge.

If the relay `AUTH` message is in response to a client message that requires authentication, such as `REQ`/`EVENT`,
the relay MUST wait for the client `AUTH` response before sending the corresponding `EOSE` or `OK` message.
However, the relay SHOULD send a premature `EOSE` or failure `OK` message if the client doesn't respond within some time limit
(3 minutes is a good default, considering users may take time to allow signing the `kind: 22242` event).

After receiving the relay `AUTH` message, the client may decide to
authenticate itself or not. The challenge is expected to be valid for the duration of the connection or until a next challenge is sent by
the relay.

Expand Down