Module: Nostr::EventKind

Defined in:
lib/nostr/event_kind.rb

Overview

Defines the event kinds that can be emitted by clients.

Constant Summary collapse

SET_METADATA =

The content is set to a stringified JSON object {name: <username>, about: <string>, picture: <url, string>} describing the user who created the event. A relay may delete past set_metadata events once it gets a new one for the same pubkey.

Returns:

  • (Integer)
0
TEXT_NOTE =

The content is set to the text content of a note (anything the user wants to say). Non-plaintext notes should instead use kind 1000-10000 as described in NIP-16.

Returns:

  • (Integer)
1
RECOMMEND_SERVER =

The content is set to the URL (e.g., wss://somerelay.com) of a relay the event creator wants to recommend to its followers.

Returns:

  • (Integer)
2
CONTACT_LIST =

A special event with kind 3, meaning “contact list” is defined as having a list of p tags, one for each of the followed/known profiles one is following.

Returns:

  • (Integer)
3
ENCRYPTED_DIRECT_MESSAGE =

A special event with kind 4, meaning “encrypted direct message”. An event of this kind has its content equal to the base64-encoded, aes-256-cbc encrypted string of anything a user wants to write, encrypted using a shared cipher generated by combining the recipient’s public-key with the sender’s private-key.

Returns:

  • (Integer)
4