mirror of
https://github.com/nostr-protocol/nips.git
synced 2024-11-09 22:09:06 -05:00
Simplify claims
This commit is contained in:
parent
6e3da0ffbe
commit
36fd27f06c
34
43.md
34
43.md
|
@ -2,44 +2,26 @@ NIP-43
|
|||
======
|
||||
|
||||
Relay Access Requests
|
||||
-----------------------------------
|
||||
---------------------
|
||||
|
||||
`draft` `optional`
|
||||
|
||||
This NIP defines a way for clients to request admission to relays enforcing authentication as defined in NIP 42 by
|
||||
signing an ephemeral event.
|
||||
Users MAY request access to relays using an ephemeral `kind 28935` event sent ONLY to the relay in question. Relay
|
||||
access requests MUST have a `claim` tag containing an arbitrary string. `content` MAY be a message to the relay admin.
|
||||
|
||||
## Access Request Event
|
||||
|
||||
This NIP defines kind `22243` events which are intended to allow clients to request admission to a relay.
|
||||
Access requests MUST have a `claim` tag containing an invoice, invite code, or any other arbitrary string.
|
||||
|
||||
The event's `created_at` MUST be the current time plus or minus a few minutes to prevent replay attacks.
|
||||
Clients MAY send a claim at any time, but MUST check for relay support via NIP 11 to avoid non-compliant
|
||||
relays broadcasting invites to subscribers.
|
||||
The event's `created_at` MUST be the current time plus or minus a few minutes to prevent replay attacks. Clients MUST
|
||||
check for relay support via NIP 11 to prevent non-compliant relays broadcasting invites to subscribers. These events MUST
|
||||
NOT be stored or relayed to subscribers.
|
||||
|
||||
This event should be sent to a relay using the standard `EVENT` verb.
|
||||
|
||||
```json
|
||||
{
|
||||
"kind": 22243,
|
||||
"kind": 28934,
|
||||
"content": "Optional message",
|
||||
"tags": [
|
||||
["claim", "<invoice id, invite code, or something else>"]
|
||||
],
|
||||
...other fields
|
||||
}
|
||||
```
|
||||
|
||||
## Relay response
|
||||
|
||||
Upon receiving a claim, a relay MUST notify the client as to what the status of the claim is using an `OK` message.
|
||||
Failed claims SHOULD use the same standard `"restricted: "` prefix specified by NIP 42.
|
||||
|
||||
Some examples:
|
||||
|
||||
```
|
||||
["OK", <event-id>, false, "restricted: That invoice is expired."]
|
||||
["OK", <event-id>, false, "restricted: That is an unsupported claim."]
|
||||
["OK", <event-id>, true, "claim-ignored: You are already a member of this relay."]
|
||||
["OK", <event-id>, true, "claim-accepted: Welcome to wss://relay.bunk.skunk!"]
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue
Block a user