Skip to content

Add invite code functionality#20

Open
sanah9 wants to merge 2 commits intofiatjaf:masterfrom
sanah9:invite-code
Open

Add invite code functionality#20
sanah9 wants to merge 2 commits intofiatjaf:masterfrom
sanah9:invite-code

Conversation

@sanah9
Copy link
Contributor

@sanah9 sanah9 commented Jun 25, 2025

  • Store invite codes in state with expiration support
  • Add invite code verification for kind 9021 join requests
  • Automatic cleanup of expired invite codes

@fiatjaf
Copy link
Owner

fiatjaf commented Jun 25, 2025

@staab please review

@staab
Copy link

staab commented Jun 25, 2025

I would personally have the relay generate the code and expiration policy rather than the requester. This is how https://github.com/nostr-protocol/nips/pull/1079/files works. But it's completely unspecified, so this approach is also fine. The code and expiration stuff should probably be optional, and possible for the relay to reject if they fall outside of certain boundaries. But the PR looks fine to me.

@fiatjaf
Copy link
Owner

fiatjaf commented Jun 25, 2025

Unconvincing review, I'll have to review it myself.

@purrgrammer
Copy link

found this while trying to figure out how invite codes work for nip-29 groups. lgtm, we should probably update the NIP-29 spec since as @staab mentions the invite codes are underspecified.

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