Skip to content

Add ninvite and relay access requests#1062

Closed
staab wants to merge 1 commit into
nostr-protocol:masterfrom
coracle-social:invites
Closed

Add ninvite and relay access requests#1062
staab wants to merge 1 commit into
nostr-protocol:masterfrom
coracle-social:invites

Conversation

@staab

@staab staab commented Feb 20, 2024

Copy link
Copy Markdown
Member

This is probably poorly organized, suggestions on where to put the various parts of this welcome. This PR does two things:

  • Adds a bech32 entity, ninvite which encodes a few different entities. This is meant to help with onboarding and sharing content outside of nostr.
  • Adds a relay access request event for closed relays that work something like pyramid, or some other invite link based scheme.

I'm adding support for both to Coracle this week.

https://coracle.us-southeast-1.linodeobjects.com/invites.mov

@manimejia

Copy link
Copy Markdown

I recognize the need for an ninvite style URI. Love this!

I am implementing invites on nostrmeet.me that have optional "expire" timestamp and "limit" integer parameters.

I am also implementing "use welcome message" and "use announce message" flags. Welcome message is sent as DM to new account. Announce message is published to inviter's timeline when new account is created. Both messages can be pointers to (another NIP?) existing message templates. (I am implementing a simple client config for these templates)

Also... Invites URIs may need to be signed to verify truthiness of these additional params.

Comment thread xx.md
@vitorpamplona

Copy link
Copy Markdown
Collaborator

I wonder if this should be a bech32 link or if it should just be a full event kind that is signed by the sender so that you can show the sender's information when the friend opens the link.

"Jon is recommending the following people, relays and groups"

If it is an event, the ninvite could just be a regular nevent.

@staab

staab commented Feb 20, 2024

Copy link
Copy Markdown
Member Author

I wonder if this should be a bech32 link or if it should just be a full event kind that is signed by the sender so that you can show the sender's information when the friend opens the link.

Interesting idea, showing sender would be kind of nice. But:

If it is an event, the ninvite could just be a regular nevent.

I don't think this is workable, since there are secret invite codes in the entity, which you wouldn't want to publish.

optional "expire" timestamp and "limit" integer parameters.

What are these for?

@manimejia

manimejia commented Feb 20, 2024

Copy link
Copy Markdown

Nice thing about my (any dedicated) onboarding app is that a user does NOT need to be logged in to create invitations. This provides an easy flow for getting more people to share nostr, by sending them a link to their personal QR invite code. Even without logging in, nostr users are (will be) able to customize and generate new invitations simply by clicking a link shared in a nostr note.

https://nostrmeet.me/hodlbod@coracle.social

https://nostrmeet.me/_@vitorpamplona.com

Implementing invites as a nostr event would break this flow.


EVEN expiring invites are (will be) able to be customized and sent without logging in to the client.

Use case for Expiring invites is most apparent with private group invites and might even be applicable to general WoT invites.


EVEN these (non-event) ninvite URIs can reference the user who sent the invite... simply by indicating as such in one of the attributes. (0 could be sender with only one allowed)

Comment thread xx.md
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.

@vitorpamplona

vitorpamplona commented Feb 23, 2024

Copy link
Copy Markdown
Collaborator

If it is an event, the ninvite could just be a regular nevent.

I don't think this is workable, since there are secret invite codes in the entity, which you wouldn't want to publish.

With private zaps, we encrypt a fully signed event and bech32-encode the ciphertext with pzap1. You could do a version of that were a query param transfers a password in a way that anyone with the link can decrypt it. You could even re-use 49.md strong password derivation scheme to make it super secure if you want.

Something like:

nostr:nsecinvite1<bech32>?password=1234

Then you can:

  1. Secure with a password
  2. Verifiable with a signature
  3. Extensible to include any tags and avoid the TLV part.

It maybe overkill for your needs, though

@staab

staab commented Feb 23, 2024

Copy link
Copy Markdown
Member Author

Yeah, at that point we should just do a regular query string. Which I might actually do, because I'm not sure this has to be interoperable, since a client recommendation is just the link's base url, and is just as relevant as relay/group/pubkey recs.

@vitorpamplona

Copy link
Copy Markdown
Collaborator

It feels like to make it interoperable we would need to design invitation payloads for every event kind. Then if the Client happens to support that particular kind, it can show the invitation but if not then it can send it to other clients.

njump could then point each invite item to a separate client.

I don't know...

@staab staab mentioned this pull request Feb 23, 2024
@staab

staab commented Feb 23, 2024

Copy link
Copy Markdown
Member Author

Closed in favor of #1078 and #1079

@staab staab closed this Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants