NIP-29 Groups

Closed chat spaces where only members can write — moderation events and relay-signed snapshots.

Enabling groups

  1. Run nostrfy genkey to set relay.private_key (required — group metadata is not generated without it).
  2. Restart the relay.

How groups work

Groups are created and moderated by events. From these moderation events the relay generates relay-signed snapshots that clients use for display:

EventDescription
kind:9007Create group (the creator becomes the admin)
kind:9000 / 9001Add member (with roles) / remove member
kind:9002Edit metadata (name, description, public/private, ...)
kind:9005Delete event (moderation)
kind:9008Delete group (its stored events are purged)
kind:9009Create invite code
kind:9010Update pin list
kind:9021 / 9022Join request / leave request

Relay-signed snapshots

  • kind:39000 — group metadata (name, visibility settings, ...)
  • kind:39001 — admin list
  • kind:39002 — member list
  • kind:39005 — pinned events

Group visibility settings

TagMeaning
privateOnly members can read messages
restrictedOnly members can write
hiddenMetadata is hidden from non-members
closedJoin requests are not auto-approved (invite codes required)
livekitThe group has a LiveKit audio/video room

Subgroups

Groups can be hierarchical — nested with parent / child tags. Cycles are rejected automatically.

Leaving a group
Any member — including the group's last admin — may leave with kind:9022 and is automatically removed; if the last admin leaves, the group has no admins left. Grant another admin first, or delete the group with kind:9008, or recover an admin-less group by signing a moderation event with the relay's own key (relay.private_key, the NIP-11 self pubkey). See troubleshooting for the how-to.