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

Add DM relays to nip 65 #1103

Closed
wants to merge 4 commits into from
Closed

Conversation

staab
Copy link
Member

@staab staab commented Mar 6, 2024

No description provided.

@fiatjaf
Copy link
Member

fiatjaf commented Mar 6, 2024

If I understood correctly this is great, let's ship it.

@arthurfranca
Copy link
Contributor

Came to the conclusion that users don't need dm relays. Simply pick good read relays that also treat DMs well (NIP-42).

Besides that, two lists and write/outbox usage overlap contribute to make things more complex for little gain.

65.md Outdated Show resolved Hide resolved
65.md Outdated Show resolved Hide resolved
65.md Outdated Show resolved Hide resolved
@dluvian
Copy link
Contributor

dluvian commented Mar 6, 2024

You forgot to add kind 10050 to the Event Kinds table

staab and others added 2 commits March 6, 2024 08:19
Co-authored-by: dluvian <133484344+dluvian@users.noreply.github.com>
Co-authored-by: dluvian <133484344+dluvian@users.noreply.github.com>
@vitorpamplona
Copy link
Collaborator

vitorpamplona commented Mar 6, 2024

I am good with this. I don't really know why it's using two kinds but sure.

@staab
Copy link
Member Author

staab commented Mar 6, 2024

Came to the conclusion that users don't need dm relays. Simply pick good read relays that also treat DMs well (NIP-42).

Besides that, two lists and write/outbox usage overlap contribute to make things more complex for little gain.

I actually agree with this. The benefits of a separate list is that you can avoid broadcasting messages to more relays than necessary, enhancing privacy. The downside is that clients that don't support the new list won't know to look elsewhere for DMs, and will start missing them. @fiatjaf can you make the case for this change improving deliverability rather than making it worse?

@fiatjaf
Copy link
Member

fiatjaf commented Mar 6, 2024

I've been talking about using specific DM relays for many months, and my entire hope for NIP-44 + gift-wraps was that we would change to using specific DM relays.

As far as I know only Amethyst and Coracle implement the new DM scheme and it isn't specified anywhere so this shouldn't break anything for NIP-17.

@staab
Copy link
Member Author

staab commented Mar 6, 2024

Let's add the new relay kind to NIP 17 instead @vitorpamplona. Where to save hints should be defined by the relevant NIP, not added to NIP 65. That limits the blast radius, because otherwise you end up with tricky compatibility issues like the one I mentioned.

@staab staab closed this Mar 6, 2024
@fiatjaf
Copy link
Member

fiatjaf commented Mar 6, 2024

@arthurfranca relays should be able to specialize. We gain literally nothing from just merging together two entirely different functions in the same group of relays. If we can specialize, why not? Clients can easily automate the creation of these lists.

Also the presence of the new kind serves as a signal that this user is ready to accept NIP-17 DMs, otherwise the user probably shouldn't even be contacted.

@staab
Copy link
Member Author

staab commented Mar 6, 2024

Also the presence of the new kind serves as a signal that this user is ready to accept NIP-17 DMs, otherwise the user probably shouldn't even be contacted.

This is a great idea

@staab staab deleted the inbox branch March 6, 2024 16:42
@vitorpamplona
Copy link
Collaborator

ohh, so the new event kind is for DMs only and not any GiftWrap? I don't think I see a difference between DMs and any other GiftWrap payload in terms of privacy or which relay to use. They are all private.

@staab
Copy link
Member Author

staab commented Mar 6, 2024

NIP 87 uses gift wrap, but they're not addressed to users, but shared keys, so there wouldn't ever be a NIP 65 available. Instead, the group meta's relays should be used. That's a pretty good example of appropriate relay selection being defined in the relevant NIP.

@vitorpamplona
Copy link
Collaborator

Cool I am going to add this over there.

But here's the catch, for DMs, there is no Outbox. Everything is an inbox.

@fiatjaf
Copy link
Member

fiatjaf commented Mar 6, 2024

But here's the catch, for DMs, there is no Outbox. Everything is an inbox.

Good point.

Everything is an inbox and you can just connect to that single relay and also publish your outgoing DMs to it as well as access everything you receive from it.

A specialized relay could also allow you to delete directly from it even though you're not the immediate author of the events. It becomes your personal inbox.

@vitorpamplona
Copy link
Collaborator

@arthurfranca
Copy link
Contributor

relays should be able to specialize. We gain literally nothing from just merging together two entirely different functions in the same group of relays. If we can specialize, why not? Clients can easily automate the creation of these lists.

Just that don't see much to specialize in when relaying DMs compared to what a read relay already provides rather than requiring AUTH when client requests gift-wraps (or kind:4).

Also the presence of the new kind serves as a signal that this user is ready to accept NIP-17 DMs

The user can accept NIP-17 dms if it is currently using a client that supports it. A list won't guarantee anything imo. It depends solely on NIP-17 adoption ratio.

@vitorpamplona
Copy link
Collaborator

Just that don't see much to specialize in when relaying DMs compared to what a read relay already provides rather than requiring AUTH when client requests gift-wraps (or kind:4).

I think the main issue is really the difference between a public read (no auth) and a private inbox (authed). Authed relays can do both read and inbox. Non-authed relays should only do reads (only public events).

@vitorpamplona
Copy link
Collaborator

vitorpamplona commented Mar 6, 2024

Actually, it's about access by third parties:

Public read (anyone can download events that p-tagged you). Public reads are used when the author's write doesn't have an event. In those cases, the client should start looking at other relays from the p-tag list. This type of relay must remain open/unauthed. This type can opt to accept events by or about a given public key. And for privacy, it can opt to not return DMs or GiftWraps until the connection is authed by the author.

Private inbox relays require auth to download any event: They are not supposed to be used by third parties to find posts. They can accept posts by an author or where the author is p-tagged, but they do not respond unless authed.

While read can be seen as a superset of inbox, there might be use cases where the author doesn't want to allow the download of public events (Zaps for instance).

So, in practice, the two relay types intersect, but each has something unique going for them.

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.

5 participants