Skip to content

Commit 190565b

Browse files
Sync with upstream including CONFLICT
2 parents 6166c02 + fd9c627 commit 190565b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+2802
-688
lines changed

01.md

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ NIP-01
1414

1515
ただ1つだけ存在するオブジェクトの型が`event`で、以下のようなフォーマットで伝送される。
1616

17-
```jsonc
17+
```yaml
1818
{
1919
"id": <32-bytes lowercase hex-encoded sha256 of the serialized event data>,
2020
"pubkey": <32-bytes lowercase hex-encoded public key of the event creator>,
@@ -75,20 +75,36 @@ NIP-01
7575

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

78+
<<<<<<< HEAD
7879
- `e`タグ。イベントを参照するために用いる: `["e", <他のイベントIDの32バイト小文字16進数文字列>, <おすすめのリレーURL、省略可能>]`
7980
- `p`タグ。別のユーザを参照するために用いる: `["p", <pubkeyの32バイト小文字16進数文字列>, <おすすめのリレーURL、省略可能>]`
8081
- `a`タグ。アドレス指定可能 (addressable) または置換可能 (replaceable) イベントを参照するために用いる。
8182
- アドレス指定可能 (addressable) イベントの場合: `["a", <kind整数>:<pubkeyの32バイト小文字16進数文字列>:<dタグの値>, <おすすめリレーURL、省略可能>]`
8283
- 置換可能 (replaceable) イベントの場合: `["a", <kind整数>:<pubkeyの32バイト小文字16進数文字列>:, <おすすめリレーURL、省略可能>]`
84+
=======
85+
- 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>]`
86+
- The `p` tag, used to refer to another user: `["p", <32-bytes lowercase hex of a pubkey>, <recommended relay URL, optional>]`
87+
- The `a` tag, used to refer to an addressable or replaceable event
88+
- for an addressable event: `["a", "<kind integer>:<32-bytes lowercase hex of a pubkey>:<d tag value>", <recommended relay URL, optional>]`
89+
- for a normal replaceable event: `["a", "<kind integer>:<32-bytes lowercase hex of a pubkey>:", <recommended relay URL, optional>]` (note: include the trailing colon)
90+
>>>>>>> upstream/master
8391
8492
慣例として、全ての1文字(英語のアルファベットa-zとA-Zに限る)キーをもつタグは、リレーによってインデクスされることが期待される。これにより、例えば、イベント`"5c83da77af1dec6d7289834998ad7aafbd9e2191396d75ec3cc27f5a77226f36"`を参照しているイベントをクエリしたり購読するために、`{"#e": ["5c83da77af1dec6d7289834998ad7aafbd9e2191396d75ec3cc27f5a77226f36"]}`フィルタを使える。
8593

8694
### Kinds
8795

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

9099
- `0`: **メタデータ**: `content`は文字列化されたJSONオブジェクト`{name: <ユーザ名>, about: <文字列>, picture: <URL、文字列>}`で、イベントを作成したユーザのことを記述する。リレーは、同一のpubkeyから新しいイベントを受信した際、過去のイベントを削除できる。
91100
- `1`: **テキスト投稿**: `content`はノート(ユーザが発言したいこと)を**プレーンテキスト**で指定する。パースが必要なコンテンツ(マークダウンやHTMLなど)を使用すべきではない。クライアントもコンテンツをそのようにパースをしてはならない。
101+
=======
102+
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, specifies the `kind:1` text note for social media applications.
103+
104+
This NIP defines one basic kind:
105+
106+
- `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.
107+
>>>>>>> upstream/master
92108
93109
実験を容易にし、リレーの実装を柔軟にするため、kindの範囲についての以下のような慣例もある。
94110

@@ -119,7 +135,7 @@ Kindはクライアントがイベントやイベントのフィールドをど
119135

120136
`<フィルタX>`はJSONオブジェクトで、どんなイベントがその購読で転送されるかを決める。以下の属性をもつ可能性がある:
121137

