I have almost no coding skills but I am wondering: is there a primer on how to develop a "Event Kind" for nostr?

I'd like to at least attempt to examine what it would take to build a plug-in for Obsidian.md (a smart note application like Roam Research) that can read and publish a single nostr event and broadcast it to relays.

If anyone can point me in the right direction it'd be appreciated. Thanks.

Reply to this note

Please Login to reply.

Discussion

Perhaps a careful viewing of the blockbuster smash hit Event Horizon starring Lawrence Fishburne and Sam Niel will provide the answer

Lulz

At the data level, a kind is just a number. Regular text notes like this one have kind=1. A note that deletes a note has kind=5. A reaction to a note is also a note, but with kind=7.

The space of numbers is divided such that different ranges are treated a bit differently:

- 1000 <= n < 10000 = regular notes, stored by relays

- 10000 <= n < 20000 = replaceable notes. A relay should keep only the last for a given pubkey/n combo.

- 20000 <= n < 30000 = ephemeral notes that relays should NOT store (just relay to any currently connected, subscribed clients).

- 30000 <= n < 40000 = parameterized replaceable. Relays should keep only the last pubkey/n/d-tag combo, where the d-tag is a special string. This would be for, say, long-form blog entries so the author can post updates/edits.

So to develop your own kind, you first need to determine which range makes sense for you. Should relays store these notes? If so, should they be replaceable?

Once you’ve picked a range, next you’ll want to find a number that other people aren’t already using. This may take some research. Various nips and applications have already claimed some numbers.

After you’ve selected a kind number, the next thing to do is to write up how it is to be used. This document will help to avoid conflicts such as someone else picking the same number. Whether this document should be an actual NIP depends on how likely it is that relay and client implementers will want/need to know about it.

Then lastly, with a kind number and specification, you’ll be ready to write software that uses the kind.