Compare commits

..

2 Commits

Author SHA1 Message Date
Alex Gleason
51d1c6a85e NIP-46: reformat/reword options object 2023-11-20 21:29:39 -06:00
Alex Gleason
716b669fff NIP-46: Add target POW difficulty when signing events 2023-11-20 12:14:52 -06:00
3 changed files with 3 additions and 59 deletions

4
46.md
View File

@@ -66,7 +66,9 @@ These are mandatory methods the remote signer app MUST implement:
- params []
- result `pubkey`
- **sign_event**
- params [`event`]
- params [`event`, `options`]
- `options` (object, optional)
- `pow` target proof-of-work difficulty for the signed event
- result `event_with_signature`
#### optional

57
93.md
View File

@@ -1,57 +0,0 @@
NIP-93
======
Alternative URLs
----------------
Whenever 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:
```json
{
"kind": 1,
"content": "I just painted this: https://www.foundmyself.com/gallery/albums/userpics/55231/qs170gzrh0by7w0ftxaas76tx2r7vb.jpg",
"tags": [
[
"alturl",
"https://www.foundmyself.com/gallery/albums/userpics/55231/qs170gzrh0by7w0ftxaas76tx2r7vb.jpg",
"http://images5.fanpop.com/image/photos/31600000/The-Starry-Night-by-Vincent-van-Gogh-1889-fine-art-31674050-2560-2027.jpg",
"https://www.paintingmania.com/arts/vincent-van-gogh/large/starry-night-6_2843.jpg?version=09.12.13"
]
],
...
}
```
The second element in the tag is the original URL that is in the content, the remaining elements are alternative sources for the same content.
Alternative URLs do not have to contain exactly the same content, byte-for-byte.
## Fixing other people's events
When 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.
For example, in response to an event
```json
{
"id": "ad777844308977e54867c64aa0a425e15f29618105080c8c33c5a00e9198a076",
"kind": 1,
"content": "I just painted this: https://wallpapercave.com/wp/wp5960277.jpg",
...
}
```
Other people (or the same person) could publish events of kind `4001` like this:
```json
{
"kind": 4001,
"tags": [
["alt", "alternative image for event ad77..."],
["e", "ad777844308977e54867c64aa0a425e15f29618105080c8c33c5a00e9198a076"],
["alturl", "https://wallpapercave.com/wp/wp5960277.jpg", "https://wallpapercave.com/wp/wp5960312.jpg"]
]
}
```
Then 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).

View File

@@ -99,7 +99,6 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
| `1971` | Problem Tracker | [nostrocket-1971][nostrocket-1971] |
| `1984` | Reporting | [56](56.md) |
| `1985` | Label | [32](32.md) |
| `4001` | URL Alternative | [93](93.md) |
| `4550` | Community Post Approval | [72](72.md) |
| `5000`-`5999` | Job Request | [90](90.md) |
| `6000`-`6999` | Job Result | [90](90.md) |