{"eip":6960,"title":"Dual Layer Token","description":"Token with a two-level classification system using mainId and subId","authors":["Adam Boudjemaa (@aboudjem)","Mohamad Hammoud (@mohamadhammoud)","Nawar Hisso (@nawar-hisso)","Khawla Hassan (@khawlahssn)","Mohammad Zakeri Rad (@zakrad)","Ashish Sood \u003csoodgen@gmail.com\u003e"],"status":"Draft","type":"Standards Track","category":"ERC","created":"2023-04-30","discussionsTo":"https://ethereum-magicians.org/t/eip-6960-dual-layer-token/14070","repo":"ERCs","label":"ERC-6960","officialUrl":"https://eips.ethereum.org/EIPS/eip-6960","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-6960.md","url":"https://eips.huatuo.xyz/eip-6960/","tldr":{"en":"Draft multi-token standard where every balance is addressed by a mainId (asset) and a subId (its variant or fraction), aimed at tokenizing real-world assets like invoices or property.","ja":"すべての残高を mainId（資産）と subId（そのバリエーションや持分）で指定するマルチトークン標準のドラフト。請求書や不動産などの現実資産のトークン化を狙う。","ko":"모든 잔액을 mainId(자산)와 subId(그 변형이나 지분)로 지정하는 멀티 토큰 표준 초안. 청구서나 부동산 같은 실물 자산의 토큰화를 목표로 한다.","zh":"多代币标准草案，每个余额都由 mainId（资产）和 subId（其变体或份额）共同定位，目标是将发票、房产等现实世界资产代币化。"},"tags":["token","multi-token","rwa","fractional","standard"],"explainers":{"en":{"lang":"en","tldr":"Draft multi-token standard where every balance is addressed by a mainId (asset) and a subId (its variant or fraction), aimed at tokenizing real-world assets like invoices or property.","tags":["token","multi-token","rwa","fractional","standard"],"related":[1155,20,721,3525],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-6960/","markdown":"## What problem does it solve?\n\n[ERC-1155](/eip-1155/) lets one contract hold many token types, each with a single `id`. Real-world assets often need a second level: one invoice, building or share class (the asset) split into many pieces with their own attributes (the sub-assets). Encoding both into one `id` works, but makes balances, approvals and tracking awkward.\n\nERC-6960, the **Dual Layer Token (DLT)**, makes this explicit: every token is identified by a pair `(mainId, subId)`. The authors target fractional ownership of invoices, company stock, collectibles and real estate.\n\n## How it works\n\n- **`mainId`** names the main asset type; **`subId`** names a variation, tranche or fraction within it.\n- Balances are per `(account, mainId, subId)`: `subBalanceOf(account, mainId, subId)` and the batch form `balanceOfBatch(accounts, mainIds, subIds)`.\n- Approvals come in two forms:\n  - `approve(operator, mainId, subId, amount)` with `allowance(owner, operator, mainId, subId)`, an ERC-20-style allowance on one sub-token.\n  - `setApprovalForAll(operator, approved)`: full operator rights over everything.\n- Transfers use `safeTransferFrom(sender, recipient, mainId, subId, amount, data)`. It must revert on zero addresses or insufficient balance and emits `Transfer(sender, recipient, mainId, subId, amount)`.\n- A contract recipient must implement `IDLTReceiver` (`onDLTReceived`, `onDLTBatchReceived`) and return the function selector, like ERC-1155 receivers.\n- `URI(oldValue, newValue, mainId)` is emitted when metadata for a main asset changes.\n\nThe design can share one set of subIds across all mainIds, or give each mainId its own. Deeper hierarchies were deliberately rejected to keep supply tracking simple. It is a standalone interface, not an extension of ERC-1155.\n\n## Sample code\n\nReceiving DLT tokens in a contract and reading a balance:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ninterface IDLT {\n    function subBalanceOf(address account, uint256 mainId, uint256 subId) external view returns (uint256);\n}\n\ninterface IDLTReceiver {\n    function onDLTReceived(address, address, uint256, uint256, uint256, bytes calldata) external returns (bytes4);\n    function onDLTBatchReceived(address, address, uint256[] calldata, uint256[] calldata, uint256[] calldata, bytes calldata)\n        external returns (bytes4);\n}\n\ncontract InvoiceVault is IDLTReceiver {\n    IDLT public immutable dlt;\n    constructor(IDLT d) { dlt = d; }\n\n    function onDLTReceived(address, address, uint256, uint256, uint256, bytes calldata)\n        external pure returns (bytes4) { return IDLTReceiver.onDLTReceived.selector; }\n\n    function onDLTBatchReceived(address, address, uint256[] calldata, uint256[] calldata, uint256[] calldata, bytes calldata)\n        external pure returns (bytes4) { return IDLTReceiver.onDLTBatchReceived.selector; }\n\n    /// e.g. mainId = invoice #42, subId = the 30-day tranche\n    function held(uint256 mainId, uint256 subId) external view returns (uint256) {\n        return dlt.subBalanceOf(address(this), mainId, subId);\n    }\n}\n```\n\n## Things to know\n\n- Status is **Draft**: names and signatures may still change.\n- Not compatible with ERC-1155 tooling; wallets and marketplaces need DLT-specific support.\n- The per-sub-token allowance has the same approve/transferFrom race condition as [ERC-20](/eip-20/); prefer increase/decrease helpers or reset to zero first.\n- Batch operations loop over caller-supplied arrays and can run out of gas if they are too long.\n- Summing many sub-balances into a main-asset total can overflow; the reference implementation tracks main balances separately.\n- For a related \"slot plus value\" model, see [ERC-3525](/eip-3525/).\n"},"ja":{"lang":"ja","tldr":"すべての残高を mainId（資産）と subId（そのバリエーションや持分）で指定するマルチトークン標準のドラフト。請求書や不動産などの現実資産のトークン化を狙う。","tags":["token","multi-token","rwa","fractional","standard"],"related":[1155,20,721,3525],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-6960/","markdown":"## 何を解決するのか\n\n[ERC-1155](/eip-1155/) では 1 つのコントラクトで多数のトークン種別を扱えますが、それぞれ `id` は 1 つだけです。現実の資産では、2 段階目が必要になることがよくあります。1 枚の請求書、1 棟の建物、1 つの株式クラス（資産）が、それぞれ固有の属性を持つ多数の小片（サブ資産）に分割されるケースです。両方を 1 つの `id` にエンコードすることもできますが、残高、承認、追跡が扱いにくくなります。\n\nERC-6960 の **Dual Layer Token（DLT）** はこれを明示的にします。すべてのトークンは `(mainId, subId)` のペアで識別されます。作者たちは、請求書、会社の株式、コレクティブル、不動産の分割所有を想定しています。\n\n## 仕組み\n\n- **`mainId`** はメインの資産種別を表し、**`subId`** はその中のバリエーション、トランシェ、持分を表します。\n- 残高は `(account, mainId, subId)` ごとに管理されます。`subBalanceOf(account, mainId, subId)` と、バッチ形式の `balanceOfBatch(accounts, mainIds, subIds)` があります。\n- 承認には 2 つの形式があります。\n  - `approve(operator, mainId, subId, amount)` と `allowance(owner, operator, mainId, subId)`。1 つのサブトークンに対する ERC-20 風の allowance です。\n  - `setApprovalForAll(operator, approved)`: すべてに対する完全なオペレーター権限。\n- 送金には `safeTransferFrom(sender, recipient, mainId, subId, amount, data)` を使います。ゼロアドレスや残高不足の場合は revert しなければならず、`Transfer(sender, recipient, mainId, subId, amount)` を emit します。\n- 受け取り側がコントラクトの場合は `IDLTReceiver`（`onDLTReceived`、`onDLTBatchReceived`）を実装し、ERC-1155 のレシーバーと同様に関数セレクターを返す必要があります。\n- メインアセットのメタデータが変更されると `URI(oldValue, newValue, mainId)` が emit されます。\n\n設計上は、すべての mainId で 1 組の subId を共有することも、mainId ごとに別々の subId を持たせることもできます。供給量の追跡を単純に保つため、より深い階層は意図的に採用されませんでした。ERC-1155 の拡張ではなく、独立したインターフェースです。\n\n## サンプルコード\n\nコントラクトで DLT トークンを受け取り、残高を読む例:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ninterface IDLT {\n    function subBalanceOf(address account, uint256 mainId, uint256 subId) external view returns (uint256);\n}\n\ninterface IDLTReceiver {\n    function onDLTReceived(address, address, uint256, uint256, uint256, bytes calldata) external returns (bytes4);\n    function onDLTBatchReceived(address, address, uint256[] calldata, uint256[] calldata, uint256[] calldata, bytes calldata)\n        external returns (bytes4);\n}\n\ncontract InvoiceVault is IDLTReceiver {\n    IDLT public immutable dlt;\n    constructor(IDLT d) { dlt = d; }\n\n    function onDLTReceived(address, address, uint256, uint256, uint256, bytes calldata)\n        external pure returns (bytes4) { return IDLTReceiver.onDLTReceived.selector; }\n\n    function onDLTBatchReceived(address, address, uint256[] calldata, uint256[] calldata, uint256[] calldata, bytes calldata)\n        external pure returns (bytes4) { return IDLTReceiver.onDLTBatchReceived.selector; }\n\n    /// e.g. mainId = invoice #42, subId = the 30-day tranche\n    function held(uint256 mainId, uint256 subId) external view returns (uint256) {\n        return dlt.subBalanceOf(address(this), mainId, subId);\n    }\n}\n```\n\n## 知っておくべきこと\n\n- ステータスは **Draft** です。名前やシグネチャはまだ変わる可能性があります。\n- ERC-1155 のツールとは互換性がなく、ウォレットやマーケットプレイスには DLT 専用の対応が必要です。\n- サブトークンごとの allowance には、[ERC-20](/eip-20/) と同じ approve/transferFrom の競合問題があります。increase/decrease 系のヘルパーを使うか、先に 0 にリセットしてください。\n- バッチ操作は呼び出し側が渡した配列をループするため、長すぎると gas が尽きることがあります。\n- 多数のサブ残高を合算してメインアセットの合計にするとオーバーフローする可能性があります。参照実装ではメインの残高を別に管理しています。\n- 関連する「スロットと値」のモデルについては、[ERC-3525](/eip-3525/) を参照してください。\n"},"ko":{"lang":"ko","tldr":"모든 잔액을 mainId(자산)와 subId(그 변형이나 지분)로 지정하는 멀티 토큰 표준 초안. 청구서나 부동산 같은 실물 자산의 토큰화를 목표로 한다.","tags":["token","multi-token","rwa","fractional","standard"],"related":[1155,20,721,3525],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-6960/","markdown":"## 어떤 문제를 해결하나요?\n\n[ERC-1155](/eip-1155/)는 컨트랙트 하나에 여러 토큰 종류를 담을 수 있지만, 각각 `id`가 하나뿐입니다. 실물 자산에는 두 번째 계층이 필요한 경우가 많습니다. 청구서 한 장, 건물 한 채, 주식 종류 하나(자산)가 각자 속성을 가진 여러 조각(하위 자산)으로 나뉘는 경우입니다. 둘을 하나의 `id`에 인코딩할 수도 있지만, 잔액, 승인, 추적이 불편해집니다.\n\nERC-6960의 **Dual Layer Token(DLT)**은 이를 명시적으로 만듭니다. 모든 토큰은 `(mainId, subId)` 쌍으로 식별됩니다. 저자들은 청구서, 회사 주식, 수집품, 부동산의 분할 소유를 대상으로 합니다.\n\n## 어떻게 동작하나요?\n\n- **`mainId`**는 주 자산 종류를, **`subId`**는 그 안의 변형, 트랜치, 지분을 나타냅니다.\n- 잔액은 `(account, mainId, subId)`별로 관리됩니다. `subBalanceOf(account, mainId, subId)`와 배치 형태인 `balanceOfBatch(accounts, mainIds, subIds)`가 있습니다.\n- 승인은 두 가지 형태가 있습니다.\n  - `approve(operator, mainId, subId, amount)`와 `allowance(owner, operator, mainId, subId)`. 하위 토큰 하나에 대한 ERC-20 방식의 allowance입니다.\n  - `setApprovalForAll(operator, approved)`: 모든 것에 대한 전체 오퍼레이터 권한.\n- 전송은 `safeTransferFrom(sender, recipient, mainId, subId, amount, data)`를 사용합니다. 제로 주소이거나 잔액이 부족하면 반드시 revert해야 하며, `Transfer(sender, recipient, mainId, subId, amount)`를 emit합니다.\n- 컨트랙트 수신자는 `IDLTReceiver`(`onDLTReceived`, `onDLTBatchReceived`)를 구현하고 ERC-1155 수신자처럼 함수 셀렉터를 반환해야 합니다.\n- 주 자산의 메타데이터가 바뀌면 `URI(oldValue, newValue, mainId)`가 emit됩니다.\n\n설계상 모든 mainId가 subId 한 세트를 공유하게 할 수도 있고, mainId마다 자기만의 subId를 갖게 할 수도 있습니다. 공급량 추적을 단순하게 유지하기 위해 더 깊은 계층 구조는 의도적으로 채택되지 않았습니다. ERC-1155의 확장이 아니라 독립된 인터페이스입니다.\n\n## 샘플 코드\n\n컨트랙트에서 DLT 토큰을 받고 잔액을 읽는 예:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ninterface IDLT {\n    function subBalanceOf(address account, uint256 mainId, uint256 subId) external view returns (uint256);\n}\n\ninterface IDLTReceiver {\n    function onDLTReceived(address, address, uint256, uint256, uint256, bytes calldata) external returns (bytes4);\n    function onDLTBatchReceived(address, address, uint256[] calldata, uint256[] calldata, uint256[] calldata, bytes calldata)\n        external returns (bytes4);\n}\n\ncontract InvoiceVault is IDLTReceiver {\n    IDLT public immutable dlt;\n    constructor(IDLT d) { dlt = d; }\n\n    function onDLTReceived(address, address, uint256, uint256, uint256, bytes calldata)\n        external pure returns (bytes4) { return IDLTReceiver.onDLTReceived.selector; }\n\n    function onDLTBatchReceived(address, address, uint256[] calldata, uint256[] calldata, uint256[] calldata, bytes calldata)\n        external pure returns (bytes4) { return IDLTReceiver.onDLTBatchReceived.selector; }\n\n    /// e.g. mainId = invoice #42, subId = the 30-day tranche\n    function held(uint256 mainId, uint256 subId) external view returns (uint256) {\n        return dlt.subBalanceOf(address(this), mainId, subId);\n    }\n}\n```\n\n## 알아둘 점\n\n- 상태는 **Draft**입니다. 이름과 시그니처가 아직 바뀔 수 있습니다.\n- ERC-1155 도구와 호환되지 않으며, 지갑과 마켓플레이스에 DLT 전용 지원이 필요합니다.\n- 하위 토큰별 allowance에는 [ERC-20](/eip-20/)과 같은 approve/transferFrom 경쟁 조건이 있습니다. increase/decrease 헬퍼를 쓰거나 먼저 0으로 초기화하세요.\n- 배치 연산은 호출자가 넘긴 배열을 순회하므로, 배열이 너무 길면 gas가 부족해질 수 있습니다.\n- 많은 하위 잔액을 합산해 주 자산 총합을 만들면 오버플로가 날 수 있습니다. 참조 구현은 주 잔액을 따로 추적합니다.\n- 관련된 \"슬롯과 값\" 모델은 [ERC-3525](/eip-3525/)를 참고하세요.\n"},"zh":{"lang":"zh","tldr":"多代币标准草案，每个余额都由 mainId（资产）和 subId（其变体或份额）共同定位，目标是将发票、房产等现实世界资产代币化。","tags":["token","multi-token","rwa","fractional","standard"],"related":[1155,20,721,3525],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-6960/","markdown":"## 它解决什么问题？\n\n[ERC-1155](/eip-1155/) 让一个合约可以持有多种代币类型，每种只有一个 `id`。现实世界的资产往往需要第二层：一张发票、一栋楼或一个股份类别（资产）会被拆成许多各有属性的小份（子资产）。把两者编码进同一个 `id` 虽然可行，但会让余额、授权和追踪变得笨拙。\n\nERC-6960 的 **Dual Layer Token（DLT）** 把这一点明确化：每个代币由一对 `(mainId, subId)` 标识。作者的目标场景包括发票、公司股权、收藏品和房地产的份额化所有权。\n\n## 它如何运作\n\n- **`mainId`** 表示主资产类型，**`subId`** 表示其中的变体、分档（tranche）或份额。\n- 余额按 `(account, mainId, subId)` 记录：`subBalanceOf(account, mainId, subId)` 以及批量形式 `balanceOfBatch(accounts, mainIds, subIds)`。\n- 授权有两种形式：\n  - `approve(operator, mainId, subId, amount)` 配合 `allowance(owner, operator, mainId, subId)`，即针对某个子代币的 ERC-20 风格额度。\n  - `setApprovalForAll(operator, approved)`：对所有代币的完整操作者权限。\n- 转账使用 `safeTransferFrom(sender, recipient, mainId, subId, amount, data)`。遇到零地址或余额不足时必须 revert，并触发 `Transfer(sender, recipient, mainId, subId, amount)`。\n- 合约接收方必须实现 `IDLTReceiver`（`onDLTReceived`、`onDLTBatchReceived`）并返回函数选择器，与 ERC-1155 的接收方类似。\n- 当某个主资产的元数据发生变化时，会触发 `URI(oldValue, newValue, mainId)`。\n\n设计上既可以让所有 mainId 共用同一组 subId，也可以让每个 mainId 拥有自己的 subId。为了让供应量追踪保持简单，更深的层级被有意否决。它是一个独立的接口，而不是 ERC-1155 的扩展。\n\n## 示例代码\n\n在合约中接收 DLT 代币并读取余额：\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ninterface IDLT {\n    function subBalanceOf(address account, uint256 mainId, uint256 subId) external view returns (uint256);\n}\n\ninterface IDLTReceiver {\n    function onDLTReceived(address, address, uint256, uint256, uint256, bytes calldata) external returns (bytes4);\n    function onDLTBatchReceived(address, address, uint256[] calldata, uint256[] calldata, uint256[] calldata, bytes calldata)\n        external returns (bytes4);\n}\n\ncontract InvoiceVault is IDLTReceiver {\n    IDLT public immutable dlt;\n    constructor(IDLT d) { dlt = d; }\n\n    function onDLTReceived(address, address, uint256, uint256, uint256, bytes calldata)\n        external pure returns (bytes4) { return IDLTReceiver.onDLTReceived.selector; }\n\n    function onDLTBatchReceived(address, address, uint256[] calldata, uint256[] calldata, uint256[] calldata, bytes calldata)\n        external pure returns (bytes4) { return IDLTReceiver.onDLTBatchReceived.selector; }\n\n    /// e.g. mainId = invoice #42, subId = the 30-day tranche\n    function held(uint256 mainId, uint256 subId) external view returns (uint256) {\n        return dlt.subBalanceOf(address(this), mainId, subId);\n    }\n}\n```\n\n## 需要注意\n\n- 状态为 **Draft**：名称和签名仍可能变化。\n- 与 ERC-1155 的工具不兼容；钱包和交易市场需要专门支持 DLT。\n- 按子代币设置的额度存在与 [ERC-20](/eip-20/) 相同的 approve/transferFrom 竞态问题；建议使用增减额度的辅助函数，或先重置为零。\n- 批量操作会遍历调用者提供的数组，数组过长可能导致 gas 耗尽。\n- 把许多子余额加总为主资产总量可能溢出；参考实现单独记录主余额。\n- 关于相关的\"slot 加数值\"模型，请参见 [ERC-3525](/eip-3525/)。\n"}}}
