Skip to content
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
57 changes: 57 additions & 0 deletions xx.md
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.

Comment thread
vitorpamplona marked this conversation as resolved.
## 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?: {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the basic question, but what exactly does "groups" refer to?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the reference to those events set to "address"?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, same value as an a tag

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The 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:`.