{"eip":4885,"title":"Subscription NFTs and Multi Tokens","description":"An interface for subscription tokens that gives holders subscriptions to NFTs and multi tokens","authors":["Jules Lai (@julesl23)"],"status":"Stagnant","type":"Standards Track","category":"ERC","created":"2022-03-08","requires":[165,721,1155],"discussionsTo":"https://ethereum-magicians.org/t/eip-subscription-token-standard/8531","repo":"ERCs","label":"ERC-4885","officialUrl":"https://eips.ethereum.org/EIPS/eip-4885","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-4885.md","url":"https://eips.huatuo.xyz/eip-4885/","tldr":{"en":"Proposed a subscription token that you buy with ERC-20 and that drains over time; while its balance is above zero you may use a linked ERC-721 or ERC-1155 NFT, giving creators programmable, tradable subscriptions.","ja":"ERC-20 で購入し、時間とともに減っていくサブスクリプショントークンを提案した。残高が 0 を超えている間は、リンクされた ERC-721 または ERC-1155 の NFT を利用でき、クリエイターにプログラム可能で取引可能なサブスクリプションを提供する。","ko":"ERC-20으로 구매하고 시간이 지나면서 소진되는 구독 토큰을 제안했다. 잔액이 0보다 큰 동안에는 연결된 ERC-721 또는 ERC-1155 NFT를 사용할 수 있어, 크리에이터에게 프로그래밍 가능하고 거래 가능한 구독을 제공한다.","zh":"提出一种用 ERC-20 购买、并随时间消耗的订阅代币；只要余额大于零，就可以使用与之关联的 ERC-721 或 ERC-1155 NFT，为创作者提供可编程、可交易的订阅。"},"tags":["nft","subscription","erc-20","erc-721","erc-1155"],"explainers":{"en":{"lang":"en","tldr":"Proposed a subscription token that you buy with ERC-20 and that drains over time; while its balance is above zero you may use a linked ERC-721 or ERC-1155 NFT, giving creators programmable, tradable subscriptions.","tags":["nft","subscription","erc-20","erc-721","erc-1155"],"related":[721,1155,20,165,5643],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-4885/","markdown":"## What problem does it solve?\n\nSubscriptions to music, video, courses, gyms or season tickets are run by central platforms, which set the terms and own the relationship. The author wanted creators to define their own subscription models on-chain, and wanted the subscription itself to be an asset that can be gifted, refunded or resold, for example a fan selling a season ticket to another fan.\n\nSimply adding an expiry date to an NFT does not make the remaining time tradable. EIP-4885 separates the two: the NFT represents the asset or service, and a fungible *subscription token* represents the time left.\n\n## How it works\n\n- A provider deploys a subscription-token contract tied to one NFT contract ([ERC-721](/eip-721/) or [ERC-1155](/eip-1155/)) and one [ERC-20](/eip-20/) \"base token\" used for payment. The NFT contract must approve the subscription contract as an operator.\n- `subscribeToNFT(subscriber, tokenId, uri)` gives the subscriber the NFT. A `tokenId` of 0 lets the contract mint one; `uri` optionally points to per-subscriber terms.\n- `deposit(subscriber, tokenId, amount)` takes ERC-20 from the subscriber and credits subscription tokens, extending the period. A `Deposit` event records the amount paid, tokens issued and seconds added.\n- `balanceOf(subscriber)` is recommended to fall linearly to zero over time (or stay constant for lifetime subscriptions). It can be computed lazily in a `view`, so there is no gas cost for the decay. At zero, use of the NFT must not be allowed; what \"not allowed\" means (stop streaming, hide metadata) is up to the implementer.\n- `supportsInterface(0xC1A48422)` must return true.\n\nThe contract borrows `name`, `symbol` and `balanceOf` from ERC-20; implementing the rest of ERC-20 to make subscriptions transferable is optional.\n\n## Sample code\n\nA lazily decaying balance, using the spec's example of one token per day:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ncontract DecayingBalance {\n    struct Sub { uint256 tokens; uint64 since; }   // tokens in 1e18 units\n    mapping(address =\u003e Sub) internal subs;\n    uint256 constant PER_SECOND = 1e18 / 1 days;    // 1 token per day\n\n    function balanceOf(address subscriber) public view returns (uint256) {\n        Sub memory s = subs[subscriber];\n        require(s.since != 0, \"not started\");        // spec: revert before first deposit\n        uint256 used = (block.timestamp - s.since) * PER_SECOND;\n        return used \u003e= s.tokens ? 0 : s.tokens - used;\n    }\n\n    function _topUp(address subscriber, uint256 tokens) internal {\n        uint256 left = subs[subscriber].since == 0 ? 0 : balanceOf(subscriber);\n        subs[subscriber] = Sub(left + tokens, uint64(block.timestamp));\n    }\n}\n```\n\n## Things to know\n\n- Status: **Stagnant**. It did not progress to Final.\n- Payments are prepaid and cannot auto-renew: each top-up needs the subscriber's own approval of the ERC-20 deposit.\n- Pausing is not specified; adding it means `balanceOf` must account for paused time.\n- Nothing in the standard guarantees the provider actually delivers the service after taking deposits.\n- [ERC-5643](/eip-5643/) is a simpler alternative that puts an expiry directly on ERC-721 tokens.\n"},"ja":{"lang":"ja","tldr":"ERC-20 で購入し、時間とともに減っていくサブスクリプショントークンを提案した。残高が 0 を超えている間は、リンクされた ERC-721 または ERC-1155 の NFT を利用でき、クリエイターにプログラム可能で取引可能なサブスクリプションを提供する。","tags":["nft","subscription","erc-20","erc-721","erc-1155"],"related":[721,1155,20,165,5643],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-4885/","markdown":"## 何を解決するのか\n\n音楽、動画、講座、ジム、シーズンチケットなどのサブスクリプションは中央集権的なプラットフォームが運営しており、条件を決め、顧客との関係も握っています。作者は、クリエイター自身がオンチェーンで独自のサブスクリプションモデルを定義できるようにしたいと考え、またサブスクリプション自体を、贈与・返金・転売できる資産にしたいと考えました。たとえば、あるファンがシーズンチケットを別のファンに売るような使い方です。\n\nNFT に有効期限を付けるだけでは、残り時間を取引可能にはできません。EIP-4885 は両者を分離します。NFT は資産やサービスを表し、代替可能な*サブスクリプショントークン*が残り時間を表します。\n\n## 仕組み\n\n- プロバイダーは、1 つの NFT コントラクト（[ERC-721](/eip-721/) または [ERC-1155](/eip-1155/)）と、支払いに使う 1 つの [ERC-20](/eip-20/)「ベーストークン」に結び付けたサブスクリプショントークンコントラクトをデプロイします。NFT コントラクトは、サブスクリプションコントラクトをオペレーターとして承認する必要があります。\n- `subscribeToNFT(subscriber, tokenId, uri)` は、サブスクライバーに NFT を渡します。`tokenId` が 0 の場合は、コントラクトが新たに mint できます。`uri` は、サブスクライバーごとの条件を任意で指します。\n- `deposit(subscriber, tokenId, amount)` は、サブスクライバーから ERC-20 を受け取り、サブスクリプショントークンを付与して期間を延長します。`Deposit` イベントには、支払額、発行されたトークン数、追加された秒数が記録されます。\n- `balanceOf(subscriber)` は、時間とともに線形に 0 まで減少すること（終身サブスクリプションの場合は一定のままであること）が推奨されています。`view` の中で遅延計算できるため、減少にガスコストはかかりません。0 になったら、NFT の利用を許可してはなりません。「許可しない」の意味（ストリーミングの停止、メタデータの非表示など）は実装者に委ねられています。\n- `supportsInterface(0xC1A48422)` は true を返さなければなりません。\n\nこのコントラクトは ERC-20 から `name`、`symbol`、`balanceOf` を借用しています。サブスクリプションを転送可能にするために ERC-20 の残りを実装することは任意です。\n\n## サンプルコード\n\n仕様の例である 1 日 1 トークンを使った、遅延評価で減少する残高です。\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ncontract DecayingBalance {\n    struct Sub { uint256 tokens; uint64 since; }   // tokens in 1e18 units\n    mapping(address =\u003e Sub) internal subs;\n    uint256 constant PER_SECOND = 1e18 / 1 days;    // 1 token per day\n\n    function balanceOf(address subscriber) public view returns (uint256) {\n        Sub memory s = subs[subscriber];\n        require(s.since != 0, \"not started\");        // spec: revert before first deposit\n        uint256 used = (block.timestamp - s.since) * PER_SECOND;\n        return used \u003e= s.tokens ? 0 : s.tokens - used;\n    }\n\n    function _topUp(address subscriber, uint256 tokens) internal {\n        uint256 left = subs[subscriber].since == 0 ? 0 : balanceOf(subscriber);\n        subs[subscriber] = Sub(left + tokens, uint64(block.timestamp));\n    }\n}\n```\n\n## 知っておくべきこと\n\n- ステータス: **Stagnant**。Final には進みませんでした。\n- 支払いは前払いで、自動更新はできません。チャージのたびに、サブスクライバー自身による ERC-20 デポジットの承認が必要です。\n- 一時停止は仕様で定められていません。追加する場合は、`balanceOf` が停止期間を考慮する必要があります。\n- デポジットを受け取ったあと、プロバイダーが実際にサービスを提供することは、標準では何も保証されていません。\n- [ERC-5643](/eip-5643/) は、ERC-721 トークンに直接有効期限を持たせる、より単純な代替案です。\n"},"ko":{"lang":"ko","tldr":"ERC-20으로 구매하고 시간이 지나면서 소진되는 구독 토큰을 제안했다. 잔액이 0보다 큰 동안에는 연결된 ERC-721 또는 ERC-1155 NFT를 사용할 수 있어, 크리에이터에게 프로그래밍 가능하고 거래 가능한 구독을 제공한다.","tags":["nft","subscription","erc-20","erc-721","erc-1155"],"related":[721,1155,20,165,5643],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-4885/","markdown":"## 어떤 문제를 해결하나요?\n\n음악, 영상, 강의, 헬스장, 시즌 티켓 같은 구독은 중앙화된 플랫폼이 운영하며, 조건을 정하고 고객 관계도 가져갑니다. 작성자는 크리에이터가 온체인에서 자신만의 구독 모델을 정의할 수 있기를 원했고, 구독 자체가 선물, 환불, 재판매가 가능한 자산이 되기를 원했습니다. 예를 들어 한 팬이 다른 팬에게 시즌 티켓을 파는 경우입니다.\n\nNFT에 만료일을 붙이는 것만으로는 남은 기간을 거래할 수 없습니다. EIP-4885는 둘을 분리합니다. NFT는 자산이나 서비스를 나타내고, 대체 가능한 *구독 토큰*은 남은 시간을 나타냅니다.\n\n## 어떻게 동작하나요?\n\n- 제공자는 하나의 NFT 컨트랙트([ERC-721](/eip-721/) 또는 [ERC-1155](/eip-1155/))와 결제에 쓰는 하나의 [ERC-20](/eip-20/) \"기본 토큰\"에 묶인 구독 토큰 컨트랙트를 배포합니다. NFT 컨트랙트는 구독 컨트랙트를 오퍼레이터로 승인해야 합니다.\n- `subscribeToNFT(subscriber, tokenId, uri)`는 구독자에게 NFT를 줍니다. `tokenId`가 0이면 컨트랙트가 새로 민팅할 수 있습니다. `uri`는 구독자별 약관을 선택적으로 가리킵니다.\n- `deposit(subscriber, tokenId, amount)`는 구독자로부터 ERC-20을 받아 구독 토큰을 적립하고 기간을 연장합니다. `Deposit` 이벤트에는 지불한 금액, 발행된 토큰 수, 추가된 초가 기록됩니다.\n- `balanceOf(subscriber)`는 시간이 지남에 따라 0까지 선형으로 감소하도록(평생 구독이라면 일정하게 유지되도록) 권장됩니다. `view`에서 지연 계산할 수 있으므로 감소에는 가스 비용이 들지 않습니다. 0이 되면 NFT 사용을 허용해서는 안 됩니다. \"허용하지 않는다\"의 의미(스트리밍 중단, 메타데이터 숨김 등)는 구현자가 정합니다.\n- `supportsInterface(0xC1A48422)`는 true를 반환해야 합니다.\n\n이 컨트랙트는 ERC-20에서 `name`, `symbol`, `balanceOf`를 빌려 옵니다. 구독을 양도 가능하게 만들기 위해 ERC-20의 나머지를 구현하는 것은 선택 사항입니다.\n\n## 샘플 코드\n\n사양의 예시인 하루에 토큰 1개를 쓰는 경우를 이용한, 지연 계산으로 감소하는 잔액입니다.\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ncontract DecayingBalance {\n    struct Sub { uint256 tokens; uint64 since; }   // tokens in 1e18 units\n    mapping(address =\u003e Sub) internal subs;\n    uint256 constant PER_SECOND = 1e18 / 1 days;    // 1 token per day\n\n    function balanceOf(address subscriber) public view returns (uint256) {\n        Sub memory s = subs[subscriber];\n        require(s.since != 0, \"not started\");        // spec: revert before first deposit\n        uint256 used = (block.timestamp - s.since) * PER_SECOND;\n        return used \u003e= s.tokens ? 0 : s.tokens - used;\n    }\n\n    function _topUp(address subscriber, uint256 tokens) internal {\n        uint256 left = subs[subscriber].since == 0 ? 0 : balanceOf(subscriber);\n        subs[subscriber] = Sub(left + tokens, uint64(block.timestamp));\n    }\n}\n```\n\n## 알아둘 점\n\n- 상태: **Stagnant**. Final로 진행되지 못했습니다.\n- 결제는 선불이며 자동 갱신할 수 없습니다. 충전할 때마다 구독자 본인이 ERC-20 예치를 승인해야 합니다.\n- 일시 중지는 사양에 정해져 있지 않습니다. 추가하려면 `balanceOf`가 일시 중지된 시간을 반영해야 합니다.\n- 예치금을 받은 뒤 제공자가 실제로 서비스를 제공한다는 것은 표준 어디에서도 보장하지 않습니다.\n- [ERC-5643](/eip-5643/)은 ERC-721 토큰에 직접 만료 시점을 두는 더 단순한 대안입니다.\n"},"zh":{"lang":"zh","tldr":"提出一种用 ERC-20 购买、并随时间消耗的订阅代币；只要余额大于零，就可以使用与之关联的 ERC-721 或 ERC-1155 NFT，为创作者提供可编程、可交易的订阅。","tags":["nft","subscription","erc-20","erc-721","erc-1155"],"related":[721,1155,20,165,5643],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-4885/","markdown":"## 它解决什么问题？\n\n音乐、视频、课程、健身房或季票等订阅服务由中心化平台运营，它们制定条款并掌握用户关系。作者希望创作者能在链上定义自己的订阅模式，也希望订阅本身成为可以赠送、退款或转售的资产，例如一位粉丝把季票转卖给另一位粉丝。\n\n仅仅给 NFT 加上到期日，并不能让剩余时间变得可交易。EIP-4885 把两者分开：NFT 代表资产或服务，而同质化的*订阅代币*代表剩余时间。\n\n## 它如何运作\n\n- 服务提供方部署一个订阅代币合约，它绑定一个 NFT 合约（[ERC-721](/eip-721/) 或 [ERC-1155](/eip-1155/)）和一个用于支付的 [ERC-20](/eip-20/)\"基础代币\"。NFT 合约必须批准订阅合约作为操作员。\n- `subscribeToNFT(subscriber, tokenId, uri)` 把 NFT 交给订阅者。`tokenId` 为 0 时，合约可以铸造一个；`uri` 可选地指向针对每位订阅者的条款。\n- `deposit(subscriber, tokenId, amount)` 从订阅者处扣取 ERC-20，并记入订阅代币，从而延长订阅期。`Deposit` 事件会记录支付金额、发行的代币数量和增加的秒数。\n- 建议 `balanceOf(subscriber)` 随时间线性下降到零（终身订阅则保持不变）。它可以在 `view` 中惰性计算，因此衰减不产生任何 gas 成本。降到零时，必须不允许使用该 NFT；\"不允许\"具体意味着什么（停止串流、隐藏元数据）由实现者决定。\n- `supportsInterface(0xC1A48422)` 必须返回 true。\n\n该合约借用了 ERC-20 的 `name`、`symbol` 和 `balanceOf`；若要让订阅可转让，实现 ERC-20 的其余部分是可选的。\n\n## 示例代码\n\n按规范中\"每天一个代币\"的例子，惰性衰减的余额：\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ncontract DecayingBalance {\n    struct Sub { uint256 tokens; uint64 since; }   // tokens in 1e18 units\n    mapping(address =\u003e Sub) internal subs;\n    uint256 constant PER_SECOND = 1e18 / 1 days;    // 1 token per day\n\n    function balanceOf(address subscriber) public view returns (uint256) {\n        Sub memory s = subs[subscriber];\n        require(s.since != 0, \"not started\");        // spec: revert before first deposit\n        uint256 used = (block.timestamp - s.since) * PER_SECOND;\n        return used \u003e= s.tokens ? 0 : s.tokens - used;\n    }\n\n    function _topUp(address subscriber, uint256 tokens) internal {\n        uint256 left = subs[subscriber].since == 0 ? 0 : balanceOf(subscriber);\n        subs[subscriber] = Sub(left + tokens, uint64(block.timestamp));\n    }\n}\n```\n\n## 需要注意\n\n- 状态：**Stagnant**。它没有推进到 Final。\n- 付款是预付的，无法自动续订：每次充值都需要订阅者自己批准 ERC-20 存款。\n- 规范没有规定暂停功能；若要加入，`balanceOf` 必须把暂停的时间考虑在内。\n- 标准没有任何内容保证服务提供方在收取存款后真的会提供服务。\n- [ERC-5643](/eip-5643/) 是一个更简单的替代方案，直接在 ERC-721 代币上设置到期时间。\n"}}}
