{"eip":2135,"title":"Consumable Interface (Tickets, etc)","description":"An interface extending ERC-721 and ERC-1155 for consumability, supporting use case such as an event ticket.","authors":["Zainan Victor Zhou (@xinbenlv)"],"status":"Final","type":"Standards Track","category":"ERC","created":"2019-06-23","requires":[165,721,1155],"discussionsTo":"https://ethereum-magicians.org/t/eip-2135-erc-consumable-interface/3439","repo":"ERCs","label":"ERC-2135","officialUrl":"https://eips.ethereum.org/EIPS/eip-2135","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-2135.md","url":"https://eips.huatuo.xyz/eip-2135/","tldr":{"en":"A minimal interface for marking NFTs or multi-tokens as consumable, such as event tickets, with a standard consume() call, a pre-check and an OnConsumption event.","ja":"NFT やマルチトークンを、イベントチケットのような「消費可能」なものとして扱うための最小限のインターフェース。標準の consume() 呼び出し、事前チェック、OnConsumption イベントを定める。","ko":"NFT나 멀티 토큰을 이벤트 티켓처럼 소모 가능한 것으로 표시하기 위한 최소 인터페이스. 표준 consume() 호출, 사전 확인, OnConsumption 이벤트를 정의한다.","zh":"一个把 NFT 或多代币标记为可消耗（例如活动门票）的最小接口，包含标准的 consume() 调用、预检查和 OnConsumption 事件。"},"tags":["nft","tickets","erc721","erc1155","interface"],"explainers":{"en":{"lang":"en","tldr":"A minimal interface for marking NFTs or multi-tokens as consumable, such as event tickets, with a standard consume() call, a pre-check and an OnConsumption event.","tags":["nft","tickets","erc721","erc1155","interface"],"related":[721,1155,165,20],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-2135/","markdown":"## What problem does it solve?\n\nMany digital assets are meant to be used up: a concert ticket is \"consumed\" at the door, a voucher when it is redeemed, a pass when it is scanned. Without a standard, every ticketing contract invents its own `redeem`, `use` or `checkIn` function, so scanners, wallets, marketplaces and other contracts cannot handle them generically.\n\nERC-2135 defines one small interface for consumption that sits on top of [ERC-721](/eip-721/) or [ERC-1155](/eip-1155/) tokens.\n\n## How it works\n\nA compliant contract implements:\n\n| Member | Purpose |\n| --- | --- |\n| `consume(consumer, assetId, amount, data)` | Consume `amount` of `assetId` on behalf of `consumer`; returns `bool` |\n| `isConsumableBy(consumer, assetId, amount)` | View check: could this consumption succeed? |\n| `event OnConsumption(consumer, assetId, amount, data)` | Emitted on every successful consumption |\n\nRules:\n\n- `supportsInterface(0xdd691946)` must return `true` ([ERC-165](/eip-165/)).\n- If the contract is an ERC-721 or ERC-1155 token, a successful `consume` must also emit `Transfer` / `TransferSingle` as if the token moved from the holder to the zero address, so indexers see it disappear.\n- `consumer` does not have to be the transaction sender, so a venue's gate contract or a relayer can consume on someone's behalf.\n- `data` is free-form for extensions such as signed endorsements.\n\nThe standard deliberately says nothing about who may consume, under what conditions, how consumables are created, or what metadata they carry. Those are left to the application.\n\n## Sample code\n\nAn ERC-721 ticket that only the venue's gate can consume (OpenZeppelin v5):\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"@openzeppelin/contracts/token/ERC721/ERC721.sol\";\n\ninterface IERC2135 {\n    function consume(address consumer, uint256 assetId, uint256 amount, bytes calldata data)\n        external returns (bool);\n    function isConsumableBy(address consumer, uint256 assetId, uint256 amount)\n        external view returns (bool);\n    event OnConsumption(address indexed consumer, uint256 indexed assetId, uint256 amount, bytes data);\n}\n\ncontract Ticket is ERC721, IERC2135 {\n    address public immutable gate;\n\n    constructor(address gate_) ERC721(\"Concert Ticket\", \"TIX\") { gate = gate_; }\n\n    function mint(address to, uint256 id) external {\n        require(msg.sender == gate, \"only gate\");\n        _mint(to, id);\n    }\n\n    function isConsumableBy(address consumer, uint256 id, uint256 amount) public view returns (bool) {\n        return amount == 1 \u0026\u0026 _ownerOf(id) == consumer;\n    }\n\n    function consume(address consumer, uint256 id, uint256 amount, bytes calldata data)\n        external returns (bool)\n    {\n        require(msg.sender == gate, \"only gate\");\n        require(isConsumableBy(consumer, id, amount), \"not consumable\");\n        _burn(id); // emits Transfer(owner, address(0), id) as the spec requires\n        emit OnConsumption(consumer, id, amount, data);\n        return true;\n    }\n\n    function supportsInterface(bytes4 interfaceId) public view override returns (bool) {\n        return interfaceId == type(IERC2135).interfaceId || super.supportsInterface(interfaceId);\n    }\n}\n```\n\n## Things to know\n\n- Access control is the main security decision. Decide explicitly whether holders, the issuer, or a gate contract may call `consume`, and test it.\n- Keep consumption consistent with transfer restrictions: if transfers are paused or a user is restricted, consumption should behave the same way.\n- For ERC-721 and ERC-1155 tokens the required transfer-to-zero event means consumption effectively removes the token from the holder's balance, so burning is the natural implementation.\n- The authors note it can be adapted to fungible tokens such as [ERC-20](/eip-20/), but the interface was designed with NFTs in mind.\n"},"ja":{"lang":"ja","tldr":"NFT やマルチトークンを、イベントチケットのような「消費可能」なものとして扱うための最小限のインターフェース。標準の consume() 呼び出し、事前チェック、OnConsumption イベントを定める。","tags":["nft","tickets","erc721","erc1155","interface"],"related":[721,1155,165,20],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-2135/","markdown":"## 何を解決するのか\n\n多くのデジタル資産は使い切ることを前提としています。コンサートのチケットは入口で「消費」され、バウチャーは引き換え時に、パスはスキャン時に消費されます。標準がなければ、チケット系のコントラクトはそれぞれ独自の `redeem`、`use`、`checkIn` といった関数を作ってしまい、スキャナー、ウォレット、マーケットプレイス、他のコントラクトが汎用的に扱えません。\n\nERC-2135 は、[ERC-721](/eip-721/) または [ERC-1155](/eip-1155/) トークンの上に載る、消費のための小さなインターフェースを 1 つ定義します。\n\n## 仕組み\n\n準拠するコントラクトは次を実装します。\n\n| メンバー | 役割 |\n| --- | --- |\n| `consume(consumer, assetId, amount, data)` | `consumer` の代わりに `assetId` を `amount` だけ消費する。`bool` を返す |\n| `isConsumableBy(consumer, assetId, amount)` | view によるチェック。この消費は成功するか |\n| `event OnConsumption(consumer, assetId, amount, data)` | 消費が成功するたびに発行される |\n\nルール:\n\n- `supportsInterface(0xdd691946)` は `true` を返さなければなりません（[ERC-165](/eip-165/)）。\n- コントラクトが ERC-721 または ERC-1155 トークンである場合、`consume` が成功したら、トークンが保有者からゼロアドレスへ移動したかのように `Transfer` / `TransferSingle` も発行しなければなりません。これによりインデクサーはトークンが消えたことを把握できます。\n- `consumer` はトランザクションの送信者である必要はないため、会場のゲートコントラクトやリレイヤーが誰かに代わって消費できます。\n- `data` は自由形式で、署名付きの承認などの拡張に使えます。\n\nこの標準は、誰がどんな条件で消費できるか、消費可能なものがどう作られるか、どんなメタデータを持つかについては意図的に何も定めていません。それらはアプリケーションに委ねられています。\n\n## サンプルコード\n\n会場のゲートだけが消費できる ERC-721 チケット（OpenZeppelin v5）:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"@openzeppelin/contracts/token/ERC721/ERC721.sol\";\n\ninterface IERC2135 {\n    function consume(address consumer, uint256 assetId, uint256 amount, bytes calldata data)\n        external returns (bool);\n    function isConsumableBy(address consumer, uint256 assetId, uint256 amount)\n        external view returns (bool);\n    event OnConsumption(address indexed consumer, uint256 indexed assetId, uint256 amount, bytes data);\n}\n\ncontract Ticket is ERC721, IERC2135 {\n    address public immutable gate;\n\n    constructor(address gate_) ERC721(\"Concert Ticket\", \"TIX\") { gate = gate_; }\n\n    function mint(address to, uint256 id) external {\n        require(msg.sender == gate, \"only gate\");\n        _mint(to, id);\n    }\n\n    function isConsumableBy(address consumer, uint256 id, uint256 amount) public view returns (bool) {\n        return amount == 1 \u0026\u0026 _ownerOf(id) == consumer;\n    }\n\n    function consume(address consumer, uint256 id, uint256 amount, bytes calldata data)\n        external returns (bool)\n    {\n        require(msg.sender == gate, \"only gate\");\n        require(isConsumableBy(consumer, id, amount), \"not consumable\");\n        _burn(id); // emits Transfer(owner, address(0), id) as the spec requires\n        emit OnConsumption(consumer, id, amount, data);\n        return true;\n    }\n\n    function supportsInterface(bytes4 interfaceId) public view override returns (bool) {\n        return interfaceId == type(IERC2135).interfaceId || super.supportsInterface(interfaceId);\n    }\n}\n```\n\n## 知っておくべきこと\n\n- アクセス制御が最大のセキュリティ上の判断です。保有者、発行者、ゲートコントラクトのどれが `consume` を呼べるのかを明確に決め、テストしてください。\n- 消費は転送制限と一貫させてください。転送が一時停止されている、またはユーザーが制限されている場合は、消費も同じように振る舞うべきです。\n- ERC-721 と ERC-1155 では、ゼロアドレスへの転送イベントが必須なので、消費は実質的に保有者の残高からトークンを取り除くことになり、burn が自然な実装です。\n- 著者は、[ERC-20](/eip-20/) のような代替可能トークンにも応用できると述べていますが、このインターフェースは NFT を念頭に設計されています。\n"},"ko":{"lang":"ko","tldr":"NFT나 멀티 토큰을 이벤트 티켓처럼 소모 가능한 것으로 표시하기 위한 최소 인터페이스. 표준 consume() 호출, 사전 확인, OnConsumption 이벤트를 정의한다.","tags":["nft","tickets","erc721","erc1155","interface"],"related":[721,1155,165,20],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-2135/","markdown":"## 어떤 문제를 해결하나요?\n\n많은 디지털 자산은 쓰고 나면 사라지도록 만들어집니다. 콘서트 티켓은 입구에서 \"소모\"되고, 바우처는 교환할 때, 패스는 스캔할 때 소모됩니다. 표준이 없으면 티켓 컨트랙트마다 자기만의 `redeem`, `use`, `checkIn` 함수를 만들어, 스캐너·지갑·마켓플레이스·다른 컨트랙트가 이를 범용적으로 다룰 수 없습니다.\n\nERC-2135는 [ERC-721](/eip-721/) 또는 [ERC-1155](/eip-1155/) 토큰 위에 얹는 작은 소모용 인터페이스 하나를 정의합니다.\n\n## 어떻게 동작하나요?\n\n호환되는 컨트랙트는 다음을 구현합니다.\n\n| 멤버 | 역할 |\n| --- | --- |\n| `consume(consumer, assetId, amount, data)` | `consumer`를 대신해 `assetId`를 `amount`만큼 소모하며 `bool`을 반환 |\n| `isConsumableBy(consumer, assetId, amount)` | view 확인: 이 소모가 성공할 수 있는가? |\n| `event OnConsumption(consumer, assetId, amount, data)` | 소모가 성공할 때마다 발생 |\n\n규칙:\n\n- `supportsInterface(0xdd691946)`은 `true`를 반환해야 합니다([ERC-165](/eip-165/)).\n- 컨트랙트가 ERC-721 또는 ERC-1155 토큰이라면, `consume`이 성공했을 때 토큰이 보유자에서 제로 주소로 이동한 것처럼 `Transfer` / `TransferSingle`도 발생시켜야 합니다. 그래야 인덱서가 토큰이 사라진 것을 볼 수 있습니다.\n- `consumer`가 트랜잭션 발신자일 필요는 없으므로, 행사장의 게이트 컨트랙트나 릴레이어가 다른 사람을 대신해 소모할 수 있습니다.\n- `data`는 자유 형식이며 서명된 보증 같은 확장에 쓸 수 있습니다.\n\n이 표준은 누가 어떤 조건에서 소모할 수 있는지, 소모 가능한 것이 어떻게 만들어지는지, 어떤 메타데이터를 갖는지에 대해서는 의도적으로 아무것도 정하지 않습니다. 이는 애플리케이션에 맡겨져 있습니다.\n\n## 샘플 코드\n\n행사장 게이트만 소모할 수 있는 ERC-721 티켓(OpenZeppelin v5):\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"@openzeppelin/contracts/token/ERC721/ERC721.sol\";\n\ninterface IERC2135 {\n    function consume(address consumer, uint256 assetId, uint256 amount, bytes calldata data)\n        external returns (bool);\n    function isConsumableBy(address consumer, uint256 assetId, uint256 amount)\n        external view returns (bool);\n    event OnConsumption(address indexed consumer, uint256 indexed assetId, uint256 amount, bytes data);\n}\n\ncontract Ticket is ERC721, IERC2135 {\n    address public immutable gate;\n\n    constructor(address gate_) ERC721(\"Concert Ticket\", \"TIX\") { gate = gate_; }\n\n    function mint(address to, uint256 id) external {\n        require(msg.sender == gate, \"only gate\");\n        _mint(to, id);\n    }\n\n    function isConsumableBy(address consumer, uint256 id, uint256 amount) public view returns (bool) {\n        return amount == 1 \u0026\u0026 _ownerOf(id) == consumer;\n    }\n\n    function consume(address consumer, uint256 id, uint256 amount, bytes calldata data)\n        external returns (bool)\n    {\n        require(msg.sender == gate, \"only gate\");\n        require(isConsumableBy(consumer, id, amount), \"not consumable\");\n        _burn(id); // emits Transfer(owner, address(0), id) as the spec requires\n        emit OnConsumption(consumer, id, amount, data);\n        return true;\n    }\n\n    function supportsInterface(bytes4 interfaceId) public view override returns (bool) {\n        return interfaceId == type(IERC2135).interfaceId || super.supportsInterface(interfaceId);\n    }\n}\n```\n\n## 알아둘 점\n\n- 접근 제어가 가장 중요한 보안 결정입니다. 보유자, 발행자, 게이트 컨트랙트 중 누가 `consume`을 호출할 수 있는지 명시적으로 정하고 테스트하세요.\n- 소모를 전송 제한과 일관되게 유지하세요. 전송이 일시 중지되었거나 사용자가 제한된 경우 소모도 같은 방식으로 동작해야 합니다.\n- ERC-721과 ERC-1155 토큰에서는 제로 주소로의 전송 이벤트가 필수이므로, 소모는 사실상 보유자의 잔액에서 토큰을 제거하게 되어 burn이 자연스러운 구현입니다.\n- 저자는 [ERC-20](/eip-20/) 같은 대체 가능 토큰에도 맞춰 쓸 수 있다고 하지만, 이 인터페이스는 NFT를 염두에 두고 설계되었습니다.\n"},"zh":{"lang":"zh","tldr":"一个把 NFT 或多代币标记为可消耗（例如活动门票）的最小接口，包含标准的 consume() 调用、预检查和 OnConsumption 事件。","tags":["nft","tickets","erc721","erc1155","interface"],"related":[721,1155,165,20],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-2135/","markdown":"## 它解决什么问题？\n\n许多数字资产本来就是用完即止的：演唱会门票在入口被\"消耗\"，代金券在兑换时被消耗，通行证在扫码时被消耗。没有标准的话，每个票务合约都会自创 `redeem`、`use` 或 `checkIn` 函数，扫码设备、钱包、市场和其他合约就无法通用地处理它们。\n\nERC-2135 定义了一个小型的消耗接口，位于 [ERC-721](/eip-721/) 或 [ERC-1155](/eip-1155/) 代币之上。\n\n## 它如何运作\n\n兼容的合约需要实现：\n\n| 成员 | 用途 |\n| --- | --- |\n| `consume(consumer, assetId, amount, data)` | 代表 `consumer` 消耗 `amount` 数量的 `assetId`；返回 `bool` |\n| `isConsumableBy(consumer, assetId, amount)` | view 检查：这次消耗能否成功？ |\n| `event OnConsumption(consumer, assetId, amount, data)` | 每次消耗成功时触发 |\n\n规则：\n\n- `supportsInterface(0xdd691946)` 必须返回 `true`（[ERC-165](/eip-165/)）。\n- 如果合约是 ERC-721 或 ERC-1155 代币，成功的 `consume` 还必须触发 `Transfer` / `TransferSingle`，就像代币从持有者转到了零地址一样，这样索引器能看到它消失。\n- `consumer` 不必是交易发送者，因此场馆的闸机合约或中继者可以代表他人进行消耗。\n- `data` 是自由格式，可用于签名背书等扩展。\n\n该标准有意不规定谁可以消耗、在什么条件下消耗、可消耗品如何创建，或它们携带什么元数据。这些都留给应用自行决定。\n\n## 示例代码\n\n一个只有场馆闸机才能消耗的 ERC-721 门票（OpenZeppelin v5）：\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"@openzeppelin/contracts/token/ERC721/ERC721.sol\";\n\ninterface IERC2135 {\n    function consume(address consumer, uint256 assetId, uint256 amount, bytes calldata data)\n        external returns (bool);\n    function isConsumableBy(address consumer, uint256 assetId, uint256 amount)\n        external view returns (bool);\n    event OnConsumption(address indexed consumer, uint256 indexed assetId, uint256 amount, bytes data);\n}\n\ncontract Ticket is ERC721, IERC2135 {\n    address public immutable gate;\n\n    constructor(address gate_) ERC721(\"Concert Ticket\", \"TIX\") { gate = gate_; }\n\n    function mint(address to, uint256 id) external {\n        require(msg.sender == gate, \"only gate\");\n        _mint(to, id);\n    }\n\n    function isConsumableBy(address consumer, uint256 id, uint256 amount) public view returns (bool) {\n        return amount == 1 \u0026\u0026 _ownerOf(id) == consumer;\n    }\n\n    function consume(address consumer, uint256 id, uint256 amount, bytes calldata data)\n        external returns (bool)\n    {\n        require(msg.sender == gate, \"only gate\");\n        require(isConsumableBy(consumer, id, amount), \"not consumable\");\n        _burn(id); // emits Transfer(owner, address(0), id) as the spec requires\n        emit OnConsumption(consumer, id, amount, data);\n        return true;\n    }\n\n    function supportsInterface(bytes4 interfaceId) public view override returns (bool) {\n        return interfaceId == type(IERC2135).interfaceId || super.supportsInterface(interfaceId);\n    }\n}\n```\n\n## 需要注意\n\n- 访问控制是最主要的安全决策。请明确决定持有者、发行方还是闸机合约可以调用 `consume`，并对其进行测试。\n- 让消耗与转账限制保持一致：如果转账被暂停或用户受到限制，消耗也应表现相同。\n- 对 ERC-721 和 ERC-1155 代币来说，必须触发的转向零地址事件意味着消耗实际上会把代币从持有者的余额中移除，因此销毁（burn）是自然的实现方式。\n- 作者指出它可以改造用于 [ERC-20](/eip-20/) 之类的同质化代币，但该接口是以 NFT 为出发点设计的。\n"}}}
