-
Notifications
You must be signed in to change notification settings - Fork 784
Add ninvite and relay access requests #1062
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| NIP-XX | ||
| ======= | ||
|
|
||
| Invite Links | ||
| ------------ | ||
|
|
||
| This NIP defines a new bech32-encoded entity, `ninvite1` and a new event representing an invite code which | ||
| will grant access to a given relay. | ||
|
|
||
| ## Invite entity | ||
|
|
||
| A `ninvite` is a bech32-encoded entity which includes one or more pubkeys, relay urls, and group ids. | ||
|
|
||
| ```typescript | ||
| InvitePointer = { | ||
| people?: string[] | ||
| relays?: { | ||
| url: string | ||
| claim?: string | ||
| }[] | ||
| groups?: { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry for the basic question, but what exactly does "groups" refer to?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any replaceable event that can be "joined". So my intention here is NIP 72 communities and (draft) NIP 87 groups, but anything else analogous that comes up.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the reference to those events set to "address"?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, same value as an
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I understand and thanks for your answers. |
||
| address: string | ||
| relay: string | ||
| claim?: string | ||
| }[] | ||
| } | ||
| ``` | ||
|
|
||
| The contents are a binary-encoded list of `TLV` (type-length-value), with `T` and `L` being 1 byte each (`uint8`, i.e. a | ||
| number in the range of 0-255), and `V` being a sequence of bytes of the size indicated by `L`. | ||
|
|
||
| These possible standardized `TLV` types are indicated here: | ||
|
|
||
| - `0` is _optionally_ a pubkey. This may be included multiple times. | ||
| - `1` is _optionally_ a tuple of `url` and `claim` joined using a `|`. This may be included multiple times. | ||
| - `2` is _optionally_ a tuple of `address`, `relay`, and `claim` joined using a `|`. This may be included multiple times. | ||
|
|
||
| Invite links MAY be shared as bare nostr links, but more often SHOULD be baked into a handler url, since that will be more | ||
| useful to users coming from a non-nostr context. | ||
|
|
||
| ## Relay access request | ||
|
|
||
| User 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. These events MUST NOT be stored or relayed to subscribers. | ||
|
|
||
| ```json | ||
| { | ||
| "kind": 28934, | ||
| "content": "Optional message", | ||
| "tags": [ | ||
| ["claim", "MYRELAY23"] | ||
| ], | ||
| } | ||
| ``` | ||
|
|
||
| Relays MAY respond with a standard `OK` message as described in [NIP 01](./01.md) with the third argument beginning with | ||
| `access-granted:` or `access-denied:`. | ||
Uh oh!
There was an error while loading. Please reload this page.