Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync with upstream #138

Open
wants to merge 118 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
2f2dead
Adds draft event.
vitorpamplona Mar 14, 2024
f96ccc6
Improved wording.
vitorpamplona Mar 14, 2024
f7f0603
Adds anchor events.
vitorpamplona Mar 14, 2024
0ed2f63
Getting drafts to be deleted even without relays supporting deletion …
vitorpamplona Mar 29, 2024
00b2e0a
Adds private outbox relays.
vitorpamplona May 30, 2024
48674e5
moves from NIP-35 to NIP-37
vitorpamplona May 30, 2024
d5b77b6
Merge remote-tracking branch 'upstream/master' into draft-event
vitorpamplona May 30, 2024
d09b512
Tweak group join requests to include user feedback
Nov 22, 2024
4d47b38
Switch to rejecting duplicate joins
Nov 23, 2024
2ffd8ec
use example domain
s3-odara Nov 29, 2024
e9f4cf5
Merge pull request #1617 from s3-odara/patch-2
AsaiToshiya Nov 29, 2024
fe1fe75
mark kind 30001 as deprecated.
AsaiToshiya Nov 30, 2024
54c0c13
BREAKING.md: fix change of 7822a8b1
AsaiToshiya Nov 30, 2024
33efff8
NIP-44: Proper base64 explanation
s3-odara Dec 4, 2024
5ec59fd
Merge pull request #1626 from s3-odara/patch-2
staab Dec 4, 2024
2776a2a
add `P` tag to README.
AsaiToshiya Dec 5, 2024
2ac43aa
Merge pull request #1627 from AsaiToshiya/AsaiToshiya-patch-34
staab Dec 5, 2024
6d16019
nip46: abandon nip04 entirely and just use nip44.
fiatjaf Dec 5, 2024
a92d2e2
Clarify the units
s3-odara Dec 6, 2024
936616b
Update README.md
TsukemonoGit Dec 6, 2024
a2be191
Update README.md
TsukemonoGit Dec 6, 2024
d857cfb
Merge pull request #1631 from TsukemonoGit/master
AsaiToshiya Dec 6, 2024
b049225
Update 90.md
Gudnessuche Dec 8, 2024
33cad51
Merge pull request #1633 from Gudnessuche/patch-5
AsaiToshiya Dec 8, 2024
d71887a
BREAKING.md: merge duplicate lines
AsaiToshiya Dec 9, 2024
b94ad00
BREAKING.md: add NIP-46 change
AsaiToshiya Dec 9, 2024
b35dd7d
Merge pull request #1635 from AsaiToshiya/update-breaking
staab Dec 9, 2024
624b989
clarify that Standard lists and Sets are both types of lists with hea…
joshuatbrown Dec 9, 2024
e942427
nip17: specify order (#1637)
Gudnessuche Dec 9, 2024
ed128ae
App curation sets, minor fixes to release artifact sets
franzaps Dec 10, 2024
a1ca7a1
Change strategy for naming groups
Dec 10, 2024
561059f
Merge pull request #1601 from coracle-social/nip29-join
fiatjaf Dec 13, 2024
f7d97f3
Merge branch 'master' into draft-event
vitorpamplona Dec 19, 2024
306be43
removes new line
vitorpamplona Dec 19, 2024
8d14490
Merge pull request #1124 from vitorpamplona/draft-event
pablof7z Dec 19, 2024
97bf526
add kind 10013 to list.
AsaiToshiya Dec 20, 2024
7e150fa
nip44: update some nits.
AsaiToshiya Dec 20, 2024
6b4e0f8
Merge pull request #1655 from AsaiToshiya/AsaiToshiya-patch-35
staab Dec 20, 2024
9d4f2b4
add some missing words to readme (#1656)
TahaAttari Dec 23, 2024
71ca3f2
fix broken link.
kehiy Dec 26, 2024
9acad1c
fix nip-46 and nip-47 names are changed.
kehiy Dec 26, 2024
2f3b68b
Merge pull request #1661 from kehiy/names
alexgleason Dec 26, 2024
e3911cc
rename NIP-44 in readme.
AsaiToshiya Dec 26, 2024
b88f716
fix typo in nip-94.
kehiy Dec 26, 2024
342e5db
Merge pull request #1663 from kehiy/typo
alexgleason Dec 26, 2024
ee21566
Merge pull request #1659 from kehiy/nip32
alexgleason Dec 26, 2024
b1a3ca4
Merge pull request #1662 from AsaiToshiya/AsaiToshiya-patch-35
staab Dec 27, 2024
7622cdc
adds P and p tags
pablof7z Dec 28, 2024
42370a3
Merge pull request #1664 from nostr-protocol/p-tags-22
pablof7z Dec 31, 2024
cd09e6c
Grammar updates to 47.md
jdabs Jan 1, 2025
e42aae6
Merge pull request #1666 from jdabs/master
staab Jan 1, 2025
936befb
add NIP-22 link to `P` and `p` tags.
AsaiToshiya Jan 2, 2025
c91098a
Merge pull request #1640 from franzaps/application-sets
pablof7z Jan 2, 2025
2561566
nip51: format tables.
AsaiToshiya Jan 8, 2025
1f8bbbf
specify magic-wanded protected events should not be stringified in a …
pablof7z Jan 10, 2025
76fd221
add kind 30267 to list.
AsaiToshiya Jan 10, 2025
d96f6f8
Update 18.md
pablof7z Jan 13, 2025
0f376a7
Merge pull request #1679 from nostr-protocol/reposted-70s
pablof7z Jan 13, 2025
5b6ca88
add t-tags in kind 41 (#1673)
ShinoharaTa Jan 13, 2025
0e3d1cd
Moves Kind:1 definition to NIP-10 (#1076)
vitorpamplona Jan 13, 2025
6c62751
Warn against using 1111 to reply to kind 1 (#1680)
staab Jan 13, 2025
512caf7
NIP-61: fix unfinished sentence (#1683)
patrickReiis Jan 13, 2025
0782ebe
Reinstate NIP-88: Polls on Nostr (#1507)
abh3po Jan 14, 2025
190122f
update kind 1 link. (#1686)
AsaiToshiya Jan 14, 2025
3f11c00
Update nip 59 typo (#1687)
dangershony Jan 14, 2025
cc3fbab
fix "PRE" to "addressable event". (#1697)
AsaiToshiya Jan 18, 2025
1b521d0
BREAKING.md: single quote -> back quote.
AsaiToshiya Jan 23, 2025
a7f30b1
add kind 32267 to list. (#1698)
AsaiToshiya Jan 28, 2025
70db801
Update 92.md (#1721)
v0l Jan 28, 2025
36c48ca
NIP-60: more consistent state transition (#1720)
pablof7z Jan 28, 2025
993c8a0
parameterized replaceable -> addressable (#1722)
patrickReiis Jan 29, 2025
54b431e
Add x tag to NIP-56 (#1669)
kehiy Jan 29, 2025
7370729
NIP-60: jsonconc -> jsonc (#1727)
patrickReiis Jan 30, 2025
f440eac
Remove reference to 'username' and update descriptions in metadata (#…
dtonon Jan 30, 2025
6a4b125
nip71: make video events regular (#1704)
fiatjaf Jan 31, 2025
e09f6da
add NIP-71 change.
AsaiToshiya Jan 31, 2025
c88d925
Update kind 10013 description in README (#1736)
tyiu Feb 3, 2025
8577545
nip60: fix links.
AsaiToshiya Feb 3, 2025
93568e3
Update 60.md (#1738)
EthnTuttle Feb 3, 2025
5a857e8
nip60/61 updates and simplifications (#1730)
fiatjaf Feb 4, 2025
2bc53c1
Update 61.md (#1739)
EthnTuttle Feb 4, 2025
a70e49e
update Cashu Wallet Event kind.
AsaiToshiya Feb 4, 2025
4e564ba
Fix NIPs refs (#1740)
TheAwiteb Feb 4, 2025
a0cd05f
NIP-61: get rid of 'a' tag (#1742)
patrickReiis Feb 5, 2025
3bbfbb2
NIP-01: Adds the author information to `e` tags (#1749)
vitorpamplona Feb 5, 2025
f2e89b1
Revert "NIP-01: Adds the author information to `e` tags (#1749)"
vitorpamplona Feb 5, 2025
63d1e89
Revert "Revert "NIP-01: Adds the author information to `e` tags (#174…
vitorpamplona Feb 5, 2025
e286001
NIP-61: nitpicks (#1754)
patrickReiis Feb 6, 2025
f1dee4a
Make description_hash verification optional (#1705)
nostrband Feb 7, 2025
c79ffe0
Clearly informs that kind 1 replies can only be used with kind 1 even…
vitorpamplona Feb 7, 2025
546b897
NIP-22: what is an I-tag? (#1757)
fiatjaf Feb 7, 2025
57c84cc
[NIP-55] - Add the rejected permission check in the code samples (#1755)
greenart7c3 Feb 7, 2025
0023ca8
Removes mention marker from NIP-10 in support of `q` tags (#1750)
vitorpamplona Feb 7, 2025
75f246e
docs: clarify NIP-47 key usage (#1756)
rolznz Feb 7, 2025
ab861e9
NIP-61: nitpick (#1765)
patrickReiis Feb 8, 2025
5991afb
add restricted to standardized machine-readable prefixes (#1685)
ZigBalthazar Feb 8, 2025
e411858
NIP-53 Live Events - Optional Pinned Chat Messages (#1577)
MerryOscar Feb 9, 2025
60c6404
61: nitpick (#1769)
patrickReiis Feb 10, 2025
6e7a618
Add Kind 15 for Encrypted File message (#1537)
water783 Feb 11, 2025
81908b6
remove get_relays from signers (#1779)
greenart7c3 Feb 14, 2025
f9f8b50
add kind 15 to list.
AsaiToshiya Feb 14, 2025
8e6f2c0
add kind:10002 to nip51 (#1785)
fiatjaf Feb 14, 2025
330de34
[NIP-55] Make it clear how to use the package name and what is the pu…
greenart7c3 Feb 17, 2025
619e3be
Right to Vanish (#1256)
vitorpamplona Feb 19, 2025
0f12cf1
Updates NIP-53 live chat to remove markers and add `q` tags (#1747)
vitorpamplona Feb 19, 2025
58287cd
Updates NIP-27 to use `q` tags instead of "mention" markers (#1751)
vitorpamplona Feb 19, 2025
0b6b69b
add NIP-56 link to `x` tag. (#1724)
AsaiToshiya Feb 19, 2025
93d9a12
Update BREAKING.md
AsaiToshiya Feb 20, 2025
7cc120e
Optional t tag to git repository announcements (#1798)
cypherhoodlum Feb 21, 2025
1e8b1bb
nip25: recommend that reactions do not include a million tags (#1811)
fiatjaf Feb 26, 2025
a3cd55f
NIP-17: Removes the need for markers and adds the use of `q` tags. (#…
vitorpamplona Feb 27, 2025
84c3d14
[NIP-55] Add a warning message when using web intents (#1457)
greenart7c3 Feb 28, 2025
89fac59
NIP-66 Relay Discovery and Liveness Monitoring (Draft 7) (#230)
dskvr Mar 3, 2025
64d4e3e
add NIP-66 to README.
AsaiToshiya Mar 4, 2025
d662d97
NIP-66: fix "PRE" to "addressable event". (#1820)
AsaiToshiya Mar 4, 2025
0ed88ee
NIP-01 `a` tag clarification (#1825)
alexgleason Mar 5, 2025
078ffd8
Long form with NIP-22 comments (#1830)
vitorpamplona Mar 6, 2025
cf161dd
Sync with upstream including CONFLICT
github-actions[bot] Mar 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions 01.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,36 @@ NIP-01

このNIPでは標準的なタグを3つ定義する。これらのタグは、あらゆるイベントのkindにおいて同じ意味で用いられる。以下の通りだ。

<<<<<<< HEAD
- `e`タグ。イベントを参照するために用いる: `["e", <他のイベントIDの32バイト小文字16進数文字列>, <おすすめのリレーURL、省略可能>]`
- `p`タグ。別のユーザを参照するために用いる: `["p", <pubkeyの32バイト小文字16進数文字列>, <おすすめのリレーURL、省略可能>]`
- `a`タグ。アドレス指定可能 (addressable) または置換可能 (replaceable) イベントを参照するために用いる。
- アドレス指定可能 (addressable) イベントの場合: `["a", <kind整数>:<pubkeyの32バイト小文字16進数文字列>:<dタグの値>, <おすすめリレーURL、省略可能>]`
- 置換可能 (replaceable) イベントの場合: `["a", <kind整数>:<pubkeyの32バイト小文字16進数文字列>:, <おすすめリレーURL、省略可能>]`
=======
- The `e` tag, used to refer to an event: `["e", <32-bytes lowercase hex of the id of another event>, <recommended relay URL, optional>, <32-bytes lowercase hex of the author's pubkey, optional>]`
- The `p` tag, used to refer to another user: `["p", <32-bytes lowercase hex of a pubkey>, <recommended relay URL, optional>]`
- The `a` tag, used to refer to an addressable or replaceable event
- for an addressable event: `["a", "<kind integer>:<32-bytes lowercase hex of a pubkey>:<d tag value>", <recommended relay URL, optional>]`
- for a normal replaceable event: `["a", "<kind integer>:<32-bytes lowercase hex of a pubkey>:", <recommended relay URL, optional>]` (note: include the trailing colon)
>>>>>>> upstream/master

慣例として、全ての1文字(英語のアルファベットa-zとA-Zに限る)キーをもつタグは、リレーによってインデクスされることが期待される。これにより、例えば、イベント`"5c83da77af1dec6d7289834998ad7aafbd9e2191396d75ec3cc27f5a77226f36"`を参照しているイベントをクエリしたり購読するために、`{"#e": ["5c83da77af1dec6d7289834998ad7aafbd9e2191396d75ec3cc27f5a77226f36"]}`フィルタを使える。

### Kinds

<<<<<<< HEAD
Kindはクライアントがイベントやイベントのフィールドをどう解釈すべきかを決める(たとえば、`"r"`タグのkind 1における意味は、kind 10002のイベントにおける意味と全く異なる可能性がある)。それぞれのNIPにおいて、他の場所で定義されていないkindの意味を定義する可能性がある。このNIPでは、以下のように2つの基本的なkindを定義する。

- `0`: **メタデータ**: `content`は文字列化されたJSONオブジェクト`{name: <ユーザ名>, about: <文字列>, picture: <URL、文字列>}`で、イベントを作成したユーザのことを記述する。リレーは、同一のpubkeyから新しいイベントを受信した際、過去のイベントを削除できる。
- `1`: **テキスト投稿**: `content`はノート(ユーザが発言したいこと)を**プレーンテキスト**で指定する。パースが必要なコンテンツ(マークダウンやHTMLなど)を使用すべきではない。クライアントもコンテンツをそのようにパースをしてはならない。
=======
Kinds specify how clients should interpret the meaning of each event and the other fields of each event (e.g. an `"r"` tag may have a meaning in an event of kind 1 and an entirely different meaning in an event of kind 10002). Each NIP may define the meaning of a set of kinds that weren't defined elsewhere. [NIP-10](10.md), for instance, especifies the `kind:1` text note for social media applications.

This NIP defines one basic kind:

- `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.
>>>>>>> upstream/master

実験を容易にし、リレーの実装を柔軟にするため、kindの範囲についての以下のような慣例もある。

Expand Down Expand Up @@ -160,6 +176,7 @@ Kindはクライアントがイベントやイベントのフィールドをど
- `EVENT`メッセージは、クライアントが(前述の`REQ`メッセージを用いて)以前に開始した購読IDと紐付けられたものだけが送信されなければならない(MUST)。
- `OK`メッセージは、クライアントから受信した`EVENT`メッセージに対する返信として送信されなければならない(MUST)。3番目のパラメータは、リレーがメッセージを受理する場合は`true`を、そうでなければ`false`を指定しなければならない。4番目のパラメータも必須で(MUST)、3番目が`true`の場合は空文字列でもかまわない(MAY)が、そうでなければ、機械可読な一語のプレフィクスに続けて`:`と人間可読なメッセージを含まなければならない(MUST)。例は以下の通り:
* `["OK", "b1a649ebe8...", true, ""]`
<<<<<<< HEAD
* `["OK", "b1a649ebe8...", true, "pow: difficulty 25>=24"]` pow: 難易度25は24以上
* `["OK", "b1a649ebe8...", true, "duplicate: already have this event"]` 重複: すでにこのイベントは存在している
* `["OK", "b1a649ebe8...", false, "blocked: you are banned from posting here"]` ブロックされている: あなたはここで投稿することが禁止されている
Expand All @@ -173,3 +190,19 @@ Kindはクライアントがイベントやイベントのフィールドをど
* `["CLOSED", "sub1", "error: could not connect to the database"]` エラー: データベースに接続できなかった
* `["CLOSED", "sub1", "error: shutting down idle subscription"]` エラー: アイドル状態の購読をシャットダウン
- `OK`と`CLOSED`の標準化されている機械可読なプレフィクスは、`duplicate`、`pow`、`blocked`、`rate-limited`、`invalid`と`error`(他のどれにも当てはまらない場合)である。
=======
* `["OK", "b1a649ebe8...", true, "pow: difficulty 25>=24"]`
* `["OK", "b1a649ebe8...", true, "duplicate: already have this event"]`
* `["OK", "b1a649ebe8...", false, "blocked: you are banned from posting here"]`
* `["OK", "b1a649ebe8...", false, "blocked: please register your pubkey at https://my-expensive-relay.example.com"]`
* `["OK", "b1a649ebe8...", false, "rate-limited: slow down there chief"]`
* `["OK", "b1a649ebe8...", false, "invalid: event creation date is too far off from the current time"]`
* `["OK", "b1a649ebe8...", false, "pow: difficulty 26 is less than 30"]`
* `["OK", "b1a649ebe8...", false, "restricted: not allowed to write."]`
* `["OK", "b1a649ebe8...", false, "error: could not connect to the database"]`
- `CLOSED` messages MUST be sent in response to a `REQ` when the relay refuses to fulfill it. It can also be sent when a relay decides to kill a subscription on its side before a client has disconnected or sent a `CLOSE`. This message uses the same pattern of `OK` messages with the machine-readable prefix and human-readable message. Some examples:
* `["CLOSED", "sub1", "unsupported: filter contains unknown elements"]`
* `["CLOSED", "sub1", "error: could not connect to the database"]`
* `["CLOSED", "sub1", "error: shutting down idle subscription"]`
- The standardized machine-readable prefixes for `OK` and `CLOSED` are: `duplicate`, `pow`, `blocked`, `rate-limited`, `invalid`, `restricted`, and `error` for when none of that fits.
>>>>>>> upstream/master
1 change: 0 additions & 1 deletion 07.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ async window.nostr.signEvent(event: { created_at: number, kind: number, tags: st

上記2つのメソッドの他に、オプションとして下記のメソッドを定義してもよい。
```
async window.nostr.getRelays(): { [url: string]: {read: boolean, write: boolean} } // returns a basic map of relay urls to relay policies
async window.nostr.nip04.encrypt(pubkey, plaintext): string // returns ciphertext and iv as specified in nip-04 (deprecated)
async window.nostr.nip04.decrypt(pubkey, ciphertext): string // takes ciphertext and iv as specified in nip-04 (deprecated)
async window.nostr.nip44.encrypt(pubkey, plaintext): string // returns ciphertext as specified in nip-44
Expand Down
29 changes: 23 additions & 6 deletions 10.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,43 @@
NIP-10
======


On "e" and "p" tags in Text Events (kind 1)
-------------------------------------------
Text Notes and Threads
----------------------

`draft` `optional`

This NIP defines `kind:1` as a simple plaintext note.

## Abstract
This NIP describes how to use "e" and "p" tags in text events, especially those that are replies to other text events. It helps clients thread the replies into a tree rooted at the original event.

The `.content` property contains some human-readable text.

`e` tags can be used to define note thread roots and replies. They SHOULD be sorted by the reply stack from root to the direct parent.

`q` tags MAY be used when citing events in the `.content` with [NIP-21](21.md).

```json
["q", "<event-id> or <event-address>", "<relay-url>", "<pubkey-if-a-regular-event>"]
```

Authors of the `e` and `q` tags SHOULD be added as `p` tags to notify of a new reply or quote.

Markup languages such as markdown and HTML SHOULD NOT be used.

## Marked "e" tags (PREFERRED)

Kind 1 events with `e` tags are replies to other kind 1 events. Kind 1 replies MUST NOT be used to reply to other kinds, use [NIP-22](22.md) instead.

`["e", <event-id>, <relay-url>, <marker>, <pubkey>]`

Where:

* `<event-id>` is the id of the event being referenced.
* `<relay-url>` is the URL of a recommended relay associated with the reference. Clients SHOULD add a valid `<relay-url>` field, but may instead leave it as `""`.
* `<marker>` is optional and if present is one of `"reply"`, `"root"`, or `"mention"`.
* `<marker>` is optional and if present is one of `"reply"`, `"root"`.
* `<pubkey>` is optional, SHOULD be the pubkey of the author of the referenced event

Those marked with `"reply"` denote the id of the reply event being responded to. Those marked with `"root"` denote the root id of the reply thread being responded to. For top level replies (those replying directly to the root event), only the `"root"` marker should be used. Those marked with `"mention"` denote a quoted or reposted event id.
Those marked with `"reply"` denote the id of the reply event being responded to. Those marked with `"root"` denote the root id of the reply thread being responded to. For top level replies (those replying directly to the root event), only the `"root"` marker should be used.

A direct reply to the root of a thread should have a single marked "e" tag of type "root".

Expand Down
54 changes: 50 additions & 4 deletions 17.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Kind `14` is a chat message. `p` tags identify one or more receivers of the mess
  "tags": [
    ["p", "<receiver-1-pubkey>", "<relay-url>"],
    ["p", "<receiver-2-pubkey>", "<relay-url>"],
    ["e", "<kind-14-id>", "<relay-url>", "reply"] // if this is a reply
    ["e", "<kind-14-id>", "<relay-url>"] // if this is a reply
["subject", "<conversation-title>"],
    // rest of tags...
  ],
Expand All @@ -31,10 +31,56 @@ Kind `14` is a chat message. `p` tags identify one or more receivers of the mess

`.content` MUST be plain text. Fields `id` and `created_at` are required.

Tags that mention, quote and assemble threading structures MUST follow [NIP-10](10.md).
An `e` tag denotes the direct parent message this post is replying to.

`q` tags MAY be used when citing events in the `.content` with [NIP-21](21.md).

```json
["q", "<event-id> or <event-address>", "<relay-url>", "<pubkey-if-a-regular-event>"]
```

Kind `14`s MUST never be signed. If it is signed, the message might leak to relays and become **fully public**.

## File Message Kind

```jsonc
{
"id": "<usual hash>",
"pubkey": "<sender-pubkey>",
"created_at": "<current-time>",
"kind": 15,
"tags": [
["p", "<receiver-1-pubkey>", "<relay-url>"],
["p", "<receiver-2-pubkey>", "<relay-url>"],
["e", "<kind-14-id>", "<relay-url>", "reply"], // if this is a reply
["subject", "<conversation-title>"],
["file-type", "<file-mime-type>"],
["encryption-algorithm", "<encryption-algorithm>"],
["decryption-key", "<decryption-key>"],
["decryptiion-nonce", "<decryption-nonce>"],
["x", "<the SHA-256 hexencoded string of the file>"],
// rest of tags...
],
"content": "<file-url>"
}
```

Kind 15 is used for sending encrypted file event messages:

- `file-type`: Specifies the MIME type of the attached file (e.g., `image/jpeg`, `audio/mpeg`, etc.).
- `encryption-algorithm`: Indicates the encryption algorithm used for encrypting the file. Supported algorithms may include `aes-gcm`, `chacha20-poly1305`,`aes-cbc` etc.
- `decryption-key`: The decryption key that will be used by the recipient to decrypt the file.
- `decryption-nonce`: The decryption nonce that will be used by the recipient to decrypt the file.
- `content`: The URL of the file (`<file-url>`).
- `x` containing the SHA-256 hexencoded string of the file.
- `size` (optional) size of file in bytes
- `dim` (optional) size of file in pixels in the form `<width>x<height>`
- `blurhash`(optional) the [blurhash](https://github.com/woltapp/blurhash) to show while the file is being loaded by the client
- `thumb` (optional) url of thumbnail with same aspect ratio
- `fallback` (optional) zero or more fallback file sources in case `url` fails

Just like kind 14, kind `15`s MUST never be signed.

## Chat Rooms

The set of `pubkey` + `p` tags defines a chat room. If a new `p` tag is added or a current one is removed, a new room is created with clean message history.
Expand All @@ -45,7 +91,7 @@ An optional `subject` tag defines the current name/topic of the conversation. An

## Encrypting

Following [NIP-59](59.md), the **unsigned** `kind:14` chat message must be sealed (`kind:13`) and then gift-wrapped (`kind:1059`) to each receiver and the sender individually.
Following [NIP-59](59.md), the **unsigned** `kind:14` & `kind:15` chat message must be sealed (`kind:13`) and then gift-wrapped (`kind:1059`) to each receiver and the sender individually.

```jsonc
{
Expand Down Expand Up @@ -133,7 +179,7 @@ When sending a message to anyone, clients must then connect to the relays in the

This example sends the message `Hola, que tal?` from `nsec1w8udu59ydjvedgs3yv5qccshcj8k05fh3l60k9x57asjrqdpa00qkmr89m` to `nsec12ywtkplvyq5t6twdqwwygavp5lm4fhuang89c943nf2z92eez43szvn4dt`.

The two final GiftWraps, one to the receiver and the other to the sender, are:
The two final GiftWraps, one to the receiver and the other to the sender, respectively, are:

```json
{
Expand Down
11 changes: 11 additions & 0 deletions 18.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ NIP-18
リポストは`kind 1`テキスト投稿が読む価値を持つことを
フォロワーへ知らせるために使われる`kind 6`イベントである。

<<<<<<< HEAD
リポストイベントの`content`は _リポストされた投稿を文字列化したJSON_ だ。これは空でもかまわない (MAY) が、推奨されない。
=======
The `content` of a repost event is _the stringified JSON of the reposted note_. It MAY also be empty, but that is not recommended.
Reposts of [NIP-70](70.md)-protected events SHOULD always have an empty `content`.
>>>>>>> upstream/master

リポストイベントはリポストされた投稿の`id`を持つ`e`タグを含まなければならない (MUST) 。
そのタグは投稿を取得可能な場所を指すリレーURLを
Expand All @@ -36,5 +41,11 @@ NIP-18
「汎用リポスト」として用い、これは`kind 1`以外のあらゆる種類のイベントを含めることが
できる。

<<<<<<< HEAD
`kind 16`のリポストは、リポストされたイベントの文字列化されたkind番号を値とする
`k`タグを含むべきだ (SHOULD) 。
=======
`kind 16` reposts SHOULD contain a `k` tag with the stringified kind number
of the reposted event as its value.

>>>>>>> upstream/master
Loading