{"eip":4341,"title":"Ordered NFT Batch Standard","description":"The ordering information of multiple NFTs is retained and managed","authors":["Simon Tian (@simontianx)"],"status":"Stagnant","type":"Standards Track","category":"ERC","created":"2021-10-01","discussionsTo":"https://github.com/ethereum/EIPs/issues/3782","repo":"ERCs","label":"ERC-4341","officialUrl":"https://eips.ethereum.org/EIPS/eip-4341","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-4341.md","url":"https://eips.huatuo.xyz/eip-4341/","tldr":{"en":"A multi-token interface that keeps the order of a batch of NFTs, so a sequence of tokens whose IDs encode Unicode characters can be sent and read back as a phrase.","ja":"NFT のバッチの順序を保持するマルチトークンインターフェース。ID が Unicode 文字をエンコードするトークンの並びを、フレーズとして送信し、読み戻せる。","ko":"NFT 묶음의 순서를 보존하는 멀티 토큰 인터페이스. ID가 유니코드 문자를 인코딩하는 토큰의 나열을 구(phrase)로 보내고 다시 읽어낼 수 있다.","zh":"一个保留一批 NFT 顺序的多代币接口，使 ID 编码 Unicode 字符的一串代币可以作为短语被发送并按序读回。"},"tags":["nft","multi-token","unicode","batch"],"explainers":{"en":{"lang":"en","tldr":"A multi-token interface that keeps the order of a batch of NFTs, so a sequence of tokens whose IDs encode Unicode characters can be sent and read back as a phrase.","tags":["nft","multi-token","unicode","batch"],"related":[3754,1155,721],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-4341/","markdown":"## What problem does it solve?\n\n[ERC-1155](/eip-1155/) batch transfers move a set of token IDs and amounts, but once the tokens land in a wallet the order in which they arrived is lost. For collectibles that is fine.\n\nERC-4341 targets a different use: tokens whose `tokenId` is a Unicode code point, such as a Chinese character or an emoji. In logographic languages a few characters carry a whole word or saying, and the order matters. The spec's example: IDs `38271` and `22478` decode to 长城 (\"Great Wall\"), while the reverse order decodes to 城长, a different word. The standard adds a way to send such a sequence and later retrieve it in the original order.\n\n## How it works\n\nThe interface looks like ERC-1155 (`safeTransferFrom`, `safeBatchTransferFrom`, `balanceOf`, `balanceOfBatch`, `setApprovalForAll`) plus three phrase functions:\n\n| Function | Purpose |\n| --- | --- |\n| `safePhraseTransferFrom(from, to, phrase, data)` | Transfer an ordered array of token IDs as one phrase |\n| `balanceOfPhrase(owner)` | How many phrases an address has received |\n| `retrievePhrase(owner, phraseId)` | Return the ordered ID array of one phrase |\n\nA **phrase** is stored as an array of unsigned integers in contract storage. It is a record of order only: creating it does not change any token balance, and a phrase itself cannot be transferred. Anyone can read it back and decode the IDs to characters.\n\nThe design builds on [ERC-3754](/eip-3754/), which treats NFTs as plain units that can carry abstract meaning.\n\n## Sample code\n\nDecoding a retrieved phrase into text (ethers v6):\n\n```ts\nimport { Contract, JsonRpcProvider } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst abi = [\n  \"function balanceOfPhrase(address owner) view returns (uint256)\",\n  \"function retrievePhrase(address owner, uint256 phraseId) view returns (uint256[])\",\n];\nconst token = new Contract(process.env.TOKEN_ADDRESS!, abi, provider);\n\nconst owner = \"0xYourAddress\";\nconst count: bigint = await token.balanceOfPhrase(owner);\nfor (let i = 0n; i \u003c count; i++) {\n  const ids: bigint[] = await token.retrievePhrase(owner, i);\n  const text = String.fromCodePoint(...ids.map(Number));\n  console.log(i, text); // e.g. \"长城\" for [38271, 22478]\n}\n```\n\nThe phrase ID scheme (here assumed to be a 0-based index) is not fixed by the spec; check the implementation you are using.\n\n## Things to know\n\n- Status is **Stagnant**: the proposal has not advanced and has little adoption.\n- Storing phrases costs extra storage compared with plain ERC-1155.\n- The spec itself notes the idea suits logographic scripts and emojis; for alphabetic languages one token per letter is impractical.\n- The spec does not define how phrase IDs are assigned or whether a sender must hold all tokens in the phrase; those details live in the reference implementation.\n"},"ja":{"lang":"ja","tldr":"NFT のバッチの順序を保持するマルチトークンインターフェース。ID が Unicode 文字をエンコードするトークンの並びを、フレーズとして送信し、読み戻せる。","tags":["nft","multi-token","unicode","batch"],"related":[3754,1155,721],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-4341/","markdown":"## 何を解決するのか\n\n[ERC-1155](/eip-1155/) のバッチ転送はトークン ID と数量の集合を移動しますが、トークンがウォレットに届いた時点で、到着した順序は失われます。コレクティブルであれば、それで問題ありません。\n\nERC-4341 は別の用途を対象としています。`tokenId` が Unicode のコードポイント（漢字や絵文字など）であるトークンです。表語文字を使う言語では、少数の文字が 1 つの単語や言い回しを表し、順序が重要です。仕様の例では、ID `38271` と `22478` は 长城（「万里の長城」）にデコードされますが、逆の順序では 城长 という別の語にデコードされます。この標準は、そのような並びを送信し、あとで元の順序で取り出す方法を追加します。\n\n## 仕組み\n\nインターフェースは ERC-1155（`safeTransferFrom`、`safeBatchTransferFrom`、`balanceOf`、`balanceOfBatch`、`setApprovalForAll`）に似ており、そこに 3 つのフレーズ用関数が加わります。\n\n| 関数 | 役割 |\n| --- | --- |\n| `safePhraseTransferFrom(from, to, phrase, data)` | 順序付きのトークン ID の配列を 1 つのフレーズとして転送する |\n| `balanceOfPhrase(owner)` | アドレスが受け取ったフレーズの数 |\n| `retrievePhrase(owner, phraseId)` | 1 つのフレーズの、順序付きの ID 配列を返す |\n\n**フレーズ**は、コントラクトのストレージに符号なし整数の配列として保存されます。これは順序だけの記録です。作成してもトークン残高は変わらず、フレーズ自体を転送することはできません。誰でもそれを読み戻し、ID を文字にデコードできます。\n\nこの設計は、NFT を抽象的な意味を持たせられる単純な単位として扱う [ERC-3754](/eip-3754/) を土台にしています。\n\n## サンプルコード\n\n取得したフレーズをテキストにデコードする（ethers v6）:\n\n```ts\nimport { Contract, JsonRpcProvider } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst abi = [\n  \"function balanceOfPhrase(address owner) view returns (uint256)\",\n  \"function retrievePhrase(address owner, uint256 phraseId) view returns (uint256[])\",\n];\nconst token = new Contract(process.env.TOKEN_ADDRESS!, abi, provider);\n\nconst owner = \"0xYourAddress\";\nconst count: bigint = await token.balanceOfPhrase(owner);\nfor (let i = 0n; i \u003c count; i++) {\n  const ids: bigint[] = await token.retrievePhrase(owner, i);\n  const text = String.fromCodePoint(...ids.map(Number));\n  console.log(i, text); // e.g. \"长城\" for [38271, 22478]\n}\n```\n\nフレーズ ID の体系（ここでは 0 始まりのインデックスと仮定）は仕様では固定されていません。使用する実装を確認してください。\n\n## 知っておくべきこと\n\n- ステータスは **Stagnant** です。提案は進んでおらず、採用もほとんどありません。\n- フレーズの保存には、素の ERC-1155 と比べて追加のストレージが必要です。\n- 仕様自体が、このアイデアは表語文字や絵文字に向いていると述べています。アルファベットの言語では、1 文字につき 1 トークンというのは現実的ではありません。\n- 仕様は、フレーズ ID の割り当て方法や、送信者がフレーズ内のすべてのトークンを保有している必要があるかどうかを定義していません。それらの詳細はリファレンス実装にあります。\n"},"ko":{"lang":"ko","tldr":"NFT 묶음의 순서를 보존하는 멀티 토큰 인터페이스. ID가 유니코드 문자를 인코딩하는 토큰의 나열을 구(phrase)로 보내고 다시 읽어낼 수 있다.","tags":["nft","multi-token","unicode","batch"],"related":[3754,1155,721],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-4341/","markdown":"## 어떤 문제를 해결하나요?\n\n[ERC-1155](/eip-1155/) 배치 전송은 토큰 ID와 수량의 집합을 옮기지만, 토큰이 지갑에 도착하고 나면 도착한 순서는 사라집니다. 수집품에는 문제가 되지 않습니다.\n\nERC-4341은 다른 용도를 겨냥합니다. `tokenId`가 한자나 이모지 같은 유니코드 코드 포인트인 토큰입니다. 표의 문자 언어에서는 몇 글자가 한 단어나 한 문장을 담고 있으며 순서가 중요합니다. 명세의 예시에서 ID `38271`과 `22478`은 长城(\"만리장성\")으로 디코딩되지만, 반대 순서는 城长이라는 다른 단어로 디코딩됩니다. 이 표준은 그런 나열을 보내고 나중에 원래 순서대로 가져오는 방법을 추가합니다.\n\n## 어떻게 동작하나요?\n\n인터페이스는 ERC-1155(`safeTransferFrom`, `safeBatchTransferFrom`, `balanceOf`, `balanceOfBatch`, `setApprovalForAll`)와 비슷하고, 여기에 구(phrase)용 함수 세 개가 더해집니다.\n\n| 함수 | 역할 |\n| --- | --- |\n| `safePhraseTransferFrom(from, to, phrase, data)` | 순서 있는 토큰 ID 배열을 하나의 구로 전송 |\n| `balanceOfPhrase(owner)` | 주소가 받은 구의 수 |\n| `retrievePhrase(owner, phraseId)` | 한 구의 순서 있는 ID 배열을 반환 |\n\n**구**는 컨트랙트 스토리지에 부호 없는 정수 배열로 저장됩니다. 순서만 기록한 것입니다. 구를 만든다고 토큰 잔액이 바뀌지 않으며 구 자체를 전송할 수도 없습니다. 누구나 그것을 읽어서 ID를 문자로 디코딩할 수 있습니다.\n\n이 설계는 NFT를 추상적 의미를 담을 수 있는 단순한 단위로 다루는 [ERC-3754](/eip-3754/)를 바탕으로 합니다.\n\n## 샘플 코드\n\n가져온 구를 텍스트로 디코딩하기(ethers v6):\n\n```ts\nimport { Contract, JsonRpcProvider } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst abi = [\n  \"function balanceOfPhrase(address owner) view returns (uint256)\",\n  \"function retrievePhrase(address owner, uint256 phraseId) view returns (uint256[])\",\n];\nconst token = new Contract(process.env.TOKEN_ADDRESS!, abi, provider);\n\nconst owner = \"0xYourAddress\";\nconst count: bigint = await token.balanceOfPhrase(owner);\nfor (let i = 0n; i \u003c count; i++) {\n  const ids: bigint[] = await token.retrievePhrase(owner, i);\n  const text = String.fromCodePoint(...ids.map(Number));\n  console.log(i, text); // e.g. \"长城\" for [38271, 22478]\n}\n```\n\n구 ID 체계(여기서는 0부터 시작하는 인덱스로 가정)는 명세에서 고정하지 않습니다. 사용하는 구현을 확인하세요.\n\n## 알아둘 점\n\n- 상태는 **Stagnant**입니다. 제안은 진전이 없었고 채택도 거의 없습니다.\n- 구를 저장하려면 일반 ERC-1155보다 추가 스토리지 비용이 듭니다.\n- 명세 자체가 이 아이디어는 표의 문자와 이모지에 어울린다고 밝힙니다. 알파벳 언어에서는 글자마다 토큰 하나를 쓰는 것이 비현실적입니다.\n- 명세는 구 ID가 어떻게 할당되는지, 발신자가 구에 포함된 모든 토큰을 보유해야 하는지를 정의하지 않습니다. 그런 세부 사항은 레퍼런스 구현에 있습니다.\n"},"zh":{"lang":"zh","tldr":"一个保留一批 NFT 顺序的多代币接口，使 ID 编码 Unicode 字符的一串代币可以作为短语被发送并按序读回。","tags":["nft","multi-token","unicode","batch"],"related":[3754,1155,721],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-4341/","markdown":"## 它解决什么问题？\n\n[ERC-1155](/eip-1155/) 的批量转账移动的是一组代币 ID 和数量，但代币一旦到达钱包，它们到达的顺序就丢失了。对收藏品来说，这没有问题。\n\nERC-4341 针对的是另一种用途：`tokenId` 是 Unicode 码点的代币，例如一个汉字或一个 emoji。在表意文字的语言中，几个字就能承载一个词或一句话，而顺序很重要。规范中的例子：ID `38271` 和 `22478` 解码为 长城（\"Great Wall\"），而相反的顺序解码为 城长，是另一个词。该标准增加了一种发送这类序列、并在之后按原始顺序取回的方法。\n\n## 它如何运作\n\n接口类似 ERC-1155（`safeTransferFrom`、`safeBatchTransferFrom`、`balanceOf`、`balanceOfBatch`、`setApprovalForAll`），外加三个短语函数：\n\n| 函数 | 用途 |\n| --- | --- |\n| `safePhraseTransferFrom(from, to, phrase, data)` | 把一个有序的代币 ID 数组作为一个短语转移 |\n| `balanceOfPhrase(owner)` | 某个地址收到了多少个短语 |\n| `retrievePhrase(owner, phraseId)` | 返回某个短语的有序 ID 数组 |\n\n**短语**以无符号整数数组的形式存储在合约存储中。它只是顺序的记录：创建它不会改变任何代币余额，短语本身也不能被转移。任何人都可以把它读回，并把 ID 解码为字符。\n\n该设计建立在 [ERC-3754](/eip-3754/) 之上，后者把 NFT 视为可以承载抽象含义的普通单位。\n\n## 示例代码\n\n把取回的短语解码为文本（ethers v6）：\n\n```ts\nimport { Contract, JsonRpcProvider } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst abi = [\n  \"function balanceOfPhrase(address owner) view returns (uint256)\",\n  \"function retrievePhrase(address owner, uint256 phraseId) view returns (uint256[])\",\n];\nconst token = new Contract(process.env.TOKEN_ADDRESS!, abi, provider);\n\nconst owner = \"0xYourAddress\";\nconst count: bigint = await token.balanceOfPhrase(owner);\nfor (let i = 0n; i \u003c count; i++) {\n  const ids: bigint[] = await token.retrievePhrase(owner, i);\n  const text = String.fromCodePoint(...ids.map(Number));\n  console.log(i, text); // e.g. \"长城\" for [38271, 22478]\n}\n```\n\n短语 ID 的方案（这里假定为从 0 开始的索引）并未由规范固定；请查看你所使用的实现。\n\n## 需要注意\n\n- 状态为 **Stagnant**：该提案没有推进，采用程度很低。\n- 与普通 ERC-1155 相比，存储短语需要额外的存储空间。\n- 规范本身指出，这个想法适合表意文字和 emoji；对于字母语言，每个字母一个代币并不现实。\n- 规范没有定义短语 ID 如何分配，也没有定义发送者是否必须持有短语中的所有代币；这些细节在参考实现中。\n"}}}
