{"eip":1973,"title":"Scalable Rewards","description":"A mintable token rewards interface that mints 'n' tokens per block which are distributed equally among the 'm' participants in the DAPP's ecosystem.","authors":["Lee Raj (@lerajk)","Qin Jian (@qinjian)"],"status":"Stagnant","type":"Standards Track","category":"ERC","created":"2019-04-01","repo":"ERCs","label":"ERC-1973","officialUrl":"https://eips.ethereum.org/EIPS/eip-1973","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-1973.md","url":"https://eips.huatuo.xyz/eip-1973/","tldr":{"en":"A pattern for minting a fixed number of tokens per block and splitting them equally among a changing set of participants, using cumulative 'masks' so each person pulls their own reward in O(1) gas.","ja":"ブロックごとに固定数のトークンをミントし、参加者の増減に応じて全員に均等に分配するパターン。累積の「マスク」を使い、各参加者が O(1) のガスで自分の報酬を引き出せる。","ko":"블록마다 고정된 수의 토큰을 발행해 변동하는 참가자들에게 똑같이 나누는 패턴. 누적 '마스크'를 사용해 각자 O(1) 가스로 자기 보상을 가져간다.","zh":"一种按区块铸造固定数量代币、并在不断变化的参与者之间平均分配的模式，借助累计的“掩码”，每个人只需 O(1) 的 gas 即可领取自己的奖励。"},"tags":["token","rewards","distribution","pull-payment"],"explainers":{"en":{"lang":"en","tldr":"A pattern for minting a fixed number of tokens per block and splitting them equally among a changing set of participants, using cumulative 'masks' so each person pulls their own reward in O(1) gas.","tags":["token","rewards","distribution","pull-payment"],"related":[20],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-1973/","markdown":"## What problem does it solve?\n\nPaying rewards to many participants by looping over them (\"push\") does not scale: with thousands of addresses the loop exceeds the block gas limit, and whoever runs it pays all the gas. ERC-1973 proposes a **pull** design where each participant claims their own share whenever they like, and the cost of each operation does not depend on how many participants exist.\n\nRewards are minted per block, so early participants (when the set is small) earn a larger share each, and the per-person amount shrinks as the network grows.\n\n## How it works\n\nThe design is a running-sum accumulator:\n\n- **TPP (tokens per participant):** each time new tokens are minted, `TPP = minted / totalParticipants`.\n- **roundMask:** the running total of every TPP so far. It answers \"how much would one participant have earned since the beginning?\"\n- **participantMask:** a snapshot of `roundMask` taken when a participant joins or last withdrew.\n- **Reward owed:** `roundMask - participantMask`. After withdrawing, the participant's mask is reset to the current `roundMask`.\n\nMinting is rate-limited: `tokensPerBlock` sets the issuance, and `blockFreezeInterval` is how many blocks must pass before another mint. When a mint runs, it issues `(currentBlock - lastMintedBlock) * tokensPerBlock` tokens to the contract. Any participant can trigger it.\n\nWorked example from the spec: 65 blocks pass with 2 participants, so `roundMask` grows by 32.5 tokens. Two more join, 101 blocks pass with 4 participants, adding 25.25. A participant who never withdrew is owed `32.5 + 25.25 = 57.75`.\n\n## Sample code\n\nThe accounting core, simplified to modern Solidity (no access control or mint scheduling):\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ncontract RewardMasks {\n    uint256 public roundMask;           // cumulative tokens-per-participant\n    uint256 public totalParticipants;\n    mapping(address =\u003e uint256) public participantMask;\n\n    function _join(address p) internal {\n        totalParticipants += 1;\n        participantMask[p] = roundMask;   // start earning from now\n    }\n\n    function _distribute(uint256 minted) internal {\n        require(totalParticipants \u003e 0, \"no participants\");\n        roundMask += minted / totalParticipants;\n    }\n\n    function _claim(address p) internal returns (uint256 owed) {\n        owed = roundMask - participantMask[p];\n        participantMask[p] = roundMask;\n        // transfer `owed` tokens to p\n    }\n}\n```\n\n## Things to know\n\n- Status is **Stagnant**, with no finished reference implementation (the spec's test cases and implementation are marked WIP).\n- The spec's sample contract has gaps: integer division by `totalParticipants` loses precision (real implementations scale by e.g. `1e18`), `removeMinters` does not settle the leaving participant's rewards, and `withdraw` returns no value. Do not deploy it as-is.\n- The same accumulator idea is widely used in staking and liquidity-mining contracts, usually weighted by stake rather than one equal share per participant.\n- Who counts as a \"participant\" is entirely up to the deployer; in the sample, adding participants is unrestricted.\n"},"ja":{"lang":"ja","tldr":"ブロックごとに固定数のトークンをミントし、参加者の増減に応じて全員に均等に分配するパターン。累積の「マスク」を使い、各参加者が O(1) のガスで自分の報酬を引き出せる。","tags":["token","rewards","distribution","pull-payment"],"related":[20],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-1973/","markdown":"## 何を解決するのか\n\n多数の参加者に報酬をループで支払う方式（「プッシュ」）はスケールしません。アドレスが数千になるとループがブロックのガスリミットを超え、実行した人がすべてのガスを負担することになります。ERC-1973 は **プル** 型の設計を提案します。各参加者が好きなタイミングで自分の取り分を請求でき、各操作のコストは参加者の数に依存しません。\n\n報酬はブロックごとにミントされるため、参加者が少ない初期には一人あたりの取り分が大きく、ネットワークが成長するにつれて一人あたりの額は小さくなります。\n\n## 仕組み\n\nこの設計は累積和（running-sum）アキュムレーターです。\n\n- **TPP（tokens per participant、参加者あたりのトークン数）:** 新しいトークンがミントされるたびに、`TPP = minted / totalParticipants`。\n- **roundMask:** これまでのすべての TPP の累積合計。「最初から参加していた一人が、これまでにいくら稼いだか」を表します。\n- **participantMask:** 参加者が参加した時点、または最後に引き出した時点の `roundMask` のスナップショット。\n- **未払い報酬:** `roundMask - participantMask`。引き出した後、その参加者のマスクは現在の `roundMask` にリセットされます。\n\nミントにはレート制限があります。`tokensPerBlock` が発行量を決め、`blockFreezeInterval` は次のミントまでに経過すべきブロック数です。ミントが実行されると、`(currentBlock - lastMintedBlock) * tokensPerBlock` 個のトークンがコントラクトに発行されます。誰でもこれを起動できます。\n\n仕様にある計算例: 参加者 2 人で 65 ブロックが経過し、`roundMask` は 32.5 トークン増加します。さらに 2 人が参加し、参加者 4 人で 101 ブロックが経過して 25.25 が加算されます。一度も引き出していない参加者への未払い報酬は `32.5 + 25.25 = 57.75` です。\n\n## サンプルコード\n\n会計の中核部分を現代的な Solidity に簡略化したもの（アクセス制御やミントのスケジューリングなし）:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ncontract RewardMasks {\n    uint256 public roundMask;           // cumulative tokens-per-participant\n    uint256 public totalParticipants;\n    mapping(address =\u003e uint256) public participantMask;\n\n    function _join(address p) internal {\n        totalParticipants += 1;\n        participantMask[p] = roundMask;   // start earning from now\n    }\n\n    function _distribute(uint256 minted) internal {\n        require(totalParticipants \u003e 0, \"no participants\");\n        roundMask += minted / totalParticipants;\n    }\n\n    function _claim(address p) internal returns (uint256 owed) {\n        owed = roundMask - participantMask[p];\n        participantMask[p] = roundMask;\n        // transfer `owed` tokens to p\n    }\n}\n```\n## 知っておくべきこと\n\n- ステータスは **Stagnant** で、完成したリファレンス実装はありません（仕様のテストケースと実装は WIP と記されています）。\n- 仕様のサンプルコントラクトには不備があります。`totalParticipants` による整数除算は精度を失い（実際の実装では `1e18` などでスケーリングします）、`removeMinters` は退出する参加者の報酬を精算せず、`withdraw` は値を返しません。そのままデプロイしないでください。\n- 同じアキュムレーターの考え方は、ステーキングや流動性マイニングのコントラクトで広く使われています。通常は、参加者ごとの均等な取り分ではなくステーク量で重み付けされます。\n- 誰を「参加者」とみなすかは、デプロイ者の裁量に完全に委ねられています。サンプルでは参加者の追加に制限がありません。\n"},"ko":{"lang":"ko","tldr":"블록마다 고정된 수의 토큰을 발행해 변동하는 참가자들에게 똑같이 나누는 패턴. 누적 '마스크'를 사용해 각자 O(1) 가스로 자기 보상을 가져간다.","tags":["token","rewards","distribution","pull-payment"],"related":[20],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-1973/","markdown":"## 어떤 문제를 해결하나요?\n\n많은 참가자에게 반복문으로 보상을 지급하는 방식(\"푸시\")은 확장되지 않습니다. 주소가 수천 개가 되면 반복문이 블록 가스 한도를 넘고, 이를 실행한 사람이 가스를 전부 부담합니다. ERC-1973은 각 참가자가 원할 때 자기 몫을 직접 청구하는 **풀** 방식을 제안하며, 각 작업의 비용은 참가자 수와 무관합니다.\n\n보상은 블록마다 발행되므로 참가자가 적은 초기에는 1인당 몫이 크고, 네트워크가 커질수록 1인당 금액은 줄어듭니다.\n\n## 어떻게 동작하나요?\n\n이 설계는 누적 합(running-sum) 어큐뮬레이터입니다.\n\n- **TPP(tokens per participant, 참가자당 토큰 수):** 새 토큰이 발행될 때마다 `TPP = minted / totalParticipants`.\n- **roundMask:** 지금까지의 모든 TPP를 누적한 합계. \"처음부터 있던 참가자 한 명이 지금까지 얼마를 벌었을까?\"에 답합니다.\n- **participantMask:** 참가자가 합류했거나 마지막으로 인출한 시점의 `roundMask` 스냅샷.\n- **받을 보상:** `roundMask - participantMask`. 인출한 뒤에는 해당 참가자의 마스크가 현재 `roundMask`로 초기화됩니다.\n\n발행에는 속도 제한이 있습니다. `tokensPerBlock`이 발행량을 정하고, `blockFreezeInterval`은 다음 발행까지 지나야 하는 블록 수입니다. 발행이 실행되면 `(currentBlock - lastMintedBlock) * tokensPerBlock` 개의 토큰이 컨트랙트에 발행됩니다. 어떤 참가자든 이를 실행할 수 있습니다.\n\n명세의 예시: 참가자 2명으로 65블록이 지나 `roundMask`가 32.5 토큰 늘어납니다. 2명이 더 합류하고 참가자 4명으로 101블록이 지나 25.25가 더해집니다. 한 번도 인출하지 않은 참가자가 받을 보상은 `32.5 + 25.25 = 57.75`입니다.\n\n## 샘플 코드\n\n회계 핵심부를 최신 Solidity로 단순화한 것(접근 제어와 발행 스케줄링 없음):\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ncontract RewardMasks {\n    uint256 public roundMask;           // cumulative tokens-per-participant\n    uint256 public totalParticipants;\n    mapping(address =\u003e uint256) public participantMask;\n\n    function _join(address p) internal {\n        totalParticipants += 1;\n        participantMask[p] = roundMask;   // start earning from now\n    }\n\n    function _distribute(uint256 minted) internal {\n        require(totalParticipants \u003e 0, \"no participants\");\n        roundMask += minted / totalParticipants;\n    }\n\n    function _claim(address p) internal returns (uint256 owed) {\n        owed = roundMask - participantMask[p];\n        participantMask[p] = roundMask;\n        // transfer `owed` tokens to p\n    }\n}\n```\n## 알아둘 점\n\n- 상태는 **Stagnant**이며 완성된 레퍼런스 구현이 없습니다(명세의 테스트 케이스와 구현은 WIP로 표시되어 있습니다).\n- 명세의 샘플 컨트랙트에는 빈틈이 있습니다. `totalParticipants`로 나누는 정수 나눗셈은 정밀도를 잃고(실제 구현은 예를 들어 `1e18`로 스케일링합니다), `removeMinters`는 떠나는 참가자의 보상을 정산하지 않으며, `withdraw`는 값을 반환하지 않습니다. 그대로 배포하지 마세요.\n- 같은 어큐뮬레이터 아이디어는 스테이킹과 유동성 마이닝 컨트랙트에서 널리 쓰이며, 보통 참가자마다 똑같은 몫이 아니라 스테이크 양으로 가중치를 둡니다.\n- 누구를 \"참가자\"로 볼지는 전적으로 배포자에게 달려 있습니다. 샘플에서는 참가자 추가에 제한이 없습니다.\n"},"zh":{"lang":"zh","tldr":"一种按区块铸造固定数量代币、并在不断变化的参与者之间平均分配的模式，借助累计的“掩码”，每个人只需 O(1) 的 gas 即可领取自己的奖励。","tags":["token","rewards","distribution","pull-payment"],"related":[20],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-1973/","markdown":"## 它解决什么问题？\n\n用循环向大量参与者发放奖励（“推送”）无法扩展：地址达到数千个时，循环会超出区块 gas 上限，而且运行循环的人要承担全部 gas。ERC-1973 提出一种**拉取**式设计：每个参与者可随时领取自己的份额，且每次操作的成本与参与者数量无关。\n\n奖励按区块铸造，因此早期参与者（参与者集合较小时）每人获得的份额较大，随着网络增长，人均数额会逐渐变小。\n\n## 它如何运作\n\n该设计是一个累加和（running-sum）累加器：\n\n- **TPP（tokens per participant，每位参与者的代币数）：** 每次铸造新代币时，`TPP = minted / totalParticipants`。\n- **roundMask：** 迄今为止所有 TPP 的累计总和。它回答的问题是：“从一开始就在的一位参与者，到现在能赚多少？”\n- **participantMask：** 参与者加入或上次提取时记录的 `roundMask` 快照。\n- **应得奖励：** `roundMask - participantMask`。提取之后，该参与者的掩码会被重置为当前的 `roundMask`。\n\n铸造有速率限制：`tokensPerBlock` 设定发行量，`blockFreezeInterval` 是两次铸造之间必须经过的区块数。执行铸造时，会向合约发行 `(currentBlock - lastMintedBlock) * tokensPerBlock` 个代币。任何参与者都可以触发。\n\n规范中的算例：2 个参与者时过了 65 个区块，`roundMask` 增加 32.5 个代币。又有 2 人加入，4 个参与者时过了 101 个区块，增加 25.25。从未提取过的参与者应得 `32.5 + 25.25 = 57.75`。\n\n## 示例代码\n\n会计核心部分，简化为现代 Solidity（无访问控制，也没有铸造调度）：\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ncontract RewardMasks {\n    uint256 public roundMask;           // cumulative tokens-per-participant\n    uint256 public totalParticipants;\n    mapping(address =\u003e uint256) public participantMask;\n\n    function _join(address p) internal {\n        totalParticipants += 1;\n        participantMask[p] = roundMask;   // start earning from now\n    }\n\n    function _distribute(uint256 minted) internal {\n        require(totalParticipants \u003e 0, \"no participants\");\n        roundMask += minted / totalParticipants;\n    }\n\n    function _claim(address p) internal returns (uint256 owed) {\n        owed = roundMask - participantMask[p];\n        participantMask[p] = roundMask;\n        // transfer `owed` tokens to p\n    }\n}\n```\n## 需要注意\n\n- 状态为 **Stagnant**，没有完成的参考实现（规范中的测试用例和实现标注为 WIP）。\n- 规范中的示例合约存在缺陷：除以 `totalParticipants` 的整数除法会损失精度（实际实现会按例如 `1e18` 放大），`removeMinters` 不会结算离开的参与者的奖励，`withdraw` 也不返回任何值。请勿原样部署。\n- 同样的累加器思路在质押和流动性挖矿合约中被广泛使用，通常按质押量加权，而不是每位参与者平均分一份。\n- 谁算“参与者”完全由部署者决定；在示例中，添加参与者不受任何限制。\n"}}}
