---
eip: 7847
label: ERC-7847
title: Social Media NFTs
status: Draft
type: Standards Track
category: ERC
created: 2024-12-18
requires: 721, 1155
official: https://eips.ethereum.org/EIPS/eip-7847
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7847.md
canonical: https://eips.huatuo.xyz/ko/eip-7847/
lang: ko
tldr: Nostr 방식의 서명된 소셜 게시물을 NFT로 발행하기 위한 초안 형식. 어떤 NFT 컨트랙트, 지갑, 마켓플레이스든 탈중앙 소셜 콘텐츠를 담고 보여 줄 수 있게 한다.
tags: [nft, social, nostr, metadata, erc-721]
---

# ERC-7847: Social Media NFTs

> Create a social media post or publication in the form of an NFT.

**TL;DR:** Nostr 방식의 서명된 소셜 게시물을 NFT로 발행하기 위한 초안 형식. 어떤 NFT 컨트랙트, 지갑, 마켓플레이스든 탈중앙 소셜 콘텐츠를 담고 보여 줄 수 있게 한다.

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

중앙화된 소셜 플랫폼은 게시물을 검열하거나, 순서를 바꾸거나, 삭제할 수 있습니다. 이전의 온체인 소셜 프로젝트는 대개 자기들만의 컨트랙트 묶음에 의존했습니다. ERC-7847은 다른 길을 택합니다. 각 게시물이 작성자의 키로 서명되는 개방형 프로토콜인 **Nostr**의 이벤트 형식을 재사용하고, 그 이벤트를 평범한 NFT로 저장합니다.

게시물은 체인과 무관하게 서명되므로, 어느 컨트랙트가 민팅했는지, 누가 토큰을 소유하는지는 중요하지 않습니다. 이미 NFT를 보여 주는 모든 지갑과 마켓플레이스가 게시물이 나타날 수 있는 장소가 되고, 누구나 이를 인덱싱해 피드를 만들 수 있습니다.

## 어떻게 동작하나요?

**이벤트.** 게시물은 `pubkey`, `created_at`, `kind`, `tags`, `content`를 가집니다. `id`는 다음 JSON 직렬화의 SHA-256입니다(모든 구현이 같은 바이트를 얻도록 엄격한 이스케이프 규칙이 있습니다).

```json
[0, "<pubkey hex>", <created_at>, <kind>, <tags>, "<content>"]
```

작성자는 secp256k1 위의 Schnorr 서명(Nostr와 같은 BIP-340 방식)으로 `id`에 서명해 `sig`를 만듭니다.

**Kind.** `0`은 사용자 메타데이터(이름, 소개, 사진), `1`은 원본 게시물 또는 답글, `6`은 리포스트입니다. 인용 리포스트는 `q` 태그가 붙은 kind 1입니다.

**태그.** 문자열 배열입니다. `["blockchain", chain, contract, tokenId]`(권장), 답글용 `["e", eventId, relay, marker, pubkey]`(marker는 `reply`, `root`, `mention`), 관련된 사람을 나타내는 `["p", pubkey]`, 링크를 나타내는 `["r", url]`, 미디어를 나타내는 `["imeta", ...]`가 있습니다.

**NFT 메타데이터.** 토큰의 `description`은 `content`와 같고, 모든 이벤트 필드(`id`, `pubkey`, `created_at`, `kind`, `sig`, `content`, 그리고 태그)는 `trait_type`/`value` 쌍으로 `attributes`에 나타납니다.

**온체인 이벤트.** 게시물이 민팅되면 컨트랙트가 `PubEvent(id, pubkey, created_at, kind, content, tags, sig)`를 발생시키므로, 인덱서는 메타데이터를 읽지 않고도 게시물을 따라갈 수 있습니다. 필수인 것은 이 이벤트와 메타데이터 형식뿐입니다.

## 샘플 코드

민팅된 게시물의 메타데이터:

```json
{
  "name": "Hello from the chain",
  "description": "gm, first on-chain post",
  "attributes": [
    { "trait_type": "id", "value": "<sha256 of serialized event, hex>" },
    { "trait_type": "pubkey", "value": "<32-byte x-only pubkey, hex>" },
    { "trait_type": "created_at", "value": 1735000000 },
    { "trait_type": "kind", "value": 1 },
    { "trait_type": "sig", "value": "<64-byte schnorr signature, hex>" },
    { "trait_type": "content", "value": "gm, first on-chain post" }
  ]
}
```

필수 이벤트를 발생시키는 최소한의 민팅 함수(ERC-721 기반):

```solidity
event PubEvent(bytes32 id, bytes32 indexed pubkey, uint256 created_at,
               uint32 indexed kind, string content, string tags, string sig);

function createPost(uint256 tokenId, string calldata uri, bytes32 id, bytes32 pubkey,
                    uint256 createdAt, uint32 kind, string calldata content,
                    string calldata tags, string calldata sig) external {
    _safeMint(msg.sender, tokenId);
    _setTokenURI(tokenId, uri);
    emit PubEvent(id, pubkey, createdAt, kind, content, tags, sig);
}
```

## 알아둘 점

- 상태는 **Draft**입니다. 스펙의 이벤트 정의에는 아직 사소한 문법 오류가 있고 바뀔 수 있습니다.
- 진위는 `id`에 대한 Schnorr 서명에서 나오며 토큰 소유권에서 나오지 않습니다. 검증자는 필드로부터 `id`를 다시 계산하고 `sig`를 `pubkey`로 확인해야 합니다.
- 서명 키는 일반적인 이더리움 주소 파생이 아니라 Schnorr/Taproot 공개키를 씁니다. 스펙은 키 생성과 서명에 Nostr 도구(예: nostr-tools)를 쓸 것을 권장합니다.
- [ERC-1155](/eip-1155/)에서는 여러 개의 사본이 민팅되더라도 토큰 ID 하나가 게시물 하나를 나타내야 합니다.
- 누구나 어떤 컨트랙트에서든 게시물을 민팅할 수 있으므로, 앱은 자체 모더레이션, 차단 목록, 평판 체계를 갖춰야 합니다.


---

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