upleb.uk

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

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--93.md57
-rw-r--r--README.md1
2 files changed, 58 insertions, 0 deletions
diff --git a/93.md b/93.md
new file mode 100644
index 0000000..2b38275
--- /dev/null
+++ b/93.md
@@ -0,0 +1,57 @@
1NIP-93
2======
3
4Alternative URLs
5----------------
6
7Whenever there is a URL linked to in an event, alternative versions of that same URL can be given as `alturl` tags in that same event. For example:
8
9```json
10{
11 "kind": 1,
12 "content": "I just painted this: https://www.foundmyself.com/gallery/albums/userpics/55231/qs170gzrh0by7w0ftxaas76tx2r7vb.jpg",
13 "tags": [
14 [
15 "alturl",
16 "https://www.foundmyself.com/gallery/albums/userpics/55231/qs170gzrh0by7w0ftxaas76tx2r7vb.jpg",
17 "http://images5.fanpop.com/image/photos/31600000/The-Starry-Night-by-Vincent-van-Gogh-1889-fine-art-31674050-2560-2027.jpg",
18 "https://www.paintingmania.com/arts/vincent-van-gogh/large/starry-night-6_2843.jpg?version=09.12.13"
19 ]
20 ],
21 ...
22}
23```
24
25The second element in the tag is the original URL that is in the content, the remaining elements are alternative sources for the same content.
26
27Alternative URLs do not have to contain exactly the same content, byte-for-byte.
28
29## Fixing other people's events
30
31When someone else publishes an event containing URLs, other people can reference it in an event that adds alternative URLs for them, thus preventing the original event from losing its meaning once its referenced URL becomes inaccessible.
32
33For example, in response to an event
34
35```json
36{
37 "id": "ad777844308977e54867c64aa0a425e15f29618105080c8c33c5a00e9198a076",
38 "kind": 1,
39 "content": "I just painted this: https://wallpapercave.com/wp/wp5960277.jpg",
40 ...
41}
42```
43
44Other people (or the same person) could publish events of kind `4001` like this:
45
46```json
47{
48 "kind": 4001,
49 "tags": [
50 ["alt", "alternative image for event ad77..."],
51 ["e", "ad777844308977e54867c64aa0a425e15f29618105080c8c33c5a00e9198a076"],
52 ["alturl", "https://wallpapercave.com/wp/wp5960277.jpg", "https://wallpapercave.com/wp/wp5960312.jpg"]
53 ]
54}
55```
56
57Then clients, when finding out that the original URL of the event is no longer available, could try to load an alternative from one of the `kind:4001` events that reference the original one. They should prioritize replacements from the original author and then use some kind of heuristics to prevent misleading replacements (only load `kind:4001` events from trustworthy friends or friends of the original author, for example).
diff --git a/README.md b/README.md
index b8b98d9..f27d7fc 100644
--- a/README.md
+++ b/README.md
@@ -99,6 +99,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
99| `1971` | Problem Tracker | [nostrocket-1971][nostrocket-1971] | 99| `1971` | Problem Tracker | [nostrocket-1971][nostrocket-1971] |
100| `1984` | Reporting | [56](56.md) | 100| `1984` | Reporting | [56](56.md) |
101| `1985` | Label | [32](32.md) | 101| `1985` | Label | [32](32.md) |
102| `4001` | URL Alternative | [93](93.md) |
102| `4550` | Community Post Approval | [72](72.md) | 103| `4550` | Community Post Approval | [72](72.md) |
103| `5000`-`5999` | Job Request | [90](90.md) | 104| `5000`-`5999` | Job Request | [90](90.md) |
104| `6000`-`6999` | Job Result | [90](90.md) | 105| `6000`-`6999` | Job Result | [90](90.md) |