What is Nostr?
jimbocoin / jimbocoin 🃏
npub1v9q…9q3h
2024-10-17 12:26:23
in reply to nevent1q…22n7

jimbocoin on Nostr: Thank you! Yeah, I’m working on an app, and need to pick a kind number. My algo is: ...

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?
Author Public Key
npub1v9qy0ry6uyh36z65pe790qrxfye84ydsgzc877armmwr2l9tpkjsdx9q3h