{"eip":3722,"title":"Poster","description":"A ridiculously simple general purpose social media smart contract.","authors":["Auryn Macmillan (@auryn-macmillan)"],"status":"Stagnant","type":"Standards Track","category":"ERC","created":"2021-07-31","discussionsTo":"https://ethereum-magicians.org/t/eip-poster-a-ridiculously-simple-general-purpose-social-media-smart-contract/6751","repo":"ERCs","label":"ERC-3722","officialUrl":"https://eips.ethereum.org/EIPS/eip-3722","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-3722.md","url":"https://eips.huatuo.xyz/eip-3722/","tldr":{"en":"A deliberately tiny contract with one function, post(content, tag), that just emits an event, giving decentralized social apps a shared, indexable place to publish posts on any EVM chain.","ja":"`post(content, tag)` という関数を 1 つだけ持ち、イベントを発行するだけの、あえて極小にしたコントラクト。分散型ソーシャルアプリに、あらゆる EVM チェーン上で投稿を公開するための、共有されインデックス化できる場所を提供する。","ko":"이벤트를 발생시키기만 하는 함수 post(content, tag) 하나뿐인 일부러 아주 작게 만든 컨트랙트로, 탈중앙화 소셜 앱이 어떤 EVM 체인에서든 게시글을 올릴 수 있는 공유되고 인덱싱 가능한 장소를 제공한다.","zh":"一个刻意做得极小的合约，只有一个函数 post(content, tag)，仅仅触发一个事件，为去中心化社交应用提供一个共享的、可索引的地方，在任何 EVM 链上发布帖子。"},"tags":["social","events","indexing","singleton"],"explainers":{"en":{"lang":"en","tldr":"A deliberately tiny contract with one function, post(content, tag), that just emits an event, giving decentralized social apps a shared, indexable place to publish posts on any EVM chain.","tags":["social","events","indexing","singleton"],"related":[2470],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-3722/","markdown":"## What problem does it solve?\n\nBuilding a decentralized social network usually means writing a custom contract with its own storage, IDs and rules, and every app ends up incompatible with the others. Poster takes the opposite approach: the chain only records *who said what*, and everything else (threads, likes, follows, edits) is reconstructed off-chain by an indexer.\n\nBecause the contract is trivial and stateless, it can be deployed once per network at the same address and shared by every app that wants to read or write posts.\n\n## How it works\n\nThe entire contract is one function and one event:\n\n```solidity\ncontract Poster {\n    event NewPost(address indexed user, string content, string indexed tag);\n\n    function post(string calldata content, string calldata tag) public {\n        emit NewPost(msg.sender, content, tag);\n    }\n}\n```\n\n- `content` is a free-form string. The spec proposes a JSON format for Twitter-like apps where a single `post()` can carry several items in a `content` array: `microblog` posts (with optional `replyTo`, `image`, `edit`), and operations such as `delete`, `like`, `repost`, `follow`, `unfollow`, `block`, `report` and `permissions`.\n- `tag` is indexed, so an indexer can filter by app or topic. Since it is an indexed `string`, the log stores only its keccak256 hash, not the text.\n- No post ID is emitted. Indexers derive one from `transactionHash` + `logIndex`.\n- The authors chose `string` over `bytes` so posts stay human-readable on block explorers, and chose to emit the content (rather than only calldata) so indexers can rely on logs alone.\n\nThe spec's reference deployment uses the [EIP-2470](/eip-2470/) singleton factory so the contract lands at the same address on any EVM network; the address, init code and salt are listed in the spec.\n\n## Sample code\n\nA JSON payload that posts a two-message thread, and sending it with ethers v6:\n\n```json\n{\n  \"content\": [\n    { \"type\": \"microblog\", \"text\": \"gm, first post in a thread\" },\n    { \"type\": \"microblog\", \"text\": \"second post\", \"replyTo\": \"this[0]\" }\n  ]\n}\n```\n\n```ts\nimport { Contract, Wallet, JsonRpcProvider, id } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst wallet = new Wallet(process.env.PRIVATE_KEY!, provider);\nconst poster = new Contract(\n  process.env.POSTER_ADDRESS!, // the deployment on your network\n  [\n    \"function post(string content, string tag)\",\n    \"event NewPost(address indexed user, string content, string indexed tag)\",\n  ],\n  wallet,\n);\n\nconst payload = JSON.stringify({ content: [{ type: \"microblog\", text: \"hello\" }] });\nawait (await poster.post(payload, \"microblog\")).wait();\n\n// Read posts with a given tag (topic holds keccak256 of the tag string)\nconst logs = await poster.queryFilter(poster.filters.NewPost(null, null, id(\"microblog\")));\nfor (const l of logs) console.log((l as any).args.user, (l as any).args.content);\n```\n\n## Things to know\n\n- Status is **Stagnant**: the proposal is no longer actively progressing toward finalization.\n- All meaning lives off-chain. The contract does not validate JSON, enforce deletes or check permissions; the indexer and client must.\n- If a post's `\"from\"` differs from `msg.sender`, clients should only honor it when `\"from\"` previously granted that sender rights via a `permissions` item; otherwise treat it as invalid or as a post by `msg.sender`.\n- Clients must sanitize post content before rendering it.\n- Everything posted is public and permanent in the chain's logs; a `delete` only asks indexers to hide it.\n"},"ja":{"lang":"ja","tldr":"`post(content, tag)` という関数を 1 つだけ持ち、イベントを発行するだけの、あえて極小にしたコントラクト。分散型ソーシャルアプリに、あらゆる EVM チェーン上で投稿を公開するための、共有されインデックス化できる場所を提供する。","tags":["social","events","indexing","singleton"],"related":[2470],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-3722/","markdown":"## 何を解決するのか\n\n分散型ソーシャルネットワークを作るには、通常、独自のストレージ、ID、ルールを持つカスタムコントラクトを書くことになり、どのアプリも他のアプリと互換性がなくなります。Poster は逆のアプローチを取ります。チェーンは*誰が何を言ったか*だけを記録し、それ以外のすべて（スレッド、いいね、フォロー、編集）は、インデクサーがオフチェーンで再構成します。\n\nコントラクトは単純でステートレスなので、ネットワークごとに同じアドレスへ一度だけデプロイでき、投稿を読み書きしたいすべてのアプリで共有できます。\n\n## 仕組み\n\nコントラクト全体は、1 つの関数と 1 つのイベントだけです。\n\n```solidity\ncontract Poster {\n    event NewPost(address indexed user, string content, string indexed tag);\n\n    function post(string calldata content, string calldata tag) public {\n        emit NewPost(msg.sender, content, tag);\n    }\n}\n```\n\n- `content` は自由形式の文字列です。仕様は、Twitter 風のアプリ向けに JSON 形式を提案しており、1 回の `post()` で `content` 配列に複数のアイテムを載せられます。`microblog` 投稿（任意で `replyTo`、`image`、`edit`）や、`delete`、`like`、`repost`、`follow`、`unfollow`、`block`、`report`、`permissions` などの操作です。\n- `tag` はインデックス付きなので、インデクサーはアプリやトピックで絞り込めます。インデックス付きの `string` であるため、ログにはテキストそのものではなく keccak256 ハッシュだけが保存されます。\n- 投稿 ID は発行されません。インデクサーは `transactionHash` + `logIndex` から ID を導出します。\n- 作者は、ブロックエクスプローラーで投稿が人間に読めるままになるよう、`bytes` ではなく `string` を選びました。また、インデクサーがログだけに頼れるよう、（calldata だけでなく）content をイベントとして発行することを選びました。\n\n仕様のリファレンスデプロイは [EIP-2470](/eip-2470/) のシングルトンファクトリーを使い、どの EVM ネットワークでもコントラクトが同じアドレスになるようにしています。アドレス、init コード、ソルトは仕様に記載されています。\n\n## サンプルコード\n\n2 つのメッセージからなるスレッドを投稿する JSON ペイロードと、ethers v6 での送信例:\n\n```json\n{\n  \"content\": [\n    { \"type\": \"microblog\", \"text\": \"gm, first post in a thread\" },\n    { \"type\": \"microblog\", \"text\": \"second post\", \"replyTo\": \"this[0]\" }\n  ]\n}\n```\n\n```ts\nimport { Contract, Wallet, JsonRpcProvider, id } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst wallet = new Wallet(process.env.PRIVATE_KEY!, provider);\nconst poster = new Contract(\n  process.env.POSTER_ADDRESS!, // the deployment on your network\n  [\n    \"function post(string content, string tag)\",\n    \"event NewPost(address indexed user, string content, string indexed tag)\",\n  ],\n  wallet,\n);\n\nconst payload = JSON.stringify({ content: [{ type: \"microblog\", text: \"hello\" }] });\nawait (await poster.post(payload, \"microblog\")).wait();\n\n// Read posts with a given tag (topic holds keccak256 of the tag string)\nconst logs = await poster.queryFilter(poster.filters.NewPost(null, null, id(\"microblog\")));\nfor (const l of logs) console.log((l as any).args.user, (l as any).args.content);\n```\n\n## 知っておくべきこと\n\n- ステータスは **Stagnant** です。この提案は、もはや確定に向けて積極的に進んではいません。\n- 意味はすべてオフチェーンにあります。コントラクトは JSON を検証せず、削除を強制せず、権限も確認しません。それらはインデクサーとクライアントが行う必要があります。\n- 投稿の `\"from\"` が `msg.sender` と異なる場合、クライアントは、`\"from\"` が以前に `permissions` アイテムでその送信者に権限を付与していた場合にのみそれを尊重すべきです。そうでなければ無効とするか、`msg.sender` による投稿として扱います。\n- クライアントは、投稿内容を表示する前にサニタイズしなければなりません。\n- 投稿したものはすべて公開され、チェーンのログに永久に残ります。`delete` は、インデクサーに非表示にするよう依頼するだけです。\n"},"ko":{"lang":"ko","tldr":"이벤트를 발생시키기만 하는 함수 post(content, tag) 하나뿐인 일부러 아주 작게 만든 컨트랙트로, 탈중앙화 소셜 앱이 어떤 EVM 체인에서든 게시글을 올릴 수 있는 공유되고 인덱싱 가능한 장소를 제공한다.","tags":["social","events","indexing","singleton"],"related":[2470],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-3722/","markdown":"## 어떤 문제를 해결하나요?\n\n탈중앙화 소셜 네트워크를 만들려면 보통 자체 스토리지, ID, 규칙을 가진 맞춤 컨트랙트를 작성하게 되고, 결국 모든 앱이 서로 호환되지 않습니다. Poster는 반대로 접근합니다. 체인에는 *누가 무엇을 말했는지*만 기록하고, 나머지(스레드, 좋아요, 팔로우, 수정)는 모두 인덱서가 오프체인에서 재구성합니다.\n\n컨트랙트가 단순하고 상태가 없으므로, 네트워크마다 같은 주소에 한 번만 배포하여 게시글을 읽고 쓰려는 모든 앱이 함께 쓸 수 있습니다.\n\n## 어떻게 동작하나요?\n\n컨트랙트 전체가 함수 하나와 이벤트 하나입니다.\n\n```solidity\ncontract Poster {\n    event NewPost(address indexed user, string content, string indexed tag);\n\n    function post(string calldata content, string calldata tag) public {\n        emit NewPost(msg.sender, content, tag);\n    }\n}\n```\n\n- `content`는 자유 형식 문자열입니다. 명세는 트위터와 비슷한 앱을 위한 JSON 형식을 제안하는데, `post()` 한 번에 `content` 배열로 여러 항목을 담을 수 있습니다. `microblog` 게시글(선택적으로 `replyTo`, `image`, `edit`)과 `delete`, `like`, `repost`, `follow`, `unfollow`, `block`, `report`, `permissions` 같은 작업입니다.\n- `tag`는 인덱싱되므로 인덱서가 앱이나 주제별로 거를 수 있습니다. 인덱싱된 `string`이므로 로그에는 텍스트가 아니라 keccak256 해시만 저장됩니다.\n- 게시글 ID는 발생시키지 않습니다. 인덱서는 `transactionHash` + `logIndex`로 ID를 만듭니다.\n- 저자들은 블록 탐색기에서 게시글을 사람이 읽을 수 있도록 `bytes` 대신 `string`을 택했고, 인덱서가 로그만으로 충분하도록 (calldata만이 아니라) content를 이벤트로 발생시키기로 했습니다.\n\n명세의 참조 배포는 [EIP-2470](/eip-2470/) 싱글턴 팩토리를 사용해 컨트랙트가 어떤 EVM 네트워크에서든 같은 주소에 놓이게 합니다. 주소, init 코드, salt는 명세에 나와 있습니다.\n\n## 샘플 코드\n\n두 개의 메시지로 된 스레드를 게시하는 JSON 페이로드와, ethers v6로 이를 전송하는 예:\n\n```json\n{\n  \"content\": [\n    { \"type\": \"microblog\", \"text\": \"gm, first post in a thread\" },\n    { \"type\": \"microblog\", \"text\": \"second post\", \"replyTo\": \"this[0]\" }\n  ]\n}\n```\n\n```ts\nimport { Contract, Wallet, JsonRpcProvider, id } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst wallet = new Wallet(process.env.PRIVATE_KEY!, provider);\nconst poster = new Contract(\n  process.env.POSTER_ADDRESS!, // the deployment on your network\n  [\n    \"function post(string content, string tag)\",\n    \"event NewPost(address indexed user, string content, string indexed tag)\",\n  ],\n  wallet,\n);\n\nconst payload = JSON.stringify({ content: [{ type: \"microblog\", text: \"hello\" }] });\nawait (await poster.post(payload, \"microblog\")).wait();\n\n// Read posts with a given tag (topic holds keccak256 of the tag string)\nconst logs = await poster.queryFilter(poster.filters.NewPost(null, null, id(\"microblog\")));\nfor (const l of logs) console.log((l as any).args.user, (l as any).args.content);\n```\n\n## 알아둘 점\n\n- 상태는 **Stagnant**입니다. 이 제안은 더 이상 확정을 향해 적극적으로 진행되고 있지 않습니다.\n- 모든 의미는 오프체인에 있습니다. 컨트랙트는 JSON을 검증하지 않고, 삭제를 강제하지 않으며, 권한을 확인하지도 않습니다. 이는 인덱서와 클라이언트가 해야 합니다.\n- 게시글의 `\"from\"`이 `msg.sender`와 다르면, 클라이언트는 `\"from\"`이 이전에 `permissions` 항목으로 그 발신자에게 권한을 부여한 경우에만 이를 인정해야 합니다. 그렇지 않으면 무효로 보거나 `msg.sender`의 게시글로 취급합니다.\n- 클라이언트는 게시글 내용을 렌더링하기 전에 반드시 정화(sanitize)해야 합니다.\n- 게시한 모든 것은 공개되며 체인의 로그에 영구히 남습니다. `delete`는 인덱서에게 숨겨 달라고 요청할 뿐입니다.\n"},"zh":{"lang":"zh","tldr":"一个刻意做得极小的合约，只有一个函数 post(content, tag)，仅仅触发一个事件，为去中心化社交应用提供一个共享的、可索引的地方，在任何 EVM 链上发布帖子。","tags":["social","events","indexing","singleton"],"related":[2470],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-3722/","markdown":"## 它解决什么问题？\n\n构建去中心化社交网络通常意味着编写一个带有自己的存储、ID 和规则的定制合约，结果每个应用都互不兼容。Poster 采取相反的做法：链上只记录*谁说了什么*，其余一切（讨论串、点赞、关注、编辑）都由索引器在链下重建。\n\n由于该合约非常简单且无状态，可以在每个网络上以相同地址只部署一次，并由所有想读写帖子的应用共享。\n\n## 它如何运作\n\n整个合约只有一个函数和一个事件：\n\n```solidity\ncontract Poster {\n    event NewPost(address indexed user, string content, string indexed tag);\n\n    function post(string calldata content, string calldata tag) public {\n        emit NewPost(msg.sender, content, tag);\n    }\n}\n```\n\n- `content` 是一个自由格式的字符串。规范为类似 Twitter 的应用提出了一种 JSON 格式，一次 `post()` 可以在 `content` 数组中携带多个条目：`microblog` 帖子（可选 `replyTo`、`image`、`edit`），以及 `delete`、`like`、`repost`、`follow`、`unfollow`、`block`、`report` 和 `permissions` 等操作。\n- `tag` 是带索引的，因此索引器可以按应用或话题过滤。由于它是带索引的 `string`，日志里只存储它的 keccak256 哈希，而不是文本本身。\n- 不会触发帖子 ID。索引器从 `transactionHash` + `logIndex` 推导出一个。\n- 作者选择 `string` 而不是 `bytes`，使帖子在区块浏览器上仍可供人阅读；并选择把内容通过事件触发出来（而不是只放在 calldata 中），这样索引器只靠日志就够了。\n\n规范的参考部署使用 [EIP-2470](/eip-2470/) 的单例工厂，使该合约在任何 EVM 网络上都落在相同地址；地址、初始化代码和 salt 都列在规范中。\n\n## 示例代码\n\n一份发布两条消息讨论串的 JSON 载荷，以及用 ethers v6 发送它：\n\n```json\n{\n  \"content\": [\n    { \"type\": \"microblog\", \"text\": \"gm, first post in a thread\" },\n    { \"type\": \"microblog\", \"text\": \"second post\", \"replyTo\": \"this[0]\" }\n  ]\n}\n```\n\n```ts\nimport { Contract, Wallet, JsonRpcProvider, id } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst wallet = new Wallet(process.env.PRIVATE_KEY!, provider);\nconst poster = new Contract(\n  process.env.POSTER_ADDRESS!, // the deployment on your network\n  [\n    \"function post(string content, string tag)\",\n    \"event NewPost(address indexed user, string content, string indexed tag)\",\n  ],\n  wallet,\n);\n\nconst payload = JSON.stringify({ content: [{ type: \"microblog\", text: \"hello\" }] });\nawait (await poster.post(payload, \"microblog\")).wait();\n\n// Read posts with a given tag (topic holds keccak256 of the tag string)\nconst logs = await poster.queryFilter(poster.filters.NewPost(null, null, id(\"microblog\")));\nfor (const l of logs) console.log((l as any).args.user, (l as any).args.content);\n```\n\n## 需要注意\n\n- 状态为 **Stagnant**：该提案已不再积极推进到最终确定。\n- 所有含义都在链下。合约不校验 JSON，不强制执行删除，也不检查权限；这些必须由索引器和客户端来做。\n- 如果帖子中的 `\"from\"` 与 `msg.sender` 不同，客户端只有在 `\"from\"` 此前通过 `permissions` 条目授予了该发送者权限时才应认可它；否则应视为无效，或视为 `msg.sender` 发的帖子。\n- 客户端在渲染帖子内容之前必须对其进行清理（sanitize）。\n- 发布的所有内容都是公开的，并永久保存在链的日志中；`delete` 只是请求索引器把它隐藏起来。\n"}}}
