mirror of
https://gitlab.com/soapbox-pub/mkstack.git
synced 2025-08-26 20:49:22 +00:00
Context regarding what a unique d-tag means in implementation.
This commit is contained in:
parent
23f01f7dda
commit
4593a1304b
34
CONTEXT.md
34
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).
|
||||
|
Loading…
x
Reference in New Issue
Block a user