Merge pull request #500 from nostr-protocol/nip31

nip-31: dealing with custom unknown events
This commit is contained in:
Pablo Fernandez 2023-06-08 22:50:44 +02:00 committed by GitHub
commit 75c05b547c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

15
31.md Normal file
View File

@ -0,0 +1,15 @@
NIP-31
======
Dealing with unknown event kinds
--------------------------------
`draft` `optional` `author:pablof7z` `author:fiatjaf`
When creating a new custom event kind that is part of a custom protocol and isn't meant to be read as text (like `kind:1`), clients should use an `alt` tag to write a short human-readable plaintext summary of what that event is about.
The intent is that social clients, used to display only `kind:1` notes, can still show something in case a custom event pops up in their timelines. The content of the `alt` tag should provide enough context for a user that doesn't know anything about this event kind to understand what it is.
These clients that only know `kind:1` are not expected to ask relays for events of different kinds, but users could still reference these weird events on their notes, and without proper context these could be nonsensical notes. Having the fallback text makes that situation much better -- even if only for making the user aware that they should try to view that custom event elsewhere.
`kind:1`-centric clients can make interacting with these event kinds more functional by supporting [NIP-89](https://github.com/nostr-protocol/nips/blob/master/89.md).

View File

@ -46,6 +46,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
- [NIP-27: Text Note References](27.md)
- [NIP-28: Public Chat](28.md)
- [NIP-30: Custom Emoji](30.md)
- [NIP-31: Dealing with Unknown Events](31.md)
- [NIP-33: Parameterized Replaceable Events](33.md)
- [NIP-36: Sensitive Content](36.md)
- [NIP-39: External Identities in Profiles](39.md)
@ -146,6 +147,7 @@ When experimenting with kinds, keep in mind the classification introduced by [NI
| name | value | other parameters | NIP |
| ----------------- | ------------------------------------ | -------------------- | ------------------------ |
| `a` | coordinates to an event | relay URL | [33](33.md), [23](23.md) |
| `alt` | Alt tag | -- | [31](31.md) |
| `d` | identifier | -- | [33](33.md) |
| `e` | event id (hex) | relay URL, marker | [1](01.md), [10](10.md) |
| `g` | geohash | -- | [12](12.md) |