---
eip: 3440
label: ERC-3440
title: ERC-721 Editions Standard
status: Stagnant
type: Standards Track
category: ERC
created: 2021-04-20
requires: 712, 721
official: https://eips.ethereum.org/EIPS/eip-3440
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-3440.md
canonical: https://eips.huatuo.xyz/zh/eip-3440/
lang: zh
tldr: 面向艺术品的 ERC-721 扩展，允许艺术家固定限量版的数量、指定原作代币，并为单个代币附上 EIP-712 签名，作为链上的来源证明。
tags: [nft, erc721, art, provenance, signatures]
---

# ERC-3440: ERC-721 Editions Standard

> This standard addresses an extension to the ERC-721 specification by allowing signatures on NFTs representing works of art. This provides improved provenance by creating functionality for an artist to designate an original and signed limited-edition prints of their work.

**TL;DR:** 面向艺术品的 ERC-721 扩展，允许艺术家固定限量版的数量、指定原作代币，并为单个代币附上 EIP-712 签名，作为链上的来源证明。

## 它解决什么问题？

[ERC-721](/eip-721/) 是为通用的独一无二的资产设计的：地契、游戏道具、收藏品。对于数字艺术，代币与艺术家之间的联系通常只存在于链下元数据中，而部署或铸造某个系列的地址，也不一定是艺术家本人掌控的密钥。

实体艺术有两个人们熟悉的信任标志：编号的**限量版**印数，以及艺术家在原作和复制品上的**签名**。ERC-3440 把这两者都带给了 NFT，让市场和查看器仅凭链上数据就能显示艺术家限定了供应量，并对某个特定代币签了名。

## 它如何运作

扩展 ERC-721 的合约会增加：

- **`artist`**：被指定为艺术家的地址（只能设置一次）。
- **`editionSupply`**：版本的最大数量。只能设置一次；此后不能再铸造更多 ID。
- **`originalId`**：作为原作的代币 ID。默认为 `0`，只能指定一次。
- **签名**：艺术家签署一条 [EIP-712](/eip-712/) 消息（字段：验证地址 = 本合约、艺术家名称、钱包、内容）。艺术家调用签名函数，合约检查签名能恢复出 `artist`，将其与代币 ID 对应存储（仅限一次），并触发 `Signed(from, tokenId)` 事件。
- **视图函数**：`getSignature(tokenId)` 返回存储的签名；`isSigned(message, signature, tokenId)` 检查它是否能恢复出艺术家，并与存储的内容一致。

签名是可选的；版本数量限制和原作指定则是必需的。参考设计把所有一次性设置都放在构造函数中完成，这样艺术家在出售之后就无法更改供应量。

## 示例代码

按照参考结构体，用 ethers v6 在链下为代币签名（域的值与规范中的示例合约一致）：

```ts
import { Wallet } from "ethers";

const domain = {
  name: "Artist's Editions",
  version: "1",
  chainId: 1,
  verifyingContract: artTokenAddress,
};
const types = {
  Signature: [
    { name: "verificationAddress", type: "address" },
    { name: "artist", type: "string" },
    { name: "wallet", type: "address" },
    { name: "contents", type: "string" },
  ],
};
const message = {
  verificationAddress: artTokenAddress,   // bind the signature to this contract
  artist: "Jane Doe",
  wallet: artist.address,
  contents: "Edition 3 of 10, signed",
};
const signature = await artist.signTypedData(domain, types, message);

// Then, from the artist account:
// await artToken.sign(3, message, signature);
```

## 需要注意

- 状态为 **Stagnant**；市场并未广泛采用。
- 规范中的参考 Solidity 代码存在不一致。其 `SIGNATURE_TYPEHASH` 字符串与结构体相比，字段名不同（`verifyAddress`）且有多余的空白，另外一些调用引用的是 `hash` 而不是 `_hash`。按上面方式由结构体构造的签名与该 typehash 不会匹配，因此在任何实际实现中都应修正类型字符串。
- 签名证明的是艺术家的密钥批准了一条关于某个代币的消息；它无法阻止别人复制作品本身。
- 关于二级市场销售中的艺术家版税，请参阅 [ERC-2981](/eip-2981/)，那是一个独立且被广泛支持的扩展。


---

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