NIP-68 ====== Shared Replaceables ------------------- `draft` `optional` This NIP creates replaceable events that can be changed by any public key in the list of pre-defined owners. The initial creator adds all owners to the `d` tag, separated by `|`. The presence of `|` on the `d` tag, with valid keys for each but the last position, directs clients to work with this event as a shared replaceable. ```js { "kind": 3xxxx, "tags": [ ["d", "|||"], // ... ], //... } ``` Clients MUST render the latest event from any of the owners. To change owners, users MUST create a new `d` tag with new owners and MAY delete the previous one. # Referencing & Indexing Events that reference the most recent version of a shared replaceable MUST add `a` tags to each owner. Reply example: ```jsonc { "kind": 1, "tags": [ ["a", "3xxxx::|||", "", "reply"], ["a", "3xxxx::|||", "", "reply"], ["a", "3xxxx::|||", "", "reply"] ], "content": "a reply", // ... } ``` ## Deletion Owners can only unilaterally delete their own events: ```jsonc { "pubkey": "", "kind": 5, "tags": [ ["a", "3xxxx::|||", ""], ], "content": "Deletes my versions of this repleceable", // ... } ``` Adding other pubkeys to the `a` tag won't have any effect. # Filtering After parsing the desired `d` tag, clients SHOULD create a filter that includes all `d`-tag pubkeys as authors and use the `limit:1` to get only the latest event. ```json { "authors": ["", "", ""], "kinds": [3xxxx], "#d": ["|||"], "limit": 1 } ``` To find all events associated with a given shared replaceable, clients SHOULD search for `a` tags from each of the authors: ```json { "#a": [ "3xxxx::|||", "3xxxx::|||", "3xxxx::|||" ] } ```