{"eip":6932,"title":"Subscription-Based Token","description":"ERC-20 extension providing access to a service or product that requires recurring payments.","authors":["360 Core \u003chello@360coreinc.com\u003e","Robin Rajput (@0xRobinR)"],"status":"Draft","type":"Standards Track","category":"ERC","created":"2023-04-25","requires":[20],"discussionsTo":"https://ethereum-magicians.org/t/erc-subscription-based-erc20-token/13964","repo":"ERCs","label":"ERC-6932","officialUrl":"https://eips.ethereum.org/EIPS/eip-6932","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-6932.md","url":"https://eips.huatuo.xyz/eip-6932/","tldr":{"en":"A draft ERC-20 extension for recurring payments: a holder subscribes once and the token contract deducts a fixed fee from their balance every period.","ja":"定期支払い向けの ERC-20 拡張のドラフト。保有者が一度購読すると、トークンコントラクトが毎期、固定の手数料を残高から差し引く。","ko":"정기 결제를 위한 ERC-20 확장 초안. 보유자가 한 번 구독하면 토큰 컨트랙트가 매 기간 고정 요금을 잔액에서 차감한다.","zh":"一份用于周期性付款的 ERC-20 扩展草案：持有者订阅一次，代币合约每个周期从其余额中扣除固定费用。"},"tags":["token","erc20","subscription","payments"],"explainers":{"en":{"lang":"en","tldr":"A draft ERC-20 extension for recurring payments: a holder subscribes once and the token contract deducts a fixed fee from their balance every period.","tags":["token","erc20","subscription","payments"],"related":[20],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-6932/","markdown":"## What problem does it solve?\n\nSubscriptions are everywhere off-chain, but on Ethereum users usually have to pay manually each period, or grant an open-ended allowance to a merchant contract. Missed payments interrupt service, and big allowances are risky.\n\nERC-6932 builds the subscription into the [ERC-20](/eip-20/) token itself. A holder subscribes, and the contract treats a growing slice of their balance as already paid, period after period, until they unsubscribe.\n\n## How it works\n\nEach subscription token contract describes one service:\n\n- `subscriptionFee()` is the amount charged per period.\n- `subscriptionFrequency()` is the period length in seconds (e.g. a day, a week, a month).\n- `subscriptionInfo()` returns an ID, name, description and terms-and-conditions text.\n- `subscribers(idx)` lists subscribed addresses (returns `address(0)` past the end).\n- `subscribe()` and `unsubscribe()` are called by the holder.\n\nCharging is lazy, not pushed by a keeper. The rationale sketches computing how many full periods have passed since the subscription started and treating `fee × periods` as locked, capped at the holder's effective balance. A holder's spendable balance is their effective balance minus what ongoing subscriptions have consumed.\n\n```\nintervals = (block.timestamp - start) / frequency\namount    = fee * intervals          // capped at effective balance\n```\n\n## Sample code\n\nThe interface from the spec:\n\n```solidity\n// SPDX-License-Identifier: CC0-1.0\npragma solidity ^0.8.20;\n\ninterface ISubscriptionERC20 {\n    function subscribers(uint256 idx) external view returns (address);\n    function subscriptionInfo() external view returns (uint256, string memory, string memory, string memory);\n    function subscribe() external;\n    function unsubscribe() external;\n    function subscriptionFee() external view returns (uint256);\n    function subscriptionFrequency() external view returns (uint256);\n}\n```\n\nChecking the cost before subscribing (ethers v6):\n\n```ts\nconst [fee, freq] = await Promise.all([sub.subscriptionFee(), sub.subscriptionFrequency()]);\nconst perMonth = (fee * 30n * 86400n) / freq;\nconsole.log(`~${formatUnits(perMonth, 18)} tokens per 30 days`);\nawait (await sub.subscribe()).wait();\n```\n\n## Things to know\n\n- Status is **Draft**, and the text is loose. The abstract mentions `nextPaymentDate` and a `renewSubscription` method that do not appear in the interface, and the accounting formula is only sketched. Expect implementations to differ.\n- Because balances shrink over time without a transaction, `balanceOf` can change from block to block. Integrations that cache balances or assume they only change on `Transfer` events may misbehave.\n- One contract equals one subscription service, so the merchant controls the token's charging logic. Read it before subscribing.\n- For subscriptions paid in an existing token, allowance-based or account-abstraction approaches are more common in practice.\n"},"ja":{"lang":"ja","tldr":"定期支払い向けの ERC-20 拡張のドラフト。保有者が一度購読すると、トークンコントラクトが毎期、固定の手数料を残高から差し引く。","tags":["token","erc20","subscription","payments"],"related":[20],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-6932/","markdown":"## 何を解決するのか\n\nサブスクリプションはオフチェーンではどこにでもありますが、Ethereum では通常、ユーザーが毎期手動で支払うか、加盟店コントラクトに無期限の allowance を与える必要があります。支払いを逃すとサービスが中断され、大きな allowance はリスクがあります。\n\nERC-6932 は、サブスクリプションを [ERC-20](/eip-20/) トークン自体に組み込みます。保有者が購読すると、コントラクトは解約されるまで、期を重ねるごとに増えていく残高の一部を支払い済みとして扱います。\n\n## 仕組み\n\n各サブスクリプショントークンのコントラクトは 1 つのサービスを表します。\n\n- `subscriptionFee()` は 1 期あたりの請求額です。\n- `subscriptionFrequency()` は 1 期の長さ（秒）です（例: 1 日、1 週間、1 か月）。\n- `subscriptionInfo()` は ID、名前、説明、利用規約のテキストを返します。\n- `subscribers(idx)` は購読中のアドレスを列挙します（末尾を超えると `address(0)` を返します）。\n- `subscribe()` と `unsubscribe()` は保有者が呼び出します。\n\n課金は keeper によるプッシュではなく、遅延評価です。根拠の説明では、購読開始から何期が丸ごと経過したかを計算し、`fee × periods` を保有者の実効残高を上限としてロックされたものとして扱う方式が示されています。保有者が使える残高は、実効残高から進行中のサブスクリプションが消費した分を引いたものです。\n\n```\nintervals = (block.timestamp - start) / frequency\namount    = fee * intervals          // capped at effective balance\n```\n\n## サンプルコード\n\n仕様のインターフェース:\n\n```solidity\n// SPDX-License-Identifier: CC0-1.0\npragma solidity ^0.8.20;\n\ninterface ISubscriptionERC20 {\n    function subscribers(uint256 idx) external view returns (address);\n    function subscriptionInfo() external view returns (uint256, string memory, string memory, string memory);\n    function subscribe() external;\n    function unsubscribe() external;\n    function subscriptionFee() external view returns (uint256);\n    function subscriptionFrequency() external view returns (uint256);\n}\n```\n\n購読前にコストを確認する（ethers v6）:\n\n```ts\nconst [fee, freq] = await Promise.all([sub.subscriptionFee(), sub.subscriptionFrequency()]);\nconst perMonth = (fee * 30n * 86400n) / freq;\nconsole.log(`~${formatUnits(perMonth, 18)} tokens per 30 days`);\nawait (await sub.subscribe()).wait();\n```\n\n## 知っておくべきこと\n\n- ステータスは **Draft** で、文面は緩やかです。概要には `nextPaymentDate` と `renewSubscription` メソッドへの言及がありますが、インターフェースには存在せず、会計の計算式も概略にとどまります。実装ごとに差が出ると考えてください。\n- トランザクションなしで残高が時間とともに減るため、`balanceOf` はブロックごとに変わりえます。残高をキャッシュしたり、`Transfer` イベントでのみ変わると仮定したりする統合は、誤動作する可能性があります。\n- 1 つのコントラクトが 1 つのサブスクリプションサービスに相当するため、加盟店がトークンの課金ロジックを握ります。購読する前に読んでください。\n- 既存のトークンで支払うサブスクリプションでは、実際には allowance ベースやアカウント抽象化によるアプローチのほうが一般的です。\n"},"ko":{"lang":"ko","tldr":"정기 결제를 위한 ERC-20 확장 초안. 보유자가 한 번 구독하면 토큰 컨트랙트가 매 기간 고정 요금을 잔액에서 차감한다.","tags":["token","erc20","subscription","payments"],"related":[20],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-6932/","markdown":"## 어떤 문제를 해결하나요?\n\n구독은 오프체인에서는 어디에나 있지만, 이더리움에서는 보통 사용자가 매 기간 수동으로 결제하거나 판매자 컨트랙트에 기한 없는 allowance를 줘야 합니다. 결제를 놓치면 서비스가 중단되고, 큰 allowance는 위험합니다.\n\nERC-6932는 구독을 [ERC-20](/eip-20/) 토큰 자체에 내장합니다. 보유자가 구독하면, 컨트랙트는 구독을 해지할 때까지 기간이 지날수록 늘어나는 잔액의 일부를 이미 결제된 것으로 취급합니다.\n\n## 어떻게 동작하나요?\n\n각 구독 토큰 컨트랙트는 하나의 서비스를 나타냅니다.\n\n- `subscriptionFee()`는 기간당 청구 금액입니다.\n- `subscriptionFrequency()`는 기간의 길이(초 단위)입니다(예: 하루, 일주일, 한 달).\n- `subscriptionInfo()`는 ID, 이름, 설명, 이용 약관 텍스트를 반환합니다.\n- `subscribers(idx)`는 구독 중인 주소를 나열합니다(끝을 넘어서면 `address(0)`을 반환).\n- `subscribe()`와 `unsubscribe()`는 보유자가 호출합니다.\n\n과금은 keeper가 밀어 넣는 방식이 아니라 지연 평가 방식입니다. 설계 근거에는 구독 시작 이후 몇 개의 기간이 온전히 지났는지 계산하고, `fee × periods`를 보유자의 유효 잔액을 상한으로 잠긴 것으로 취급하는 방식이 제시되어 있습니다. 보유자가 쓸 수 있는 잔액은 유효 잔액에서 진행 중인 구독이 소모한 만큼을 뺀 값입니다.\n\n```\nintervals = (block.timestamp - start) / frequency\namount    = fee * intervals          // capped at effective balance\n```\n\n## 샘플 코드\n\n명세의 인터페이스:\n\n```solidity\n// SPDX-License-Identifier: CC0-1.0\npragma solidity ^0.8.20;\n\ninterface ISubscriptionERC20 {\n    function subscribers(uint256 idx) external view returns (address);\n    function subscriptionInfo() external view returns (uint256, string memory, string memory, string memory);\n    function subscribe() external;\n    function unsubscribe() external;\n    function subscriptionFee() external view returns (uint256);\n    function subscriptionFrequency() external view returns (uint256);\n}\n```\n\n구독 전에 비용 확인하기(ethers v6):\n\n```ts\nconst [fee, freq] = await Promise.all([sub.subscriptionFee(), sub.subscriptionFrequency()]);\nconst perMonth = (fee * 30n * 86400n) / freq;\nconsole.log(`~${formatUnits(perMonth, 18)} tokens per 30 days`);\nawait (await sub.subscribe()).wait();\n```\n\n## 알아둘 점\n\n- 상태는 **Draft**이며 문구가 느슨합니다. 개요에는 `nextPaymentDate`와 `renewSubscription` 메서드가 언급되지만 인터페이스에는 없고, 회계 공식도 개략적으로만 제시되어 있습니다. 구현마다 차이가 날 것으로 예상하세요.\n- 트랜잭션 없이 잔액이 시간에 따라 줄어들기 때문에 `balanceOf`는 블록마다 바뀔 수 있습니다. 잔액을 캐시하거나 `Transfer` 이벤트가 있을 때만 바뀐다고 가정하는 연동은 오동작할 수 있습니다.\n- 컨트랙트 하나가 구독 서비스 하나이므로, 토큰의 과금 로직은 판매자가 통제합니다. 구독하기 전에 읽어 보세요.\n- 기존 토큰으로 결제하는 구독에는 실무에서 allowance 기반이나 계정 추상화 방식이 더 흔합니다.\n"},"zh":{"lang":"zh","tldr":"一份用于周期性付款的 ERC-20 扩展草案：持有者订阅一次，代币合约每个周期从其余额中扣除固定费用。","tags":["token","erc20","subscription","payments"],"related":[20],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-6932/","markdown":"## 它解决什么问题？\n\n订阅在链下无处不在，但在以太坊上，用户通常要每个周期手动付款，或者给商户合约开放无限期的授权额度。漏付会中断服务，而大额授权又有风险。\n\nERC-6932 把订阅直接内置到 [ERC-20](/eip-20/) 代币本身中。持有者订阅后，合约会把其余额中不断增长的一部分视为已支付，一个周期接一个周期，直到持有者取消订阅。\n\n## 它如何运作\n\n每个订阅代币合约描述一项服务：\n\n- `subscriptionFee()` 是每个周期收取的金额。\n- `subscriptionFrequency()` 是周期长度，单位为秒（例如一天、一周、一个月）。\n- `subscriptionInfo()` 返回 ID、名称、描述和条款与条件文本。\n- `subscribers(idx)` 列出已订阅的地址（超出末尾时返回 `address(0)`）。\n- `subscribe()` 和 `unsubscribe()` 由持有者调用。\n\n扣费是惰性的，而不是由 keeper 推送。设计依据中给出了一种思路：计算自订阅开始以来经过了多少个完整周期，把 `fee × periods` 视为已锁定，上限为持有者的有效余额。持有者可花费的余额是其有效余额减去进行中的订阅已消耗的部分。\n\n```\nintervals = (block.timestamp - start) / frequency\namount    = fee * intervals          // capped at effective balance\n```\n\n## 示例代码\n\n规范中的接口：\n\n```solidity\n// SPDX-License-Identifier: CC0-1.0\npragma solidity ^0.8.20;\n\ninterface ISubscriptionERC20 {\n    function subscribers(uint256 idx) external view returns (address);\n    function subscriptionInfo() external view returns (uint256, string memory, string memory, string memory);\n    function subscribe() external;\n    function unsubscribe() external;\n    function subscriptionFee() external view returns (uint256);\n    function subscriptionFrequency() external view returns (uint256);\n}\n```\n\n订阅前查看费用（ethers v6）：\n\n```ts\nconst [fee, freq] = await Promise.all([sub.subscriptionFee(), sub.subscriptionFrequency()]);\nconst perMonth = (fee * 30n * 86400n) / freq;\nconsole.log(`~${formatUnits(perMonth, 18)} tokens per 30 days`);\nawait (await sub.subscribe()).wait();\n```\n\n## 需要注意\n\n- 状态为 **Draft**，且文本比较松散。摘要中提到了 `nextPaymentDate` 和 `renewSubscription` 方法，但它们并未出现在接口中，计费公式也只是一个草图。预计各实现会有差异。\n- 由于余额会在没有交易的情况下随时间减少，`balanceOf` 可能逐块变化。缓存余额，或假定余额只会在 `Transfer` 事件时变化的集成可能出现异常。\n- 一个合约对应一项订阅服务，因此商户掌控着代币的扣费逻辑。订阅之前请先阅读它。\n- 对于使用现有代币付费的订阅，实践中基于 allowance 或账户抽象的方案更为常见。\n"}}}
