Compare commits

..

9 Commits

Author SHA1 Message Date
Vitor Pamplona
052fffd45b Merge branch 'master' into v0l-patch-2 2025-10-15 16:15:18 -04:00
Vitor Pamplona
7b24bf803f NIP-37: Improving Draft events (#2016) 2025-10-15 16:09:36 -04:00
greenart7c3
d54c426709 [NIP 55] - Instructions on how to use the get_public_key method with content resolver (#2086) 2025-10-13 11:21:07 -07:00
Sandwich
179e421011 nip66: tags shouldn't have integers (#2085) 2025-10-13 05:26:14 -07:00
Vitor Pamplona
74681c3c14 NIP-45 is not a subscription. Changing to query id to reduce confusion. (#2083) 2025-10-08 17:43:37 -05:00
Pablo Fernandez
2ace01cf1a NWC Deep Links (#1777) 2025-10-08 14:34:47 +03:00
Kieran
d7cda6e8da Update 71.md 2025-01-29 10:26:59 +00:00
Kieran
75ede7616f Update 71.md 2025-01-29 10:26:41 +00:00
Kieran
2c8316307a Update 71.md 2025-01-29 10:22:08 +00:00
7 changed files with 66 additions and 106 deletions

39
37.md
View File

@@ -1,50 +1,57 @@
NIP-37
======
Draft Events
------------
Draft Wraps
-----------
`draft` `optional`
This NIP defines kind `31234` as a private wrap for drafts of any other event kind.
This NIP defines kind `31234` as an encrypted storage for unsigned draft events of any other kind.
The draft event is JSON-stringified, [NIP44-encrypted](44.md) to the signer's public key and placed inside the `.content` of the event.
The draft is JSON-stringified, [NIP44-encrypted](44.md) to the signer's public key and placed inside the `.content`.
An additional `k` tag identifies the kind of the draft event.
`k` tags identify the kind of the draft.
```js
{
"kind": 31234,
"tags": [
["d", "<identifier>"],
["k", "<kind of the draft event>"],
["e", "<anchor event event id>", "<relay-url>"],
["a", "<anchor event address>", "<relay-url>"],
["k", "<kind of the draft event>"], // required
["expiration", "now + 90 days"] // recommended
],
"content": nip44Encrypt(JSON.stringify(draft_event)),
// other fields
}
```
A blanked `.content` means this draft has been deleted by a client but relays still have the event.
A blanked `.content` field signals that the draft has been deleted.
Tags `e` and `a` identify one or more anchor events, such as parent events on replies.
[NIP-40](40.md) `expiration` tags are recommended.
Clients SHOULD publish kind `31234` events to relays listed on kind `10013` below.
## Relay List for Private Content
Kind `10013` indicates the user's preferred relays to store private events like Drafts. The event MUST include a list of `relay` URLs in private tags. Private tags are JSON Stringified, NIP-44-encrypted to the signer's keys and placed inside the .content of the event.
Kind `10013` indicates the user's preferred relays to store private events like Draft Wraps.
The event MUST include a list of `relay` URLs in private tags. Private tags are JSON Stringified, [NIP44-encrypted](44.md) to the signer's keys and placed inside the .content of the event.
```js
{
"kind": 10013,
"tags": [],
"content": nip44Encrypt(JSON.stringify([
["relay", "wss://myrelay.mydomain.com"]
]))
"content": nip44Encrypt(
JSON.stringify(
[
["relay", "wss://myrelay.mydomain.com"]
]
)
)
//...other fields
}
```
Relays listed in this event SHOULD be authed and only allow downloads to events signed by the authed user.
It's recommended that Private Storage relays SHOULD be [NIP-42](42.md)-authed and only allow downloads of events signed by the authed user.
Clients SHOULD publish kind `10013` events to the author's [NIP-65](65.md) `write` relays.
Clients MUST publish kind `10013` events to the author's [NIP-65](65.md) `write` relays.

22
45.md
View File

@@ -14,17 +14,17 @@ Some queries a client may want to execute against connected relays are prohibiti
## Filters and return values
This NIP defines the verb `COUNT`, which accepts a subscription id and filters as specified in [NIP 01](01.md) for the verb `REQ`. Multiple filters are OR'd together and aggregated into a single count result.
This NIP defines the verb `COUNT`, which accepts a query id and filters as specified in [NIP 01](01.md) for the verb `REQ`. Multiple filters are OR'd together and aggregated into a single count result.
```
["COUNT", <subscription_id>, <filters JSON>...]
["COUNT", <query_id>, <filters JSON>...]
```
Counts are returned using a `COUNT` response in the form `{"count": <integer>}`. Relays may use probabilistic counts to reduce compute requirements.
In case a relay uses probabilistic counts, it MAY indicate it in the response with `approximate` key i.e. `{"count": <integer>, "approximate": <true|false>}`.
```
["COUNT", <subscription_id>, {"count": <integer>}]
["COUNT", <query_id>, {"count": <integer>}]
```
Whenever the relay decides to refuse to fulfill the `COUNT` request, it MUST return a `CLOSED` message.
@@ -34,27 +34,27 @@ Whenever the relay decides to refuse to fulfill the `COUNT` request, it MUST ret
### Followers count
```
["COUNT", <subscription_id>, {"kinds": [3], "#p": [<pubkey>]}]
["COUNT", <subscription_id>, {"count": 238}]
["COUNT", <query_id>, {"kinds": [3], "#p": [<pubkey>]}]
["COUNT", <query_id>, {"count": 238}]
```
### Count posts and reactions
```
["COUNT", <subscription_id>, {"kinds": [1, 7], "authors": [<pubkey>]}]
["COUNT", <subscription_id>, {"count": 5}]
["COUNT", <query_id>, {"kinds": [1, 7], "authors": [<pubkey>]}]
["COUNT", <query_id>, {"count": 5}]
```
### Count posts approximately
```
["COUNT", <subscription_id>, {"kinds": [1]}]
["COUNT", <subscription_id>, {"count": 93412452, "approximate": true}]
["COUNT", <query_id>, {"kinds": [1]}]
["COUNT", <query_id>, {"count": 93412452, "approximate": true}]
```
### Relay refuses to count
```
["COUNT", <subscription_id>, {"kinds": [4], "authors": [<pubkey>], "#p": [<pubkey>]}]
["CLOSED", <subscription_id>, "auth-required: cannot count other people's DMs"]
["COUNT", <query_id>, {"kinds": [1059], "#p": [<pubkey>]}]
["CLOSED", <query_id>, "auth-required: cannot count other people's DMs"]
```

18
47.md
View File

@@ -667,3 +667,21 @@ Here are some properties that are recognized by some NWC clients:
"sig": "31f57b369459b5306a5353aa9e03be7fbde169bc881c3233625605dd12f53548179def16b9fe1137e6465d7e4d5bb27ce81fd6e75908c46b06269f4233c845d8"
}
```
### Deep-links
Wallet applications can register deeplinks in mobile systems to make it possible to create a linking UX that doesn't require the user scanning a QR code or pasting some code.
`nostrnwc://connect` and `nostrnwc+{app_name}://connect` can be registered by wallet apps and queried by apps that want to receive an NWC pairing code.
All URI parameters, MUST be URI-encoded.
URI parameters:
* `appicon` -- URL to an icon of the client that wants to create a connection.
* `appname` -- Name of the client that wants to create a connection.
* `callback` -- URI schema the wallet should open with the connection string
Once a connection has been created by the wallet, it should be returned to the client by opening the callback with the following parameters
* `value` -- NWC pairing code (e.g. `nostr+walletconnect://...`)

4
55.md
View File

@@ -295,6 +295,8 @@ For the other types Signer Application returns the column "result"
If the user chose to always reject the event, signer application will return the column "rejected" and you should not open signer application
Clients SHOULD save the user pubkey locally and avoid calling the `get_public_key` after the user is logged in to the Client
#### Methods
- **get_public_key**
@@ -303,7 +305,7 @@ If the user chose to always reject the event, signer application will return the
```kotlin
val result = context.contentResolver.query(
Uri.parse("content://com.example.signer.GET_PUBLIC_KEY"),
listOf("login"),
listOf(hex_pub_key),
null,
null,
null

2
66.md
View File

@@ -53,7 +53,7 @@ Example:
["g", "ww8p1r4t8"],
["l", "en", "ISO-639-1"],
["t", "nsfw" ],
["rtt-open", 234 ]
["rtt-open", "234" ]
]
}
```

85
71.md
View File

@@ -20,26 +20,17 @@ Nothing except cavaliership and common sense prevents a _short_ video from being
The format uses a _regular event_ kind `21` for _normal_ videos and `22` for _short_ videos.
## Addressable Video Events
For content that may need updates after publication (such as correcting metadata, descriptions, or handling URL migrations), addressable versions are available:
- Kind `34235` for _addressable normal videos_
- Kind `34236` for _addressable short videos_
These addressable events follow the same format as their regular counterparts but include a `d` tag as a unique identifier and can be updated while maintaining the same addressable reference. This is particularly useful for:
- Metadata corrections (descriptions, titles, tags) without republishing
- Preservation of imported content IDs from legacy platforms
- URL migration when hosting changes
- Platform migration tracking
The `.content` of these events is a summary or description on the video content.
The primary source of video information is the `imeta` tags which is defined in [NIP-92](92.md)
Each `imeta` tag can be used to specify a variant of the video by the `dim` & `m` properties.
This NIP defines the following additional `imeta` properties aside form those listen in [NIP-92](92.md) & [NIP-94](94.md):
* `duration` (recommended) the duration of the video/audio in seconds (floating point number)
* `bitrate` (recommended) the average bitrate of the video/audio in bits/sec
Example:
```json
[
@@ -53,6 +44,8 @@ Example:
"fallback https://myotherserver.com/1080/12345.mp4",
"fallback https://andanotherserver.com/1080/12345.mp4",
"service nip96",
"bitrate 3000000",
"duration 29.223"
],
["imeta",
"dim 1280x720",
@@ -64,6 +57,8 @@ Example:
"fallback https://myotherserver.com/720/12345.mp4",
"fallback https://andanotherserver.com/720/12345.mp4",
"service nip96",
"bitrate 2000000",
"duration 29.24"
],
["imeta",
"dim 1280x720",
@@ -75,6 +70,7 @@ Example:
"fallback https://myotherserver.com/720/12345.m3u8",
"fallback https://andanotherserver.com/720/12345.m3u8",
"service nip96",
"duration 29.21"
],
]
```
@@ -85,13 +81,9 @@ The `image` tag contains a preview image (at the same resolution). Multiple `ima
Additionally `service nip96` may be included to allow clients to search the authors NIP-96 server list to find the file using the hash.
### Required tags for addressable events:
* `d` - Unique identifier for this video (user-chosen string, required for kinds 34235, 34236)
### Other tags:
* `title` (required) title of the video
* `published_at`, for the timestamp in unix seconds (stringified) of the first time the video was published
* `duration` (optional) video duration in seconds
* `text-track` (optional, repeated) link to WebVTT file for video, type of supplementary information (captions/subtitles/chapters/metadata), optional language code
* `content-warning` (optional) warning about content of NSFW video
* `alt` (optional) description for accessibility
@@ -100,9 +92,6 @@ Additionally `service nip96` may be included to allow clients to search the auth
* `p` (optional, repeated) 32-bytes hex pubkey of a participant in the video, optional recommended relay URL
* `r` (optional, repeated) references / links to web pages
### Optional tags for imported content:
* `origin` - Track original platform and ID: `["origin", "<platform>", "<external-id>", "<original-url>", "<optional-metadata>"]`
```jsonc
{
"id": "<32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>",
@@ -128,7 +117,6 @@ Additionally `service nip96` may be included to allow clients to search the auth
"service nip96",
],
["duration", "<duration of video in seconds>"],
["text-track", "<encoded `kind 6000` event>", "<recommended relay urls>"],
["content-warning", "<reason>"],
["segment", <start>, <end>, "<title>", "<thumbnail URL>"],
@@ -147,56 +135,3 @@ Additionally `service nip96` may be included to allow clients to search the auth
]
}
```
## Addressable Event Example
```jsonc
{
"id": <32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>,
"pubkey": <32-bytes lowercase hex-encoded public key of the event creator>,
"created_at": <Unix timestamp in seconds>,
"kind": 34235 | 34236,
"content": "<summary / description of video>",
"tags": [
["d", "<unique-identifier>"],
["title", "<title of video>"],
["published_at", "<unix timestamp>"],
["alt", "<description for accessibility>"],
// video data
["imeta",
"url https://example.com/media.mp4",
"m video/mp4",
"dim 480x480",
"blurhash eVF$^OI:${M{%LRjWBoLoLaeR*",
"image https://example.com/thumb.jpg",
"x 3093509d1e0bc604ff60cb9286f4cd7c781553bc8991937befaacfdc28ec5cdc"
],
["duration", <duration in seconds>],
["content-warning", "<reason>"],
// origin tracking for imported content
["origin", "<platform>", "<external-id>", "<original-url>", "<optional-metadata>"],
// participants
["p", "<32-bytes hex of a pubkey>", "<optional recommended relay URL>"],
// hashtags
["t", "<tag>"],
["t", "<tag>"],
// reference links
["r", "<url>"]
]
}
```
## Referencing Addressable Events
To reference an addressable video:
```
["a", "34235:<pubkey>:<d-tag-value>", "<relay-url>"] // for normal videos
["a", "34236:<pubkey>:<d-tag-value>", "<relay-url>"] // for short videos
```

View File

@@ -263,8 +263,6 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
| `31989` | Handler recommendation | [89](89.md) |
| `31990` | Handler information | [89](89.md) |
| `32267` | Software Application | |
| `34235` | Addressable Video Event | [71](71.md) |
| `34236` | Addressable Short Video Event | [71](71.md) |
| `34550` | Community Definition | [72](72.md) |
| `38172` | Cashu Mint Announcement | [87](87.md) |
| `38173` | Fedimint Announcement | [87](87.md) |