---
eip: 7517
label: ERC-7517
title: Content Consent for AI/ML Data Mining
status: Draft
type: Standards Track
category: ERC
created: 2023-09-12
requires: 721, 7053
official: https://eips.ethereum.org/EIPS/eip-7517
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7517.md
canonical: https://eips.huatuo.xyz/zh/eip-7517/
lang: zh
tldr: 在 NFT 和媒体元数据中增加 dataMiningPreference 对象，使创作者能够以机器可读的方式声明其内容是否可用于数据挖掘、AI 推理或 AI 训练。
tags: [nft, metadata, ai, content, provenance]
---

# ERC-7517: Content Consent for AI/ML Data Mining

> A proposal adding "dataMiningPreference" in the metadata to preserve the digital content's original intent and respect creator's rights.

**TL;DR:** 在 NFT 和媒体元数据中增加 dataMiningPreference 对象，使创作者能够以机器可读的方式声明其内容是否可用于数据挖掘、AI 推理或 AI 训练。

## 它解决什么问题？

网站有 `robots.txt` 来告诉爬虫可以索引什么。链上媒体和 NFT 却没有类似的方式来表达"你可以展示它，但不要用它训练生成式模型"。随着越来越多内容被抓取用于 AI 和机器学习，创作者希望有一种清晰、标准的方式来表达自己的意愿，而数据集构建者则希望有一个可以检查的简单字段。

ERC-7517 在现有元数据格式中添加了一个元数据属性 `dataMiningPreference`，涉及 [ERC-721](/eip-721/) 和 [ERC-1155](/eip-1155/) 的代币元数据，以及 [ERC-7053](/eip-7053/) 的媒体溯源记录。其设计与 C2PA（内容来源与真实性联盟，Coalition for Content Provenance and Authenticity）关于训练与挖掘声明的指引保持一致。

## 它如何运作

`dataMiningPreference` 是一个 JSON 对象。每个键是一个用途类别，每个值是 `allowed`、`notAllowed` 或 `constrained` 之一：

| 键 | 涵盖范围 |
| --- | --- |
| `dataMining` | 发现模式、趋势和相关性 |
| `aiInference` | 将资产作为已训练模型的输入 |
| `aiTraining` | 训练任何模型，无论是否为生成式 |
| `aiGenerativeTraining` | 训练能够产生衍生内容的模型 |
| `aiTrainingWithAuthorship` | 与 `aiTraining` 相同，但必须署名作者 |
| `aiGenerativeTrainingWithAuthorship` | 与 `aiGenerativeTraining` 相同，但必须署名作者 |

- `allowed`：可为该用途自由使用。
- `notAllowed`：不得用于该用途。
- `constrained`：仅在资产许可证规定的条件下使用。条件本身不在模式（schema）中；元数据应当引用许可证。若没有这些信息，规范规定按 `notAllowed` 处理。

键是可选的，也允许额外属性，因此创作者只需列出自己关心的类别。

## 示例代码

允许挖掘和推理、但禁止生成式训练的 ERC-721 代币元数据：

```json
{
  "name": "Harbor at Dawn #12",
  "description": "Original photograph.",
  "image": "ipfs://<cid>",
  "dataMiningPreference": {
    "dataMining": "allowed",
    "aiInference": "allowed",
    "aiTrainingWithAuthorship": "allowed",
    "aiGenerativeTraining": "notAllowed"
  },
  "license": {
    "name": "CC-BY-4.0",
    "document": "https://creativecommons.org/licenses/by/4.0/legalcode"
  }
}
```

爬虫端的检查（TypeScript）：

```ts
type Pref = "allowed" | "notAllowed" | "constrained";
function mayTrainGenerative(meta: any): boolean {
  const p: Pref | undefined = meta?.dataMiningPreference?.aiGenerativeTraining;
  return p === "allowed"; // treat missing or "constrained" as no unless the license is checked
}
```

## 需要注意

- 状态：**Draft**。
- 这是一种**声明，而非强制执行**。链上没有任何机制阻止别人无视它；其价值取决于 AI 开发者是否选择遵守。
- 示例中的 `license` 字段仅为示意，并非本提案所定义。
- 请核实设置偏好的人确实拥有或控制该资产。托管在链下的元数据可以被更改，除非它是内容寻址的。
- 规范文本中同时使用了 "constraint" 和 "constrained"；JSON 模式中的取值是 `constrained`。


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-7517
