---
eip: 7053
label: ERC-7053
title: Interoperable Digital Media Indexing
status: Final
type: Standards Track
category: ERC
created: 2023-05-22
official: https://eips.ethereum.org/EIPS/eip-7053
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7053.md
canonical: https://eips.huatuo.xyz/ko/eip-7053/
lang: ko
tldr: 디지털 미디어를 위한 단순한 온체인 인덱스. 누구나 파일의 콘텐츠 식별자(CID)와 데이터로 commit()을 호출할 수 있고, emit된 Commit 이벤트가 그 파일의 컨트랙트를 가로지르는 검색 가능한 이력이 된다.
tags: [media, provenance, cid, indexing, events]
---

# ERC-7053: Interoperable Digital Media Indexing

> A universal indexing method to record, discover and retrieve the history of digital media on EVM-compatible blockchains.

**TL;DR:** 디지털 미디어를 위한 단순한 온체인 인덱스. 누구나 파일의 콘텐츠 식별자(CID)와 데이터로 commit()을 호출할 수 있고, emit된 Commit 이벤트가 그 파일의 컨트랙트를 가로지르는 검색 가능한 이력이 된다.

## 어떤 문제를 해결하나요?

사진, 동영상 등 디지털 미디어는 복사되고, 편집되고, NFT로 발행되며, 많은 시스템에서 참조됩니다. 각 시스템이 자기만의 방식으로 파일을 추적하는 경향이 있어서, "*바로 이 파일*에 대해 누가, 어떤 체인에서, 무엇을 기록했는가?"를 물을 수 있는 공통 키가 없습니다. 출처(provenance)와 메타데이터가 파편화됩니다.

ERC-7053은 공통 키로 파일의 **콘텐츠 식별자(CID)** 를, 그리고 그것에 대해 기록을 남기는 표준 방식을 제안합니다. CID는 콘텐츠의 암호학적 해시이므로, 파일을 가진 누구나 다시 계산해 컨트랙트와 EVM 체인 전반에서 그에 대해 commit된 모든 것을 조회할 수 있습니다.

## 어떻게 동작하나요?

1. 미디어 파일의 **CID를 계산**합니다. 사양은 암호학적 해시에 기반한 콘텐츠 주소를 요구하며, 탈중앙화 스토리지에서 쓰이는 것과 같은 식별자여야 한다고 말합니다. 그래서 CID는 파일과 그 메타데이터의 위치도 알려 줍니다.
2. 준수하는 컨트랙트에서 CID와 자유 형식의 `commitData` 문자열(예: 메타데이터를 가리키는 포인터, 작업 설명, 편집 기록)로 **`commit`을 호출**합니다.
3. 컨트랙트는 **`Commit` 이벤트를 emit**하고 블록 번호를 반환합니다. 레퍼런스 구현은 CID별 블록 번호도 저장해 `getCommits`로 다시 읽을 수 있게 합니다.

```solidity
event Commit(address indexed recorder, string indexed assetCid, string commitData);

function commit(string memory assetCid, string memory commitData)
    public returns (uint256 blockNumber);
```

파일의 이력은 그 CID에 대한 `Commit` 이벤트의 순서 있는 목록이며, 여러 컨트랙트와 체인에 걸쳐 있을 수 있습니다. 컨트랙트가 생기기 전에 발행된 NFT도 `tokenURI`가 가리키는 파일의 CID를 계산하면 인덱싱할 수 있습니다.

## 샘플 코드

파일의 이력을 commit한 다음 조회하는 예제(ethers v6):

```ts
import { Contract, id } from "ethers";

const abi = [
  "event Commit(address indexed recorder, string indexed assetCid, string commitData)",
  "function commit(string assetCid, string commitData) returns (uint256)",
];
const registry = new Contract(registryAddress, abi, signer);

const cid = "bafy...";                       // CID of the media file
await (await registry.commit(cid, JSON.stringify({ action: "captured" }))).wait();

// Indexed strings are stored as keccak256 hashes in the log topic,
// so filter by the hash of the CID.
const logs = await registry.queryFilter(registry.filters.Commit(null, id(cid)));
for (const l of logs) console.log(l.blockNumber, l.args.recorder, l.args.commitData);
```

## 알아둘 점

- **상태: Final.**
- 컨트랙트는 아무것도 검증하지 **않습니다**. CID가 유효한지, `commitData`가 사실인지 확인하지 않습니다. 누구나 어떤 CID에 대해서든 무엇이든 commit할 수 있으므로, 신뢰는 기록이 존재한다는 사실이 아니라 `recorder`가 *누구인지*에서 나옵니다.
- `assetCid`는 indexed `string`이므로 로그 토픽에는 텍스트가 아니라 그 해시가 들어갑니다. 알고 있는 CID로 필터링할 수는 있지만 토픽만으로 CID를 다시 읽을 수는 없습니다. 필요하다면 `commitData`나 스토리지에 보관하세요.
- 인덱서는 로그로 이력을 구성할 때 리오그와 놓칠 수 있는 이벤트를 고려해야 합니다.


---

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