1.7 KiB
1.7 KiB
Kind 9999: CCN Invitation
Description
Kind 9999 is used for invitation codes to join a CCN. This event type facilitates a secure invitation process where a CCN member can generate and broadcast an invitation code that can be used by potential one-time new members to join the network.
Event Structure
{
"id": "<32-byte hex string>",
"pubkey": "<32-byte hex string>",
"created_at": <unix timestamp in seconds>,
"kind": 9999,
"tags": [
["i", "<sha512 hash of the invite code>"]
],
"content": "",
"sig": "<64-byte hex string>"
}
Tag Specifications
Tag | Value | Description |
---|---|---|
i | <sha512 hash of the invite code> |
The SHA-512 hash of the randomly generated 32-byte invite code |
Workflow
- A CCN member generates a random 32-byte invite code
- The member broadcasts a kind 9999 event with the SHA-512 hash of the invite code in the "i" tag
- The invitee receives the invite code (typically via QR code or direct message)
- The invitee generates their nsec (private key)
- The invitee sends a direct message to the CCN with their invite code
- Upon receipt of a message where the SHA-512 hash matches a valid invite code, the CCN (actioned by the inviter only) broadcasts an accept invite event
- The CCN (actioned by the inviter only) sends the CCN seed to the invitee via direct message
- The CCN invalidates the used invite code
Invite Code Format
The invite code is encoded as a bech32m string with the prefix "eveinvite" and contains:
- The CCN's npub (32 bytes)
- The random invite code (32 bytes)
References
- NIP-01: Basic protocol flow description
- NIP-17: Private Direct Messages