mirror of
https://github.com/nostr-protocol/nips.git
synced 2025-12-09 08:38:50 +00:00
Compare commits
1 Commits
nip-60-rel
...
nip71-addr
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a5ab7da4d2 |
15
60.md
15
60.md
@@ -28,9 +28,7 @@ This NIP doesn't deal with users' *receiving* money from someone else, it's just
|
||||
"content": nip44_encrypt([
|
||||
[ "privkey", "hexkey" ],
|
||||
[ "mint", "https://mint1" ],
|
||||
[ "mint", "https://mint2" ],
|
||||
[ "relay", "wss://relay1.example.com" ],
|
||||
[ "relay", "wss://relay2.example.com" ]
|
||||
[ "mint", "https://mint2" ]
|
||||
]),
|
||||
"tags": []
|
||||
}
|
||||
@@ -38,10 +36,9 @@ This NIP doesn't deal with users' *receiving* money from someone else, it's just
|
||||
|
||||
The wallet event is an replaceable event `kind:17375`.
|
||||
|
||||
Encrypted Tags:
|
||||
Tags:
|
||||
* `mint` - Mint(s) this wallet uses -- there MUST be one or more mint tags.
|
||||
* `privkey` - Private key used to unlock P2PK ecash. MUST be stored encrypted in the `.content` field. **This is a different private key exclusively used for the wallet, not associated in any way to the user's Nostr private key** -- This is only used for receiving [NIP-61](61.md) nutzaps.
|
||||
* `relay` - Relay(s) where the wallet's events (`kind:7374`, `kind:7375`, `kind:7376`) are published to and queried from. Clients MUST use these relays for all wallet operations. If no `relay` tags are present, clients SHOULD fall back to the user's [NIP-65](65.md) relay list.
|
||||
|
||||
### Token Event
|
||||
Token events are used to record unspent proofs.
|
||||
@@ -107,14 +104,10 @@ All tags can be [NIP-44](44.md) encrypted. Clients SHOULD leave `e` tags with a
|
||||
Multiple `e` tags can be added, and should be encrypted, except for tags with the `redeemed` marker.
|
||||
|
||||
## Flow
|
||||
A client that wants to check for user's wallet information:
|
||||
|
||||
1. Fetches the user's `kind:17375` wallet event from the user's [NIP-65](65.md) relays (or any known relays)
|
||||
2. Reads the `relay` tags from the wallet event to determine which relays to use for wallet operations
|
||||
3. If no `relay` tags are present, falls back to using the user's [NIP-65](65.md) relay list
|
||||
A client that wants to check for user's wallets information starts by fetching `kind:10019` events from the user's relays, if no event is found, it should fall back to using the user's [NIP-65](65.md) relays.
|
||||
|
||||
### Fetch wallet and token list
|
||||
Using the relays from the wallet event's `relay` tags (or NIP-65 relays if not specified), the client should fetch wallet and token events:
|
||||
From those relays, the client should fetch wallet and token events.
|
||||
|
||||
`"kinds": [17375, 7375], "authors": ["<my-pubkey>"]`
|
||||
|
||||
|
||||
73
71.md
73
71.md
@@ -20,6 +20,20 @@ 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)
|
||||
@@ -71,6 +85,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
|
||||
@@ -83,6 +100,9 @@ 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>",
|
||||
@@ -127,3 +147,56 @@ 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
|
||||
```
|
||||
|
||||
@@ -263,6 +263,8 @@ 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) |
|
||||
|
||||
Reference in New Issue
Block a user