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

Simplify nip 29 even further #1495

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

staab
Copy link
Member

@staab staab commented Sep 12, 2024

The goal here is to establish conventions for using standard relays as lightweight "groups", rather than creating highly stateful group protocol objects which require relay support to work.

Summary of changes (obsolete, see comment below on new revision):
  • Access control is broadened to the entire relay, rather than to an individual group. This mostly is just a restatement of NIP 42, but introduces a new ACCESS command (which should probably be moved to NIP 42).
  • Admin RPC is removed, and should be handled by add NIP-86: Relay Management API #1325
  • Moderation RPC is removed in favor of kind 1984 reports, which don't need special handling, but may be used to inform relay policy.
  • Use of - tags is encouraged to support a weak form of privacy.
  • Room membership can be tracked as well as relay membership.
  • Anyone can publish member lists or indexes of h tags on a relay. This underscores the fact that they are only for convenience, and shouldn't be relied upon — this allows interoperability with standard relays, because relays aren't expected or required to do anything special.
  • Some policy stuff like open/closed is removed in favor of using existing NIP 11 metadata.
  • Relay backups and migration are supported. This can be used to advertise migration to another relay, even if the relay goes down before a migration is published (by posting to well known indexes, or DMing them to members).

This PR is just an RFC for now, not necessarily a serious PR. It could replace NIP 29, which doesn't have any mature implementations yet, or it could be a separate standard.

Friendly view here.


Membership lists can contain two types of tags: relay memberships (indicated by `r`), and room memberships (indicated by `h`, and including the relay url):
Group IDs are identified by `group`, with each value being the relay url and the group id joined by a `'`. Group id MAY be omitted if bare relay membership is desired.
Copy link
Member

Choose a reason for hiding this comment

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

why not just another argument?

[ "group", "group-id", "relay" ]

Copy link
Member Author

Choose a reason for hiding this comment

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

See the note below, that would be my preference.


Rooms are defined by an arbitrary string containing any text. Names SHOULD be human-readable, and less than 30 characters.
If a group needs to be moved from one relay to another, this can be done by publishing a `kind 9009`, with the following tags:
Copy link
Member

Choose a reason for hiding this comment

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

what's the goal of this? to indicate to clients that the old relay is going offline?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, this is an escape hatch for:

  • Rogue admins
  • Admins who disappear
  • Deplatforming
  • Group forks


By default, the same group id on different relays does not mean that the same content will exist in both places. However, relays MAY choose to actively federate with others by aggressively replicating content between the two, or cooperating in some other way.

If a group is federated, this should be indicated on the `kind:39000` group metadata event using one or more `peer` tags indicating another relay url. The peer SHOULD NOT be considered valid unless the designation is mutual.
Copy link
Member

Choose a reason for hiding this comment

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

maybe a non-moderator user might want to announce their federating fork/replica, which perhaps clients can display to users "user X is replicating this group to relay B, <event-content-explaining-the-fork/replica>, do you want to also join that relay?"

Because of this, I think this should be a specific event published to the group relay or other relays.

Copy link
Member Author

Choose a reason for hiding this comment

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

I would use a migration for that. If it's not mutual, it should be considered hostile, or at least non-consensual.


If a group is federated, this should be indicated on the `kind:39000` group metadata event using one or more `peer` tags indicating another relay url. The peer SHOULD NOT be considered valid unless the designation is mutual.

Clients should take care when supporting simultaneous relay use, since missing context is possible if the federation is not implemented correctly.
Copy link
Member

Choose a reason for hiding this comment

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

Maybe explicit mention relay hints for this particular situations.

Copy link
Member Author

Choose a reason for hiding this comment

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

I address this a bit more at the very end of the document. Relay hints are ok for bringing in note parents, but that's only one kind of context. Stuff like chat rooms has implicit context that would be hard to directly link, even if we used the previous tag

@staab
Copy link
Member Author

staab commented Sep 18, 2024

Ok, I took another pass at this after @fiatjaf suggested that passive support was possible. I was skeptical at first, but I actually think I got it to work.

This version is compatible with the current version, with the following exceptions:

  • I've removed chat/forum event definitions because it should be possible to post events of any kind to a group. Defining new chat/forum kinds is valuable, but adds a lot of noise to the basic NIP, and should probably be added separately like any other kind (there's no need for them to be scoped to nip 29).
  • I've changed the join/leave events to use a new verb instead of event kinds. This is so that non-compliant relays don't allow subscribers to request invite codes mistakenly sent to them, and so that relays that don't implement NIP 29 can still implement join/leave behavior. Ultimately, this should probably be in its own NIP, although the group id part of it will still be NIP 29 specific.
  • I've removed moderation events, since I think they're over-specified and too rigid to support all models for moderation. As we saw with NIP 72, it's difficult to get moderation right, and expensive to get it wrong. 1984s leave lots of room for interpretation.
  • I've removed some of the admin-rpc functionality, which can be re-introduced via add NIP-86: Relay Management API #1325 if desired, and moderator permissions. Again, this isn't necessarily bad, but banning/deleting use cases can be covered by relay-interpreted 1984s, and add/remove permission seem too over-specified to me. I'm mostly trying to reduce scope to make things clear, because this NIP has a lot of stuff going on as it is.

I've also left some Note: comments in the text in places where I think things could be simplified at the expense of backwards compatibility, like with group metadata events and group lists.

Friendly view here

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.

2 participants