# NIP10

## 文本事件中的" e "和" p "标签（类型 1）。

`draft` `optional` `author:unclebobmartin`

## 抽象的

这个 NIP 描述了如何在文本事件中使用" e "和" p "标签，特别是那些对其他文本事件的回复。它帮助客户端将回复串接到以原始事件为根的树中。

## 位置" e "标记（已弃用）

> 此方案常用；但应视为已弃用。

`["e", <event-id>, <relay-url>]` 按照 NIP-01。

其中：

* 引用的事件的 `<event-id>` ID.
* `<relay-url>` 是与引用关联的推荐中继的 URL.许多客户端将此字段视为可选。

**事件中“ e ”标签的位置表示如下特定含义**:

* 无" E "标签：\
  此事件不是对任何其他事件的回复，也不涉及任何其他事件。
* 一个" E "标签：\
  `["e", <id>]`：此事件是对其的回复的事件的 ID.
* 两个" e "标签： `["e", <root-id>]`， `["e", <reply-id>]`\
  `<root-id>` 是位于回复链的根处的事件的 ID.此事件是对其的答复的项目的 `<reply-id>` ID.
* 许多" e "标签： `["e", <root-id>]` `["e", <mention-id>]`，..， `["e", <reply-id>]`\
  可能有任何数量的 `<mention-ids>`。这些是可能在或可能不在回复链中的事件的 ID.它们是这次事件的引文。 `root-id` 且 `reply-id` 如上。

> 此方案已被弃用，因为当一个事件引用另一个事件但不是回复时，它会产生难以解决或无法解决的歧义。

## 标有" E "的标签（首选）

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

其中：

* 引用的事件的 `<event-id>` ID.
* `<relay-url>` 是与引用关联的推荐中继的 URL.客户端应添加有效 `<relay-URL>` 字段，但可以将其保留为 `""`。
* `<marker>` 是可选的 `"reply"`，如果存在，则为、 `"root"` 或 `"mention"` 之一。

\*\*标记为“ E”的标签的顺序不相关。\*\*标有的 `"reply"` 表示正在响应的回复事件的 ID.那些标有的 `"root"` 线程表示被响应的回复线程的根 ID.对于顶级回复（直接回复根事件的回复），只 `"root"` 应使用标记。标有的 `"mention"` 表示引用或重新发布的事件 ID.

对线程根的直接回复应该有一个" root "类型的标记为" e "的标签。

> 此方案是首选方案，因为它允许事件提及其他事件，而不会将它们与 `<reply-id>` 或 `<root-id>` 混淆。

## " P "标签

在文本事件中使用，包含用于记录谁参与了回复线程的公钥列表。

回复文本事件 E 时，回复事件的" P "标签应包含 E 的所有" P "标签以及被回复事件 `"pubkey"` 的。

示例：给定一个由 `a1` " p "标签 \[ `p1`， `p2`， `p3`] 编写的文本事件，则回复的" p "标签应为 \[ `a1`， `p1`， `p2`， `p3`]（无特定顺序）。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sherry-pang.gitbook.io/nostr-cn/fu-lu-1-nip-xiang-jie/10.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
