From 61fd568ff2f40c2595585686fc2bd463fb6166cb Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Thu, 28 Mar 2024 10:17:26 -0400 Subject: [PATCH] Expands the explanation of kind ranges. --- 01.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/01.md b/01.md index 3ad5d943..c4df803a 100644 --- a/01.md +++ b/01.md @@ -77,11 +77,17 @@ To verify the authenticity of an event: ## Kinds -The `.kind` attribute specifies the meaning of an event, its tags and it is further defined in the various NIPs in this repository +The `.kind` attribute specifies the meaning of an event and its tags. -Specific ranges define storage behaviors: +Kinds are grouped in 4 numeric ranges to provide explicit storage behaviors for clients and relays: +- Regular: All events are stored in disk and will last for as long as possible. +- Ephemeral events are to be discared as soon as processed. They are ideal to send commands that should be executed immediatedly or not executed at all. +- Replaceable events can be quickly updated by newer versions. They are ideal for status events that are always changing and the history of such changes is not important. +- Parameterized replaceable events extend replaceable kinds to offer an extra identifier as the replacement anchor -| Name | Range | SHOULD retain | +Ranges and instructions are as follows: + +| Range Name | Range | SHOULD retain | | ------------- | --------------------------------- | ------------------------------------------------------ | | Regular | ` 1000 <= kind < 10000` | All events | | Replaceable | `10000 <= kind < 20000` OR `0, 3` | The newest event for each `pubkey` and `kind` | @@ -102,7 +108,7 @@ The first element of the tag array is referred to as the tag _name_ and the seco All single-letter (only English alphabet letters: a-z, A-Z) tag names are indexed by relays for faster queries. -This NIP defines the format of 3 standard referencing tags: `e`, `p`, and `a`. Tags `e`, `p` can be used to reference events and pubkeys respectively, and tag `a` references the latest version of a replaceable event. Clients MAY `a`- and `e`-tag parameterized replaceables simultaneously. +This NIP defines the format of 3 referencing tags: `e`, `p`, and `a`. Tags `e`, `p` can be used to reference events and pubkeys respectively, and tag `a` references the latest version of a replaceable event. Clients MAY `a`- and `e`-tag parameterized replaceables simultaneously. | Name | Value | Other Params | | ---- | ---------------------------------------------------------- | ----------------------- |