nips/24.md
Alex Gleason 80cc42ee44
NIP-24: avatar -> picture (in example JSON)
Co-authored-by: Asai Toshiya <to.asai.60@gmail.com>
2024-11-20 11:13:00 -06:00

2.7 KiB

NIP-24

Extra metadata fields and tags

draft optional

This NIP defines extra optional fields added to events.

kind 0

These are extra fields not specified in NIP-01 that may be present in the stringified JSON of metadata events:

  • display_name: an alternative, bigger name with richer characters than name. name should always be set regardless of the presence of display_name in the metadata.
  • website: a web URL related in any way to the event author.
  • banner: an URL to a wide (~1024x768) picture to be optionally displayed in the background of a profile screen.
  • bot: a boolean to clarify that the content is entirely or partially the result of automation, such as with chatbots or newsfeeds.

User defined custom fields

A fields attribute may also be added to profile metadata to represent user-defined fields. It is an array name-value tuples, eg:

[["<name>", "<value>"], ...]

In the context of a full metadata object:

{
  "name": "Alex",
  "picture": "https://...",
  "fields": [
    ["Pronouns", "ye/haw"],
    ["Lifestyle", "vegan"],
    ["Color", "green"]
  ]
}

While protocol-level fields like lud16 and picture can influence the behavior of a user's account, custom fields are used for display purposes only. Clients should display custom fields in a confined area of the user's profile, and not make assumptions about their meaning.

Custom fields should be displayed in the order they are defined by the user, and entries may be duplicated. The name and value can be any string, although clients may truncate or ellipsize long values, and may limit the total number of fields displayed.

Deprecated fields

These are fields that should be ignored or removed when found in the wild:

  • displayName: use display_name instead.
  • username: use name instead.

kind 3

These are extra fields not specified in NIP-02 that may be present in the stringified JSON of follow events:

Deprecated fields

  • {<relay-url>: {"read": <true|false>, "write": <true|false>}, ...}: an object of relays used by a user to read/write. NIP-65 should be used instead.

tags

These tags may be present in multiple event kinds. Whenever a different meaning is not specified by some more specific NIP, they have the following meanings:

  • r: a web URL the event is referring to in some way.
  • i: an external id the event is referring to in some way - see NIP-73.
  • title: name of NIP-51 sets, NIP-52 calendar event, NIP-53 live event or NIP-99 listing.
  • t: a hashtag. The value MUST be a lowercase string.