{"eip":7847,"title":"Social Media NFTs","description":"Create a social media post or publication in the form of an NFT.","authors":["Nick Juntilla (@nickjuntilla) \u003cnick@ownerfy.com\u003e"],"status":"Draft","type":"Standards Track","category":"ERC","created":"2024-12-18","requires":[721,1155],"discussionsTo":"https://ethereum-magicians.org/t/erc-7847-social-media-nfts/22280","repo":"ERCs","label":"ERC-7847","officialUrl":"https://eips.ethereum.org/EIPS/eip-7847","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7847.md","url":"https://eips.huatuo.xyz/eip-7847/","tldr":{"en":"Draft format for publishing Nostr-style signed social posts as NFTs, so any NFT contract, wallet or marketplace can carry and display decentralised social content.","ja":"Nostr 形式の署名付きソーシャル投稿を NFT として公開するためのドラフト形式。あらゆる NFT コントラクト、ウォレット、マーケットプレイスが、分散型のソーシャルコンテンツを運び、表示できるようにする。","ko":"Nostr 방식의 서명된 소셜 게시물을 NFT로 발행하기 위한 초안 형식. 어떤 NFT 컨트랙트, 지갑, 마켓플레이스든 탈중앙 소셜 콘텐츠를 담고 보여 줄 수 있게 한다.","zh":"草案格式：把 Nostr 风格的已签名社交帖子作为 NFT 发布，使任何 NFT 合约、钱包或市场都能承载并展示去中心化的社交内容。"},"tags":["nft","social","nostr","metadata","erc-721"],"explainers":{"en":{"lang":"en","tldr":"Draft format for publishing Nostr-style signed social posts as NFTs, so any NFT contract, wallet or marketplace can carry and display decentralised social content.","tags":["nft","social","nostr","metadata","erc-721"],"related":[721,1155],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-7847/","markdown":"## What problem does it solve?\n\nCentralised social platforms can censor, reorder or delete posts. Earlier on-chain social projects usually depended on their own specific set of contracts. ERC-7847 takes a different route: reuse the event format of **Nostr**, an open protocol where each post is signed by its author's key, and store those events as ordinary NFTs.\n\nSince posts are signed independently of the chain, it does not matter which contract mints them or who owns the token. Every wallet and marketplace that already shows NFTs becomes a place where posts can appear, and anyone can build a feed by indexing them.\n\n## How it works\n\n**The event.** A post has `pubkey`, `created_at`, `kind`, `tags` and `content`. Its `id` is the SHA-256 of this exact JSON serialisation (with strict escaping rules so every implementation gets the same bytes):\n\n```json\n[0, \"\u003cpubkey hex\u003e\", \u003ccreated_at\u003e, \u003ckind\u003e, \u003ctags\u003e, \"\u003ccontent\u003e\"]\n```\n\nThe author signs the `id` with a Schnorr signature on secp256k1 (BIP-340 style, as in Nostr), producing `sig`.\n\n**Kinds.** `0` user metadata (name, about, picture), `1` original post or reply, `6` repost. Quote reposts are kind 1 with a `q` tag.\n\n**Tags.** Arrays of strings: `[\"blockchain\", chain, contract, tokenId]` (recommended), `[\"e\", eventId, relay, marker, pubkey]` for replies with markers `reply`, `root` or `mention`, `[\"p\", pubkey]` for people involved, `[\"r\", url]` for links, and `[\"imeta\", ...]` for media.\n\n**NFT metadata.** The token's `description` equals `content`, and every event field (`id`, `pubkey`, `created_at`, `kind`, `sig`, `content`, plus tags) appears in `attributes` as `trait_type`/`value` pairs.\n\n**On-chain event.** The contract emits `PubEvent(id, pubkey, created_at, kind, content, tags, sig)` when a post is minted, so indexers can follow posts without reading metadata. Only this event and the metadata format are required.\n\n## Sample code\n\nMetadata for a minted post:\n\n```json\n{\n  \"name\": \"Hello from the chain\",\n  \"description\": \"gm, first on-chain post\",\n  \"attributes\": [\n    { \"trait_type\": \"id\", \"value\": \"\u003csha256 of serialized event, hex\u003e\" },\n    { \"trait_type\": \"pubkey\", \"value\": \"\u003c32-byte x-only pubkey, hex\u003e\" },\n    { \"trait_type\": \"created_at\", \"value\": 1735000000 },\n    { \"trait_type\": \"kind\", \"value\": 1 },\n    { \"trait_type\": \"sig\", \"value\": \"\u003c64-byte schnorr signature, hex\u003e\" },\n    { \"trait_type\": \"content\", \"value\": \"gm, first on-chain post\" }\n  ]\n}\n```\n\nMinimal minting function emitting the required event (ERC-721 based):\n\n```solidity\nevent PubEvent(bytes32 id, bytes32 indexed pubkey, uint256 created_at,\n               uint32 indexed kind, string content, string tags, string sig);\n\nfunction createPost(uint256 tokenId, string calldata uri, bytes32 id, bytes32 pubkey,\n                    uint256 createdAt, uint32 kind, string calldata content,\n                    string calldata tags, string calldata sig) external {\n    _safeMint(msg.sender, tokenId);\n    _setTokenURI(tokenId, uri);\n    emit PubEvent(id, pubkey, createdAt, kind, content, tags, sig);\n}\n```\n\n## Things to know\n\n- Status is **Draft**; the event definition in the spec still has small syntax errors and may change.\n- Authenticity comes from the Schnorr signature over `id`, not from token ownership. Verifiers must recompute `id` from the fields and check `sig` against `pubkey`.\n- The signing key uses Schnorr/Taproot public keys, not the usual Ethereum address derivation; the spec recommends Nostr tooling (e.g. nostr-tools) to generate keys and sign.\n- With [ERC-1155](/eip-1155/), one token ID should represent one post even if minted in multiple copies.\n- Anyone can mint posts in any contract, so apps must bring their own moderation, blocklists or reputation.\n"},"ja":{"lang":"ja","tldr":"Nostr 形式の署名付きソーシャル投稿を NFT として公開するためのドラフト形式。あらゆる NFT コントラクト、ウォレット、マーケットプレイスが、分散型のソーシャルコンテンツを運び、表示できるようにする。","tags":["nft","social","nostr","metadata","erc-721"],"related":[721,1155],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-7847/","markdown":"## 何を解決するのか\n\n中央集権的なソーシャルプラットフォームは、投稿を検閲したり、並べ替えたり、削除したりできます。これまでのオンチェーンのソーシャルプロジェクトは、たいてい自分たち専用のコントラクト群に依存していました。ERC-7847 は別の道を取ります。各投稿が作者の鍵で署名されるオープンなプロトコルである **Nostr** のイベント形式を再利用し、そのイベントを普通の NFT として保存します。\n\n投稿はチェーンとは独立に署名されているため、どのコントラクトがミントしたか、誰がトークンを所有しているかは問題になりません。すでに NFT を表示しているあらゆるウォレットとマーケットプレイスが、投稿を表示できる場所になり、誰でもそれらをインデックスしてフィードを作れます。\n\n## 仕組み\n\n**イベント。** 投稿は `pubkey`、`created_at`、`kind`、`tags`、`content` を持ちます。`id` は、次の JSON シリアライズそのものの SHA-256 です（すべての実装が同じバイト列になるよう、厳格なエスケープ規則があります）。\n\n```json\n[0, \"\u003cpubkey hex\u003e\", \u003ccreated_at\u003e, \u003ckind\u003e, \u003ctags\u003e, \"\u003ccontent\u003e\"]\n```\n\n作者は、secp256k1 上の Schnorr 署名（Nostr と同じ BIP-340 方式）で `id` に署名し、`sig` を生成します。\n\n**Kind。** `0` はユーザーメタデータ（名前、自己紹介、画像）、`1` はオリジナルの投稿または返信、`6` はリポストです。引用リポストは `q` タグを付けた kind 1 です。\n\n**タグ。** 文字列の配列です。`[\"blockchain\", chain, contract, tokenId]`（推奨）、返信用の `[\"e\", eventId, relay, marker, pubkey]`（marker は `reply`、`root`、`mention`）、関係する人物を示す `[\"p\", pubkey]`、リンクを示す `[\"r\", url]`、メディアを示す `[\"imeta\", ...]` があります。\n\n**NFT メタデータ。** トークンの `description` は `content` と等しく、すべてのイベントフィールド（`id`、`pubkey`、`created_at`、`kind`、`sig`、`content`、およびタグ）が、`trait_type`/`value` のペアとして `attributes` に現れます。\n\n**オンチェーンイベント。** 投稿がミントされると、コントラクトは `PubEvent(id, pubkey, created_at, kind, content, tags, sig)` を発行します。これにより、インデクサーはメタデータを読まなくても投稿を追跡できます。必須なのは、このイベントとメタデータ形式だけです。\n\n## サンプルコード\n\nミントされた投稿のメタデータ:\n\n```json\n{\n  \"name\": \"Hello from the chain\",\n  \"description\": \"gm, first on-chain post\",\n  \"attributes\": [\n    { \"trait_type\": \"id\", \"value\": \"\u003csha256 of serialized event, hex\u003e\" },\n    { \"trait_type\": \"pubkey\", \"value\": \"\u003c32-byte x-only pubkey, hex\u003e\" },\n    { \"trait_type\": \"created_at\", \"value\": 1735000000 },\n    { \"trait_type\": \"kind\", \"value\": 1 },\n    { \"trait_type\": \"sig\", \"value\": \"\u003c64-byte schnorr signature, hex\u003e\" },\n    { \"trait_type\": \"content\", \"value\": \"gm, first on-chain post\" }\n  ]\n}\n```\n\n必須イベントを発行する最小限のミント関数（ERC-721 ベース）:\n\n```solidity\nevent PubEvent(bytes32 id, bytes32 indexed pubkey, uint256 created_at,\n               uint32 indexed kind, string content, string tags, string sig);\n\nfunction createPost(uint256 tokenId, string calldata uri, bytes32 id, bytes32 pubkey,\n                    uint256 createdAt, uint32 kind, string calldata content,\n                    string calldata tags, string calldata sig) external {\n    _safeMint(msg.sender, tokenId);\n    _setTokenURI(tokenId, uri);\n    emit PubEvent(id, pubkey, createdAt, kind, content, tags, sig);\n}\n```\n\n## 知っておくべきこと\n\n- ステータスは **Draft** です。仕様のイベント定義には、まだ小さな構文エラーがあり、変更される可能性があります。\n- 真正性は、`id` に対する Schnorr 署名から得られるもので、トークンの所有からではありません。検証者は、フィールドから `id` を再計算し、`sig` を `pubkey` に対して確認しなければなりません。\n- 署名鍵には Schnorr/Taproot の公開鍵を使い、通常の Ethereum のアドレス導出は使いません。仕様は、鍵の生成と署名に Nostr のツール（nostr-tools など）を使うことを推奨しています。\n- [ERC-1155](/eip-1155/) では、複数のコピーがミントされても、1 つのトークン ID が 1 つの投稿を表すようにするべきです。\n- 誰でもどのコントラクトでも投稿をミントできるため、アプリは独自のモデレーション、ブロックリスト、レピュテーションを用意する必要があります。\n"},"ko":{"lang":"ko","tldr":"Nostr 방식의 서명된 소셜 게시물을 NFT로 발행하기 위한 초안 형식. 어떤 NFT 컨트랙트, 지갑, 마켓플레이스든 탈중앙 소셜 콘텐츠를 담고 보여 줄 수 있게 한다.","tags":["nft","social","nostr","metadata","erc-721"],"related":[721,1155],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-7847/","markdown":"## 어떤 문제를 해결하나요?\n\n중앙화된 소셜 플랫폼은 게시물을 검열하거나, 순서를 바꾸거나, 삭제할 수 있습니다. 이전의 온체인 소셜 프로젝트는 대개 자기들만의 컨트랙트 묶음에 의존했습니다. ERC-7847은 다른 길을 택합니다. 각 게시물이 작성자의 키로 서명되는 개방형 프로토콜인 **Nostr**의 이벤트 형식을 재사용하고, 그 이벤트를 평범한 NFT로 저장합니다.\n\n게시물은 체인과 무관하게 서명되므로, 어느 컨트랙트가 민팅했는지, 누가 토큰을 소유하는지는 중요하지 않습니다. 이미 NFT를 보여 주는 모든 지갑과 마켓플레이스가 게시물이 나타날 수 있는 장소가 되고, 누구나 이를 인덱싱해 피드를 만들 수 있습니다.\n\n## 어떻게 동작하나요?\n\n**이벤트.** 게시물은 `pubkey`, `created_at`, `kind`, `tags`, `content`를 가집니다. `id`는 다음 JSON 직렬화의 SHA-256입니다(모든 구현이 같은 바이트를 얻도록 엄격한 이스케이프 규칙이 있습니다).\n\n```json\n[0, \"\u003cpubkey hex\u003e\", \u003ccreated_at\u003e, \u003ckind\u003e, \u003ctags\u003e, \"\u003ccontent\u003e\"]\n```\n\n작성자는 secp256k1 위의 Schnorr 서명(Nostr와 같은 BIP-340 방식)으로 `id`에 서명해 `sig`를 만듭니다.\n\n**Kind.** `0`은 사용자 메타데이터(이름, 소개, 사진), `1`은 원본 게시물 또는 답글, `6`은 리포스트입니다. 인용 리포스트는 `q` 태그가 붙은 kind 1입니다.\n\n**태그.** 문자열 배열입니다. `[\"blockchain\", chain, contract, tokenId]`(권장), 답글용 `[\"e\", eventId, relay, marker, pubkey]`(marker는 `reply`, `root`, `mention`), 관련된 사람을 나타내는 `[\"p\", pubkey]`, 링크를 나타내는 `[\"r\", url]`, 미디어를 나타내는 `[\"imeta\", ...]`가 있습니다.\n\n**NFT 메타데이터.** 토큰의 `description`은 `content`와 같고, 모든 이벤트 필드(`id`, `pubkey`, `created_at`, `kind`, `sig`, `content`, 그리고 태그)는 `trait_type`/`value` 쌍으로 `attributes`에 나타납니다.\n\n**온체인 이벤트.** 게시물이 민팅되면 컨트랙트가 `PubEvent(id, pubkey, created_at, kind, content, tags, sig)`를 발생시키므로, 인덱서는 메타데이터를 읽지 않고도 게시물을 따라갈 수 있습니다. 필수인 것은 이 이벤트와 메타데이터 형식뿐입니다.\n\n## 샘플 코드\n\n민팅된 게시물의 메타데이터:\n\n```json\n{\n  \"name\": \"Hello from the chain\",\n  \"description\": \"gm, first on-chain post\",\n  \"attributes\": [\n    { \"trait_type\": \"id\", \"value\": \"\u003csha256 of serialized event, hex\u003e\" },\n    { \"trait_type\": \"pubkey\", \"value\": \"\u003c32-byte x-only pubkey, hex\u003e\" },\n    { \"trait_type\": \"created_at\", \"value\": 1735000000 },\n    { \"trait_type\": \"kind\", \"value\": 1 },\n    { \"trait_type\": \"sig\", \"value\": \"\u003c64-byte schnorr signature, hex\u003e\" },\n    { \"trait_type\": \"content\", \"value\": \"gm, first on-chain post\" }\n  ]\n}\n```\n\n필수 이벤트를 발생시키는 최소한의 민팅 함수(ERC-721 기반):\n\n```solidity\nevent PubEvent(bytes32 id, bytes32 indexed pubkey, uint256 created_at,\n               uint32 indexed kind, string content, string tags, string sig);\n\nfunction createPost(uint256 tokenId, string calldata uri, bytes32 id, bytes32 pubkey,\n                    uint256 createdAt, uint32 kind, string calldata content,\n                    string calldata tags, string calldata sig) external {\n    _safeMint(msg.sender, tokenId);\n    _setTokenURI(tokenId, uri);\n    emit PubEvent(id, pubkey, createdAt, kind, content, tags, sig);\n}\n```\n\n## 알아둘 점\n\n- 상태는 **Draft**입니다. 스펙의 이벤트 정의에는 아직 사소한 문법 오류가 있고 바뀔 수 있습니다.\n- 진위는 `id`에 대한 Schnorr 서명에서 나오며 토큰 소유권에서 나오지 않습니다. 검증자는 필드로부터 `id`를 다시 계산하고 `sig`를 `pubkey`로 확인해야 합니다.\n- 서명 키는 일반적인 이더리움 주소 파생이 아니라 Schnorr/Taproot 공개키를 씁니다. 스펙은 키 생성과 서명에 Nostr 도구(예: nostr-tools)를 쓸 것을 권장합니다.\n- [ERC-1155](/eip-1155/)에서는 여러 개의 사본이 민팅되더라도 토큰 ID 하나가 게시물 하나를 나타내야 합니다.\n- 누구나 어떤 컨트랙트에서든 게시물을 민팅할 수 있으므로, 앱은 자체 모더레이션, 차단 목록, 평판 체계를 갖춰야 합니다.\n"},"zh":{"lang":"zh","tldr":"草案格式：把 Nostr 风格的已签名社交帖子作为 NFT 发布，使任何 NFT 合约、钱包或市场都能承载并展示去中心化的社交内容。","tags":["nft","social","nostr","metadata","erc-721"],"related":[721,1155],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-7847/","markdown":"## 它解决什么问题？\n\n中心化社交平台可以审查、重排或删除帖子。早期的链上社交项目通常依赖各自专用的一套合约。ERC-7847 走了另一条路：复用 **Nostr** 的事件格式（这是一个开放协议，每条帖子都由作者的密钥签名），并把这些事件存储为普通的 NFT。\n\n由于帖子的签名独立于链，铸造它的是哪个合约、谁拥有这个代币，都无关紧要。所有已经展示 NFT 的钱包和市场都成为帖子可以出现的地方，任何人都可以通过索引它们来构建信息流。\n\n## 它如何运作\n\n**事件。** 帖子包含 `pubkey`、`created_at`、`kind`、`tags` 和 `content`。它的 `id` 是下面这种 JSON 序列化的 SHA-256（有严格的转义规则，确保每个实现得到相同的字节）：\n\n```json\n[0, \"\u003cpubkey hex\u003e\", \u003ccreated_at\u003e, \u003ckind\u003e, \u003ctags\u003e, \"\u003ccontent\u003e\"]\n```\n\n作者用 secp256k1 上的 Schnorr 签名（BIP-340 风格，与 Nostr 相同）对 `id` 签名，得到 `sig`。\n\n**Kind。** `0` 为用户元数据（名称、简介、头像），`1` 为原创帖子或回复，`6` 为转发。引用转发是带 `q` 标签的 kind 1。\n\n**标签。** 字符串数组：`[\"blockchain\", chain, contract, tokenId]`（推荐）；用于回复的 `[\"e\", eventId, relay, marker, pubkey]`，marker 取 `reply`、`root` 或 `mention`；表示相关人员的 `[\"p\", pubkey]`；表示链接的 `[\"r\", url]`；以及表示媒体的 `[\"imeta\", ...]`。\n\n**NFT 元数据。** 代币的 `description` 等于 `content`，每个事件字段（`id`、`pubkey`、`created_at`、`kind`、`sig`、`content` 以及标签）都以 `trait_type`/`value` 对的形式出现在 `attributes` 中。\n\n**链上事件。** 铸造帖子时，合约会触发 `PubEvent(id, pubkey, created_at, kind, content, tags, sig)`，这样索引器无需读取元数据就能跟踪帖子。必需的只有这个事件和元数据格式。\n\n## 示例代码\n\n已铸造帖子的元数据：\n\n```json\n{\n  \"name\": \"Hello from the chain\",\n  \"description\": \"gm, first on-chain post\",\n  \"attributes\": [\n    { \"trait_type\": \"id\", \"value\": \"\u003csha256 of serialized event, hex\u003e\" },\n    { \"trait_type\": \"pubkey\", \"value\": \"\u003c32-byte x-only pubkey, hex\u003e\" },\n    { \"trait_type\": \"created_at\", \"value\": 1735000000 },\n    { \"trait_type\": \"kind\", \"value\": 1 },\n    { \"trait_type\": \"sig\", \"value\": \"\u003c64-byte schnorr signature, hex\u003e\" },\n    { \"trait_type\": \"content\", \"value\": \"gm, first on-chain post\" }\n  ]\n}\n```\n\n触发必需事件的最小铸造函数（基于 ERC-721）：\n\n```solidity\nevent PubEvent(bytes32 id, bytes32 indexed pubkey, uint256 created_at,\n               uint32 indexed kind, string content, string tags, string sig);\n\nfunction createPost(uint256 tokenId, string calldata uri, bytes32 id, bytes32 pubkey,\n                    uint256 createdAt, uint32 kind, string calldata content,\n                    string calldata tags, string calldata sig) external {\n    _safeMint(msg.sender, tokenId);\n    _setTokenURI(tokenId, uri);\n    emit PubEvent(id, pubkey, createdAt, kind, content, tags, sig);\n}\n```\n\n## 需要注意\n\n- 状态为 **Draft**；规范中的事件定义仍有小的语法错误，并且可能改变。\n- 真实性来自对 `id` 的 Schnorr 签名，而不是来自代币所有权。验证者必须根据字段重新计算 `id`，并用 `pubkey` 检查 `sig`。\n- 签名密钥使用 Schnorr/Taproot 公钥，而不是通常的以太坊地址推导；规范建议使用 Nostr 工具（如 nostr-tools）来生成密钥和签名。\n- 对于 [ERC-1155](/eip-1155/)，即使铸造了多份副本，一个代币 ID 也应当代表一条帖子。\n- 任何人都可以在任何合约中铸造帖子，因此应用必须自带审核、屏蔽列表或信誉机制。\n"}}}