122-
```json
138+
```yaml
123139
{
124140
"ids": <a list of event ids>,
125141
"authors": <a list of lowercase pubkeys, the pubkey of an event must be one of these>,
@@ -143,7 +159,11 @@ Kindはクライアントがイベントやイベントのフィールドをど
143159

144160
1つの`REQ`メッセージに複数のフィルタを含むことができる。この場合、いずれかのフィルタにマッチするイベントが返される。つまり、複数のフィルタは`||`条件として解釈される。
145161

162+
<<<<<<< HEAD
146163
フィルタの`limit`プロパティは、初期クエリにのみ影響を及ぼし、それ以降は無視されなければならない(MUST)。`limit: n`が存在する場合、初期クエリでは最新の`n`イベントが`created_at`順に返されることが想定される。`新しいイベントが最初に表示され、同時刻の場合はidが最も小さい (辞書式順序で最初の) イベントが最初に表示されるべきである。limit`の指定よりも少ないイベントを返すことは問題ない。しかし、クライアントに対して不必要に負荷を与えることを避けるため、リレーは要求されたよりも(はるかに)多くのイベントを返すことがないよう期待される。
164+
=======
165+
The `limit` property of a filter is only valid for the initial query and MUST be ignored afterwards. When `limit: n` is present it is assumed that the events returned in the initial query will be the last `n` events ordered by the `created_at`. Newer events should appear first, and in the case of ties the event with the lowest id (first in lexical order) should be first. Relays SHOULD use the `limit` value to guide how many events are returned in the initial response. Returning fewer events is acceptable, but returning (much) more should be avoided to prevent overwhelming clients.
166+
>>>>>>> upstream/master
147167
148168
### リレーからクライアントへ: イベントの送信と通知
149169

@@ -160,6 +180,7 @@ Kindはクライアントがイベントやイベントのフィールドをど
160180
- `EVENT`メッセージは、クライアントが(前述の`REQ`メッセージを用いて)以前に開始した購読IDと紐付けられたものだけが送信されなければならない(MUST)。
161181
- `OK`メッセージは、クライアントから受信した`EVENT`メッセージに対する返信として送信されなければならない(MUST)。3番目のパラメータは、リレーがメッセージを受理する場合は`true`を、そうでなければ`false`を指定しなければならない。4番目のパラメータも必須で(MUST)、3番目が`true`の場合は空文字列でもかまわない(MAY)が、そうでなければ、機械可読な一語のプレフィクスに続けて`:`と人間可読なメッセージを含まなければならない(MUST)。例は以下の通り:
162182
* `["OK", "b1a649ebe8...", true, ""]`
183+
<<<<<<< HEAD
163184
* `["OK", "b1a649ebe8...", true, "pow: difficulty 25>=24"]` pow: 難易度25は24以上
164185
* `["OK", "b1a649ebe8...", true, "duplicate: already have this event"]` 重複: すでにこのイベントは存在している
165186
* `["OK", "b1a649ebe8...", false, "blocked: you are banned from posting here"]` ブロックされている: あなたはここで投稿することが禁止されている
@@ -173,3 +194,20 @@ Kindはクライアントがイベントやイベントのフィールドをど
173194
* `["CLOSED", "sub1", "error: could not connect to the database"]` エラー: データベースに接続できなかった
174195
* `["CLOSED", "sub1", "error: shutting down idle subscription"]` エラー: アイドル状態の購読をシャットダウン
175196
- `OK``CLOSED`の標準化されている機械可読なプレフィクスは、`duplicate``pow``blocked``rate-limited``invalid``error`(他のどれにも当てはまらない場合)である。
197+
=======
198+
* `["OK", "b1a649ebe8...", true, "pow: difficulty 25>=24"]`
199+
* `["OK", "b1a649ebe8...", true, "duplicate: already have this event"]`
200+
* `["OK", "b1a649ebe8...", false, "blocked: you are banned from posting here"]`
201+
* `["OK", "b1a649ebe8...", false, "blocked: please register your pubkey at https://my-expensive-relay.example.com"]`
202+
* `["OK", "b1a649ebe8...", false, "rate-limited: slow down there chief"]`
203+
* `["OK", "b1a649ebe8...", false, "invalid: event creation date is too far off from the current time"]`
204+
* `["OK", "b1a649ebe8...", false, "pow: difficulty 26 is less than 30"]`
205+
* `["OK", "b1a649ebe8...", false, "restricted: not allowed to write."]`
206+
* `["OK", "b1a649ebe8...", false, "error: could not connect to the database"]`
207+
* `["OK", "b1a649ebe8...", false, "mute: no one was listening to your ephemeral event and it wasn't handled in any way, it was ignored"]`
208+
- `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:
209+
* `["CLOSED", "sub1", "unsupported: filter contains unknown elements"]`
210+
* `["CLOSED", "sub1", "error: could not connect to the database"]`
211+
* `["CLOSED", "sub1", "error: shutting down idle subscription"]`
212+
- The standardized machine-readable prefixes for `OK` and `CLOSED` are: `duplicate`, `pow`, `blocked`, `rate-limited`, `invalid`, `restricted`, `mute` and `error` for when none of that fits.
213+
>>>>>>> upstream/master

03.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ NIP-03
1212
{
1313
"kind": 1040
1414
"tags": [
15-
["e", <event-id>, <relay-url>],
16-
["alt", "opentimestamps attestation"]
15+
["e", <target-event-id>, <relay-url>],
16+
["k", "<target-event-kind>"]
1717
],
1818
"content": <base64-encoded OTS file data>
1919
}

07.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ async window.nostr.signEvent(event: { created_at: number, kind: number, tags: st
1717

1818
上記2つのメソッドの他に、オプションとして下記のメソッドを定義してもよい。
1919
```
20-
async window.nostr.getRelays(): { [url: string]: {read: boolean, write: boolean} } // returns a basic map of relay urls to relay policies
2120
async window.nostr.nip04.encrypt(pubkey, plaintext): string // returns ciphertext and iv as specified in nip-04 (deprecated)
2221
async window.nostr.nip04.decrypt(pubkey, ciphertext): string // takes ciphertext and iv as specified in nip-04 (deprecated)
2322
async window.nostr.nip44.encrypt(pubkey, plaintext): string // returns ciphertext as specified in nip-44

10.md

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,43 @@
11
NIP-10
22
======
33

4-
5-
On "e" and "p" tags in Text Events (kind 1)
6-
-------------------------------------------
4+
Text Notes and Threads
5+
----------------------
76

87
`draft` `optional`
98

9+
This NIP defines `kind:1` as a simple plaintext note.
10+
1011
## Abstract
11-
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.
12+
13+
The `.content` property contains some human-readable text.
14+
15+
`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.
16+
17+
`q` tags MAY be used when citing events in the `.content` with [NIP-21](21.md).
18+
19+
```json
20+
["q", "<event-id> or <event-address>", "<relay-url>", "<pubkey-if-a-regular-event>"]
21+
```
22+
23+
Authors of the `e` and `q` tags SHOULD be added as `p` tags to notify of a new reply or quote.
24+
25+
Markup languages such as markdown and HTML SHOULD NOT be used.
1226

1327
## Marked "e" tags (PREFERRED)
28+
29+
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.
30+
1431
`["e", <event-id>, <relay-url>, <marker>, <pubkey>]`
1532

1633
Where:
1734

1835
* `<event-id>` is the id of the event being referenced.
1936
* `<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 `""`.
20-
* `<marker>` is optional and if present is one of `"reply"`, `"root"`, or `"mention"`.
37+
* `<marker>` is optional and if present is one of `"reply"`, `"root"`.
2138
* `<pubkey>` is optional, SHOULD be the pubkey of the author of the referenced event
2239

23-
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.
40+
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.
2441

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

0 commit comments

Comments
 (0)