{"id":"2c51a04df2a02a892b953c31a60370e29d81f004b490848bbdae9642da0a1511","pubkey":"df67f9a7e41125745cbe7acfbdcd03691780c643df7bad70f5d2108f2d4fc200","created_at":1766760671,"kind":30817,"tags":[["d","versioned-event-kinds"],["title","Versioned Event Kinds (number range)"],["s","draft"],["i","github.com:nostr-protocol/nips:01","extends"],["k","nip"],["client","nostrhub.io"]],"content":"## Versioned Event Kinds\n\n`draft` \n\nThis NIP specifies an additional convention for kind number ranges. This convention for **versioned** events follows the existing convention for **addressable** events, but WITHOUT the option for relays to discard older versions.  \n\nFor kind `n` such that `40000 <= n < 50000`, events are **versioned** by their `kind`, `pubkey`, `d` tag, and `created_at` value. For each combination of `kind`, `pubkey` and `d` tag value, only the latest event MUST be delivered by relays. Older versions MAY be delivered by filtering for `created_at`. \n\n###  The `v` tag\n\nA single lowercase `v` tag SHOULD be used to add versioning metadata for ALL version events (even the first). These MUST take the format of:\n\n```jsonc\n[\"v\", \"<semver optional>\", \"<message, optional>\"]\n```\n\n- `semver` is a [semver](https://semver.org) version number for this event version.\n- `message` is a description of the changes made in this version.\n\neg : `[\"v\", \"0.1.0\", \"you may like the older version, but this is a new one\"]`\n\n### The `versions` tag\n\nA single `versions` tag SHOULD be added to new event versions for aiding in the discovery of older event versions. This tag MUST take the format of: \n\n```jsonc\n[\"versions\", \"<created_at:semver>\", ... ]\n```\n\n- This tag MAY have multiple `created_at:semver` values. Each value MUST start with the `created_at` value from the older event. This MAY be followed by a single colon `:` and `semver` value from the `v` tag of the older event. (the second part is optional)\n\neg : `[\"versions\", \"1748633717\", \"1748646538:0.0.2\", \"1748688753:0.0.3\"]`\n\n\n### Referencing with `a` and `e` tags\n\nTo reference the MOST RECENT version from another event, use a standard *three part*  `a` tag : \n\n```jsonc\n[\"a\", \"<kind>:<pubkey>:<d_tag>\", \"<relay_hint, optional>\"]\n```\n\nTo reference a SPECIFIC version from another event, use EITHER a *four part* `a` tag OR a standard `e` tag :\n\n```jsonc\n[\"a\", \"<kind>:<pubkey>:<d_tag>:<created_at>\", \"<relay_hint, optional>\"]\n```\n\n- `kind` is a kind integer\n- `pubkey` is a 32-bytes lowercase hex of the author's pubkey,\n- `d_tag` is a value of the d tag\n- `created_at` is a value of the event's created_at timestamp\n- `relay_hint` is a recommended relay URL to find the event\n\n\n\n### For Addressable Event Kinds\n\nIN ADDITION, this NIP specifies that ANY addressable event (kinds `30000` - `39999`) having a `v` tag SHOULD be retained in storage. HOWEVER, many relays will not store older versions of addressable events, due to conventions specified in NIP-01. Relays claiming compliance with this NIP (via NIP-11 \"relay information document\") MUST ALSO comply with this additional specification.","sig":"baa0de9300d258ec8c685ffcfe2d0100efe752bb7cd6c6198fcb00ffcfae16e12354b5a599b0bf41a609d34fb670086d0f20db7a8e546f6586d1b4a3ed1fd8d1"}