diff --git a/CONTEXT.md b/CONTEXT.md index 801d06b..f074fde 100644 --- a/CONTEXT.md +++ b/CONTEXT.md @@ -226,6 +226,40 @@ An event's kind number determines the event's behavior and storage characteristi Kinds below 1000 are considered "legacy" kinds, and may have different storage characteristics based on their kind definition. For example, kind 1 is regular, while kind 3 is replaceable. +#### D-Tag Management for Addressable Events + +For addressable events (kinds 30000-39999), the `d` tag identifies logical content. Use content-derived identifiers that remain consistent across updates. + +**❌ Wrong - Iterative d-tag:** +```json +{ + "kind": 30023, + "tags": [["d", "review-1"]], + "content": "Initial review..." +} + +{ + "kind": 30023, + "tags": [["d", "review-2"]], + "content": "Updated review..." +} +``` + +**✅ Correct - Consistent d-tag:** +```json +{ + "kind": 30023, + "tags": [["d", "product-review-iphone-15-pro"]], + "content": "Initial review..." +} + +{ + "kind": 30023, + "tags": [["d", "product-review-iphone-15-pro"]], + "content": "Updated review..." +} +``` + ### Content Field Design Principles When designing new event kinds, the `content` field should be used for semantically important data that doesn't need to be queried by relays. **Structured JSON data generally shouldn't go in the content field** (kind 0 being an early exception).