Skip to main content

Module invite

Module invite 

Source
Expand description

Targeted invites (GROUP_PROTOCOL.md).

An invite bundle is the key material a new member needs to join: the server-root key, the granted channels’ keys + ids + epochs + names, the relay set (the bootstrap), the owner attestation, and the Community id/name. It is delivered to the invitee’s npub over a NIP-17 gift-wrapped DM (the carrier; see the service/command layer). accept_invite reconstructs a member-view Community (keyless — authority is the owner-rooted roster, not a held key).

Byte fields are hex strings so the bundle is plain JSON inside the DM rumor.

Structs§

CommunityInvite
Everything a new member needs to join a Community.
InviteChannel
A granted channel inside an invite bundle.

Functions§

accept_invite
Reconstruct a member-view Community from an invite bundle: full read/post access via the granted channel keys (keyless — write authority is the member’s npub roster rank, not a held key).
build_invite
Build an invite bundle granting ALL of a Community’s channels (the MVP grants the full channel set; per-channel/role-scoped grants are a later feature). Only the management pubkey is included — never the secret, so an invited member can’t write metadata.
build_invite_rumor
Build the gift-wrap rumor that carries an invite to an invitee (carrier). The rumor is an unsigned NIP-59 inner event (kind 3304) whose content is the bundle JSON; the caller gift-wraps it to the invitee’s npub over NIP-17 (reusing Vector’s existing private-DM path). my_pubkey is the rumor author — irrelevant to the bundle’s trust (the owner attestation inside it anchors authority), it just satisfies NIP-01 serialization.
parse_invite_rumor
Parse an inbound rumor as a Community invite. Returns None unless the rumor is an invite (kind 3304) carrying a well-formed bundle — a non-invite DM or corrupt content yields None, never an error, so the inbound dispatcher can fall through.