Vincent on Nostr: Inheritance for Nostr event kinds is an interesting idea! What approach did you have ...
Inheritance for Nostr event kinds is an interesting idea! What approach did you have in mind for this?
Simply creating a new Kind B that “claims” to inherit from Kind A doesn't work, as Kind A clients wouldn't recognize Kind B events by default. This isn't real inheritance.
I guess a true inheritance could be achieved by using Kind A with a special tag (e.g., [w, "application article"]) to indicate a subkind. This creates an inheritance framework for kinds.
- Kind A clients could render all Kind A events, ignoring subkind-specific properties
- Subkind-specific clients focus on their relevant events
If we want to go one level deeper, we could simply extend the tag (e.g. [w, subkind, sub-subkind]). However, I’m not sure if that would ever be necessary.
This method is backward compatible and pretty straightforward imo.
Would it work for your use case?
Published at
2024-07-19 10:49:15Event JSON
{
"id": "58421279f74ed8544ad0c7ff73aeae90809d4592b27ae3cb567fadbbd546de8b",
"pubkey": "d8881295f6442dc93481f888ddb5e74aeaaddac9457e2fb7bd09e68f4d5c8db7",
"created_at": 1721386155,
"kind": 1,
"tags": [
[
"e",
"bc21c814581487ede4099ffc6e194854e1ffbdc0cd68ebc13f7c971719e81b9c",
"wss://relay.nostr.net",
"root"
],
[
"p",
"726a1e261cc6474674e8285e3951b3bb139be9a773d1acf49dc868db861a1c11"
]
],
"content": "Inheritance for Nostr event kinds is an interesting idea! What approach did you have in mind for this?\n\nSimply creating a new Kind B that “claims” to inherit from Kind A doesn't work, as Kind A clients wouldn't recognize Kind B events by default. This isn't real inheritance.\n\nI guess a true inheritance could be achieved by using Kind A with a special tag (e.g., [w, \"application article\"]) to indicate a subkind. This creates an inheritance framework for kinds. \n - Kind A clients could render all Kind A events, ignoring subkind-specific properties\n - Subkind-specific clients focus on their relevant events\n\nIf we want to go one level deeper, we could simply extend the tag (e.g. [w, subkind, sub-subkind]). However, I’m not sure if that would ever be necessary. \n\nThis method is backward compatible and pretty straightforward imo. \n\nWould it work for your use case?",
"sig": "7548a6a839baa6a9902d5e8e6113a6a096ab585179db51c957ca83facd6daea5ef0e13a1352a315f889c0fddeb0d1d8a73a483dbce14d1d9e1d81f782750504b"
}