upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/C1.md
diff options
context:
space:
mode:
Diffstat (limited to 'C1.md')
-rw-r--r--C1.md113
1 files changed, 113 insertions, 0 deletions
diff --git a/C1.md b/C1.md
new file mode 100644
index 0000000..5e6ba71
--- /dev/null
+++ b/C1.md
@@ -0,0 +1,113 @@
1NIP-C1
2======
3
4Collaborative Ownership
5-----------------------
6
7`draft` `optional`
8
9This NIP defines a mechanism for multiple pubkeys to collaboratively maintain addressable events while preserving backwards compatibility.
10
11## Motivation
12
13Certain applications require shared ownership where:
14
151. **Attribution matters**: Each collaborator signs with their own key
162. **Dynamic membership**: Owners can be added or removed
173. **Backwards compatibility**: Non-supporting clients see normal events
18
19## Specification
20
21### Collaborative Pointer Event
22
23A new addressable event kind `39382` serves as a pointer to collaboratively-owned content:
24
25```jsonc
26{
27 "kind": 39382,
28 "pubkey": "<creator-pubkey>",
29 "tags": [
30 ["d", "<slug>"],
31 ["k", "<target-kind>"],
32 ["p", "<owner-1-pubkey>"],
33 ["p", "<owner-2-pubkey>"],
34 ["p", "<owner-3-pubkey>"]
35 ],
36 "content": "",
37 "created_at": 1234567890
38}
39```
40
41#### Tag Definitions
42
43| Tag | Required | Description |
44|-----|----------|-------------|
45| `d` | Yes | `<slug> |`
46| `k` | Yes | Target event kind |
47| `p` | Yes | Owner pubkeys (one or more) |
48
49### Resolution Algorithm
50
51To resolve the current state of collaboratively-owned content:
52
531. Parse the `39382` pointer event to extract owners (`p` tags) and target kind (`k` tag)
542. Extract the slug from the `d` tag (everything after the first `-`)
553. Query: `{"kinds": [<target-kind>], "authors": [<all-owners>], "#d": ["<slug>"], "limit": 1}`
56
57### Back-Reference
58
59Target events MUST include an `a` tag pointing to the `39382` pointer:
60
61```jsonc
62{
63 "kind": 30023,
64 "tags": [
65 ["d", "my-article"],
66 ["a", "39382:<pointer-creator-pubkey>:30023-my-article"]
67 ]
68}
69```
70
71This allows clients to discover collaborative ownership from either direction: pointer → content or content → pointer.
72
73## Example
74
75### Pointer Event
76
77```jsonc
78{
79 "kind": 39382,
80 "pubkey": "alice-pubkey",
81 "tags": [
82 ["d", "collaborative-guide"],
83 ["k", "30023"],
84 ["p", "alice-pubkey"],
85 ["p", "bob-pubkey"],
86 ["p", "carol-pubkey"]
87 ],
88 "content": ""
89}
90```
91
92### Target Article (by any owner)
93
94```jsonc
95{
96 "kind": 30023,
97 "pubkey": "bob-pubkey",
98 "tags": [
99 ["d", "collaborative-guide"],
100 ["title", "A Collaborative Guide"],
101 ["a", "39382:alice-pubkey:30023-collaborative-guide"]
102 ],
103 "content": "..."
104}
105```
106
107### Client Resolution
108
1091. Client receives `naddr` for the `39382` pointer
1102. Parses owners: `[alice, bob, carol]`
1113. Queries: `{"kinds": [30023], "authors": ["alice", "bob", "carol"], "#d": ["collaborative-guide"], "limit": 1}`
1124. Returns most recent version regardless of which owner published it
113