mirror of
https://github.com/nostr-protocol/nips.git
synced 2025-02-21 12:49:00 +00:00
Merge branch 'master' into video-events-regular
This commit is contained in:
commit
14d3801485
2
01.md
2
01.md
@ -89,7 +89,7 @@ Kinds specify how clients should interpret the meaning of each event and the oth
|
||||
|
||||
This NIP defines one basic kind:
|
||||
|
||||
- `0`: **user metadata**: the `content` is set to a stringified JSON object `{name: <username>, about: <string>, picture: <url, string>}` describing the user who created the event. [Extra metadata fields](24.md#kind-0) may be set. A relay may delete older events once it gets a new one for the same pubkey.
|
||||
- `0`: **user metadata**: the `content` is set to a stringified JSON object `{name: <nickname or full name>, about: <short bio>, picture: <url of the image>}` describing the user who created the event. [Extra metadata fields](24.md#kind-0) may be set. A relay may delete older events once it gets a new one for the same pubkey.
|
||||
|
||||
And also a convention for kind ranges that allow for easier experimentation and flexibility of relay implementation:
|
||||
|
||||
|
27
56.md
27
56.md
@ -22,7 +22,7 @@ are reporting.
|
||||
|
||||
If reporting a note, an `e` tag MUST also be included referencing the note id.
|
||||
|
||||
A `report type` string MUST be included as the 3rd entry to the `e` or `p` tag
|
||||
A `report type` string MUST be included as the 3rd entry to the `e`, `p` or `x` tag
|
||||
being reported, which consists of the following report types:
|
||||
|
||||
- `nudity` - depictions of nudity, porn, etc.
|
||||
@ -33,7 +33,9 @@ being reported, which consists of the following report types:
|
||||
- `impersonation` - someone pretending to be someone else
|
||||
- `other` - for reports that don't fit in the above categories
|
||||
|
||||
Some report tags only make sense for profile reports, such as `impersonation`
|
||||
Some report tags only make sense for profile reports, such as `impersonation`.
|
||||
|
||||
- `x` tags SHOULD be info hash of a blob which is intended to be report. when the `x` tag is represented client MUST include an `e` tag which is the id of the event that contains the mentioned blob. also, additionally these events can contain a `server` tag to point to media servers which may contain the mentioned media.
|
||||
|
||||
`l` and `L` tags MAY be also be used as defined in [NIP-32](32.md) to support
|
||||
further qualification and querying.
|
||||
@ -45,7 +47,7 @@ Example events
|
||||
{
|
||||
"kind": 1984,
|
||||
"tags": [
|
||||
["p", <pubkey>, "nudity"],
|
||||
["p", "<pubkey>", "nudity"],
|
||||
["L", "social.nos.ontology"],
|
||||
["l", "NS-nud", "social.nos.ontology"]
|
||||
],
|
||||
@ -58,8 +60,8 @@ Example events
|
||||
{
|
||||
"kind": 1984,
|
||||
"tags": [
|
||||
["e", <eventId>, "illegal"],
|
||||
["p", <pubkey>]
|
||||
["e", "<eventId>", "illegal"],
|
||||
["p", "<pubkey>"]
|
||||
],
|
||||
"content": "He's insulting the king!",
|
||||
// other fields...
|
||||
@ -70,13 +72,26 @@ Example events
|
||||
{
|
||||
"kind": 1984,
|
||||
"tags": [
|
||||
["p", <impersonator pubkey>, "impersonation"]
|
||||
["p", "<impersonator pubkey>", "impersonation"]
|
||||
],
|
||||
"content": "Profile is impersonating nostr:<victim bech32 pubkey>",
|
||||
// other fields...
|
||||
}
|
||||
```
|
||||
|
||||
```jsonc
|
||||
{
|
||||
"kind": 1984,
|
||||
"tags": [
|
||||
["x", "<blob hash>", "malware"],
|
||||
["e", "<event id which contains the blob on x tag>", "malware"],
|
||||
["server", "https://you-may-find-the-blob-here.com/path-to-url.ext"]
|
||||
],
|
||||
"content": "This file contains malware software in it.",
|
||||
// other fields...
|
||||
}
|
||||
```
|
||||
|
||||
Client behavior
|
||||
---------------
|
||||
|
||||
|
27
60.md
27
60.md
@ -39,7 +39,7 @@ This NIP doesn't deal with users' *receiving* money from someone else, it's just
|
||||
}
|
||||
```
|
||||
|
||||
The wallet event is a parameterized replaceable event `kind:37375`.
|
||||
The wallet event is an addressable event `kind:37375`.
|
||||
|
||||
Tags:
|
||||
* `d` - wallet ID.
|
||||
@ -57,7 +57,7 @@ Any tag, other than the `d` tag, can be [[NIP-44]] encrypted into the `.content`
|
||||
Due to addressable event being hard to delete, if a user wants to delete a wallet, they should empty the event and keep just the `d` identifier and add a `deleted` tag.
|
||||
|
||||
## Token Event
|
||||
Token events are used to record the unspent proofs that come from the mint.
|
||||
Token events are used to record unspent proofs.
|
||||
|
||||
There can be multiple `kind:7375` events for the same mint, and multiple proofs inside each `kind:7375` event.
|
||||
|
||||
@ -73,7 +73,9 @@ There can be multiple `kind:7375` events for the same mint, and multiple proofs
|
||||
"secret": "z+zyxAVLRqN9lEjxuNPSyRJzEstbl69Jc1vtimvtkPg=",
|
||||
"C": "0241d98a8197ef238a192d47edf191a9de78b657308937b4f7dd0aa53beae72c46"
|
||||
}
|
||||
]
|
||||
],
|
||||
// tokens that were destroyed in the creation of this token
|
||||
"del": [ "token-id-1" ]
|
||||
}),
|
||||
"tags": [
|
||||
[ "a", "37375:<pubkey>:my-wallet" ]
|
||||
@ -81,8 +83,11 @@ There can be multiple `kind:7375` events for the same mint, and multiple proofs
|
||||
}
|
||||
```
|
||||
|
||||
`.content` is a [[NIP-44]] encrypted payload storing the mint and the unencoded proofs.
|
||||
* `a` an optional tag linking the token to a specific wallet.
|
||||
* `a` an optional tag linking the token to a specific wallet.
|
||||
* `.content` is a [[NIP-44]] encrypted payload:
|
||||
* `mint`: The mint the proofs belong to.
|
||||
* `proofs`: unecoded proofs
|
||||
* `del`: token-ids that were destroyed by the creation of this token. This assists with state transitions.
|
||||
|
||||
### Spending proofs
|
||||
When one or more proofs of a token are spent, the token event should be [[NIP-09]]-deleted and, if some proofs are unspent from the same token event, a new token event should be created rolling over the unspent proofs and adding any change outputs to the new token event.
|
||||
@ -96,7 +101,7 @@ Clients SHOULD publish `kind:7376` events to create a transaction history when t
|
||||
"content": nip44_encrypt([
|
||||
[ "direction", "in" ], // in = received, out = sent
|
||||
[ "amount", "1", "sat" ],
|
||||
[ "e", "<event-id-of-spent-token>", "<relay-hint>", "created" ],
|
||||
[ "e", "<event-id-of-created-token>", "<relay-hint>", "created" ],
|
||||
]),
|
||||
"tags": [
|
||||
[ "a", "37375:<pubkey>:my-wallet" ],
|
||||
@ -129,7 +134,7 @@ While the client is fetching (and perhaps validating) proofs it can use the opti
|
||||
|
||||
## Spending token
|
||||
If Alice spends 4 sats from this token event
|
||||
```jsonconc
|
||||
```jsonc
|
||||
{
|
||||
"kind": 7375,
|
||||
"id": "event-id-1",
|
||||
@ -150,7 +155,7 @@ If Alice spends 4 sats from this token event
|
||||
|
||||
Her client:
|
||||
* MUST roll over the unspent proofs:
|
||||
```jsonconc
|
||||
```jsonc
|
||||
{
|
||||
"kind": 7375,
|
||||
"id": "event-id-2",
|
||||
@ -160,7 +165,8 @@ Her client:
|
||||
{ "id": "1", "amount": 1 },
|
||||
{ "id": "2", "amount": 2 },
|
||||
{ "id": "4", "amount": 8 },
|
||||
]
|
||||
],
|
||||
"del": [ "event-id-1" ]
|
||||
}),
|
||||
"tags": [
|
||||
[ "a", "37375:<pubkey>:my-wallet" ]
|
||||
@ -168,8 +174,9 @@ Her client:
|
||||
}
|
||||
```
|
||||
* MUST delete event `event-id-1`
|
||||
* SHOULD add the `event-id-1` to the `del` array of deleted token-ids.
|
||||
* SHOULD create a `kind:7376` event to record the spend
|
||||
```jsonconc
|
||||
```jsonc
|
||||
{
|
||||
"kind": 7376,
|
||||
"content": nip44_encrypt([
|
||||
|
4
92.md
4
92.md
@ -6,10 +6,10 @@ Media Attachments
|
||||
|
||||
Media attachments (images, videos, and other files) may be added to events by including a URL in the event content, along with a matching `imeta` tag.
|
||||
|
||||
`imeta` ("inline metadata") tags add information about media URLs in the event's content. Each `imeta` tag SHOULD match a URL in the event content. Clients may replace imeta URLs with rich previews.
|
||||
`imeta` ("inline metadata") tags MAY add information about media URLs in the event's content. Each `imeta` tag SHOULD match a URL in the event content. Clients MAY replace imeta URLs with rich previews.
|
||||
|
||||
The `imeta` tag is variadic, and each entry is a space-delimited key/value pair.
|
||||
Each `imeta` tag MUST have a `url`, and at least one other field. `imeta` may include
|
||||
Each `imeta` tag MUST have a `url`, and at least one other field. `imeta` MAY include
|
||||
any field specified by [NIP 94](./94.md). There SHOULD be only one `imeta` tag per URL.
|
||||
|
||||
## Example
|
||||
|
32
BREAKING.md
32
BREAKING.md
@ -21,37 +21,37 @@ reverse chronological order.
|
||||
| 2024-07-23 | [0227a2cd](https://github.com/nostr-protocol/nips/commit/0227a2cd) | [01](01.md) | events should be sorted by id after created_at |
|
||||
| 2024-06-06 | [58e94b20](https://github.com/nostr-protocol/nips/commit/58e94b20) | [25](25.md) | [8073c848](https://github.com/nostr-protocol/nips/commit/8073c848) was reverted |
|
||||
| 2024-06-06 | [a6dfc7b5](https://github.com/nostr-protocol/nips/commit/a6dfc7b5) | [55](55.md) | NIP number was changed |
|
||||
| 2024-05-25 | [5d1d1c17](https://github.com/nostr-protocol/nips/commit/5d1d1c17) | [71](71.md) | 'aes-256-gcm' tag was removed |
|
||||
| 2024-05-25 | [5d1d1c17](https://github.com/nostr-protocol/nips/commit/5d1d1c17) | [71](71.md) | `aes-256-gcm` tag was removed |
|
||||
| 2024-05-07 | [8073c848](https://github.com/nostr-protocol/nips/commit/8073c848) | [25](25.md) | e-tags were changed to not include entire thread |
|
||||
| 2024-04-30 | [bad88262](https://github.com/nostr-protocol/nips/commit/bad88262) | [34](34.md) | 'earliest-unique-commit' tag was removed (use 'r' tag instead) |
|
||||
| 2024-04-30 | [bad88262](https://github.com/nostr-protocol/nips/commit/bad88262) | [34](34.md) | `earliest-unique-commit` tag was removed (use `r` tag instead) |
|
||||
| 2024-02-25 | [4a171cb0](https://github.com/nostr-protocol/nips/commit/4a171cb0) | [18](18.md) | quote repost should use `q` tag |
|
||||
| 2024-02-21 | [c6cd655c](https://github.com/nostr-protocol/nips/commit/c6cd655c) | [46](46.md) | Params were stringified |
|
||||
| 2024-02-16 | [cbec02ab](https://github.com/nostr-protocol/nips/commit/cbec02ab) | [49](49.md) | Password first normalized to NFKC |
|
||||
| 2024-02-15 | [afbb8dd0](https://github.com/nostr-protocol/nips/commit/afbb8dd0) | [39](39.md) | PGP identity was removed |
|
||||
| 2024-02-07 | [d3dad114](https://github.com/nostr-protocol/nips/commit/d3dad114) | [46](46.md) | Connection token format was changed |
|
||||
| 2024-01-30 | [1a2b21b6](https://github.com/nostr-protocol/nips/commit/1a2b21b6) | [59](59.md) | 'p' tag became optional |
|
||||
| 2024-01-30 | [1a2b21b6](https://github.com/nostr-protocol/nips/commit/1a2b21b6) | [59](59.md) | `p` tag became optional |
|
||||
| 2023-01-27 | [c2f34817](https://github.com/nostr-protocol/nips/commit/c2f34817) | [47](47.md) | optional expiration tag should be honored |
|
||||
| 2024-01-10 | [3d8652ea](https://github.com/nostr-protocol/nips/commit/3d8652ea) | [02](02.md), [51](51.md) | list entries should be chronological |
|
||||
| 2023-12-30 | [29869821](https://github.com/nostr-protocol/nips/commit/29869821) | [52](52.md) | 'name' tag was removed (use 'title' tag instead) |
|
||||
| 2023-12-27 | [17c67ef5](https://github.com/nostr-protocol/nips/commit/17c67ef5) | [94](94.md) | 'aes-256-gcm' tag was removed |
|
||||
| 2023-12-03 | [0ba45895](https://github.com/nostr-protocol/nips/commit/0ba45895) | [01](01.md) | WebSocket status code `4000` was replaced by 'CLOSED' message |
|
||||
| 2023-11-28 | [6de35f9e](https://github.com/nostr-protocol/nips/commit/6de35f9e) | [89](89.md) | 'client' tag value was changed |
|
||||
| 2023-12-30 | [29869821](https://github.com/nostr-protocol/nips/commit/29869821) | [52](52.md) | `name` tag was removed (use `title` tag instead) |
|
||||
| 2023-12-27 | [17c67ef5](https://github.com/nostr-protocol/nips/commit/17c67ef5) | [94](94.md) | `aes-256-gcm` tag was removed |
|
||||
| 2023-12-03 | [0ba45895](https://github.com/nostr-protocol/nips/commit/0ba45895) | [01](01.md) | WebSocket status code `4000` was replaced by `CLOSED` message |
|
||||
| 2023-11-28 | [6de35f9e](https://github.com/nostr-protocol/nips/commit/6de35f9e) | [89](89.md) | `client` tag value was changed |
|
||||
| 2023-11-20 | [7822a8b1](https://github.com/nostr-protocol/nips/commit/7822a8b1) | [51](51.md) | `kind: 30001` was deprecated |
|
||||
| 2023-11-20 | [7822a8b1](https://github.com/nostr-protocol/nips/commit/7822a8b1) | [51](51.md) | the meaning of `kind: 30000` was changed |
|
||||
| 2023-11-11 | [cbdca1e9](https://github.com/nostr-protocol/nips/commit/cbdca1e9) | [84](84.md) | 'range' tag was removed |
|
||||
| 2023-11-10 | [c945d8bd](https://github.com/nostr-protocol/nips/commit/c945d8bd) | [32](32.md) | 'l' tag annotations was removed |
|
||||
| 2023-11-07 | [108b7f16](https://github.com/nostr-protocol/nips/commit/108b7f16) | [01](01.md) | 'OK' message must have 4 items |
|
||||
| 2023-10-17 | [cf672b76](https://github.com/nostr-protocol/nips/commit/cf672b76) | [03](03.md) | 'block' tag was removed |
|
||||
| 2023-09-29 | [7dc6385f](https://github.com/nostr-protocol/nips/commit/7dc6385f) | [57](57.md) | optional 'a' tag was included in `zap receipt` |
|
||||
| 2023-08-21 | [89915e02](https://github.com/nostr-protocol/nips/commit/89915e02) | [11](11.md) | 'min_prefix' was removed |
|
||||
| 2023-11-11 | [cbdca1e9](https://github.com/nostr-protocol/nips/commit/cbdca1e9) | [84](84.md) | `range` tag was removed |
|
||||
| 2023-11-10 | [c945d8bd](https://github.com/nostr-protocol/nips/commit/c945d8bd) | [32](32.md) | `l` tag annotations was removed |
|
||||
| 2023-11-07 | [108b7f16](https://github.com/nostr-protocol/nips/commit/108b7f16) | [01](01.md) | `OK` message must have 4 items |
|
||||
| 2023-10-17 | [cf672b76](https://github.com/nostr-protocol/nips/commit/cf672b76) | [03](03.md) | `block` tag was removed |
|
||||
| 2023-09-29 | [7dc6385f](https://github.com/nostr-protocol/nips/commit/7dc6385f) | [57](57.md) | optional `a` tag was included in `zap receipt` |
|
||||
| 2023-08-21 | [89915e02](https://github.com/nostr-protocol/nips/commit/89915e02) | [11](11.md) | `min_prefix` was removed |
|
||||
| 2023-08-20 | [37c4375e](https://github.com/nostr-protocol/nips/commit/37c4375e) | [01](01.md) | replaceable events with same timestamp should be retained event with lowest id |
|
||||
| 2023-08-15 | [88ee873c](https://github.com/nostr-protocol/nips/commit/88ee873c) | [15](15.md) | 'countries' tag was renamed to 'regions' |
|
||||
| 2023-08-15 | [88ee873c](https://github.com/nostr-protocol/nips/commit/88ee873c) | [15](15.md) | `countries` tag was renamed to `regions` |
|
||||
| 2023-08-14 | [72bb8a12](https://github.com/nostr-protocol/nips/commit/72bb8a12) | [12](12.md), [16](16.md), [20](20.md), [33](33.md) | NIP-12, 16, 20 and 33 were merged into NIP-01 |
|
||||
| 2023-08-11 | [d87f8617](https://github.com/nostr-protocol/nips/commit/d87f8617) | [25](25.md) | empty `content` should be considered as "+" |
|
||||
| 2023-08-01 | [5d63b157](https://github.com/nostr-protocol/nips/commit/5d63b157) | [57](57.md) | 'zap' tag was changed |
|
||||
| 2023-08-01 | [5d63b157](https://github.com/nostr-protocol/nips/commit/5d63b157) | [57](57.md) | `zap` tag was changed |
|
||||
| 2023-07-15 | [d1814405](https://github.com/nostr-protocol/nips/commit/d1814405) | [01](01.md) | `since` and `until` filters should be `since <= created_at <= until` |
|
||||
| 2023-07-12 | [a1cd2bd8](https://github.com/nostr-protocol/nips/commit/a1cd2bd8) | [25](25.md) | custom emoji was supported |
|
||||
| 2023-06-18 | [83cbd3e1](https://github.com/nostr-protocol/nips/commit/83cbd3e1) | [11](11.md) | 'image' was renamed to 'icon' |
|
||||
| 2023-06-18 | [83cbd3e1](https://github.com/nostr-protocol/nips/commit/83cbd3e1) | [11](11.md) | `image` was renamed to `icon` |
|
||||
| 2023-04-13 | [bf0a0da6](https://github.com/nostr-protocol/nips/commit/bf0a0da6) | [15](15.md) | different NIP was re-added as NIP-15 |
|
||||
| 2023-04-09 | [fb5b7c73](https://github.com/nostr-protocol/nips/commit/fb5b7c73) | [15](15.md) | NIP-15 was merged into NIP-01 |
|
||||
| 2023-03-29 | [599e1313](https://github.com/nostr-protocol/nips/commit/599e1313) | [18](18.md) | NIP-18 was bring back |
|
||||
|
@ -122,6 +122,8 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
|
||||
| `16` | Generic Repost | [18](18.md) |
|
||||
| `17` | Reaction to a website | [25](25.md) |
|
||||
| `20` | Picture | [68](68.md) |
|
||||
| `21` | Video Event | [71](71.md) |
|
||||
| `22` | Short-form Portrait Video Event | [71](71.md) |
|
||||
| `40` | Channel Creation | [28](28.md) |
|
||||
| `41` | Channel Metadata | [28](28.md) |
|
||||
| `42` | Channel Message | [28](28.md) |
|
||||
@ -227,9 +229,8 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
|
||||
| `31924` | Calendar | [52](52.md) |
|
||||
| `31925` | Calendar Event RSVP | [52](52.md) |
|
||||
| `31989` | Handler recommendation | [89](89.md) |
|
||||
| `31990` | Handler information | [89](89.md) |
|
||||
| `21` | Video Event | [71](71.md) |
|
||||
| `22` | Short-form Portrait Video Event | [71](71.md) |
|
||||
| `31990` | Handler information | [89](89.md) | |
|
||||
| `32267` | Software Application | | |
|
||||
| `34550` | Community Definition | [72](72.md) |
|
||||
| `37375` | Cashu Wallet Event | [60](60.md) |
|
||||
| `38383` | Peer-to-peer Order events | [69](69.md) |
|
||||
|
Loading…
Reference in New Issue
Block a user