This https://github.com/nostr-protocol/nips ?

Reply to this note

Please Login to reply.

Discussion

Sorry, not quite. That’s the NIPs, which are also numbered.

Each “event” in Nostr has a numeric “kind” field. Regular text notes like these have kind=1. Reactions (likes) have kind=7, etc.

When people make Nostr-based apps, often they’ll use new, previously unclaimed kind numbers to have specific meanings for their apps.

I seem to recall someone making a registry of these kind number meanings. Maybe nostr:npub1m4ny6hjqzepn4rxknuq94c2gpqzr29ufkkw7ttcxyak7v43n6vvsajc2jl ?

I found this https://nostrdata.github.io/kinds/ ... But I don't think it's exactly what you're looking for.

Not bad, thanks!

https://github.com/mleku/realy/blob/dev/kind/kind.go

it's not perfectly up to date but it's fairly complete... if you are working with Go it also gives you a reverse lookup so you can print human readable names for the kinds also

not really sure why i'm the only one who has made one, maybe some other language libraries have a similar table?

Thanks! I don’t know Go. How do I read this?

For example, what does this line mean?

PrivateDirectMessage = &T{14}

the number is the struct field `K` which is the kind number, the ampersand means take the pointer to the structure

i just noticed that the Equal method actually compares the structs, not the struct field, idk how that works, i didn't think in Go you could do that... gonna look closer at that

you can see that several of them i have put synonyms also, there are better names for them but they were used in code as the not so good name

I keep a list, as json, but I also make sure that they're all listed on the NIP repo ReadMe (scroll down to Events).

https://github.com/nostr-protocol/nips/blob/master/README.md

Thank you! Yeah, I’m working on an app, and need to pick a kind number.

My algo is:

1. concatenate the project name and purpose as a string.

2. SHA256 hash the name-purpose

3. Take the first 4 bytes as int 32.

4. Modulo this number and add basis for specific kind range.

So for example, if you need a parameterized replaceable event, you mod 10000 and add 10000.

Has anyone already written guidance of this sort for picking kind numbers for app purposes?