Introduction
Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.
I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.
I also build and publish a variety of tools, libraries, and open-source projects.
ERC1973 proposes a decentralized token reward system that automatically adjusts reward distribution according to the number of participants in a DApp.
This article translates, summarizes, and expands on the proposal linked below.
I have also covered a range of other EIPs.
Overview
ERC1973 describes a mechanism for distributing tokens issued per block equally among active participants in a decentralized application (DApp). It provides a standard interface for minting tokens and distributing them fairly to participants in a DApp ecosystem.
Tokens are issued on a per-block basis at a configurable rate (for example, 10.2356, 0.1, or 1350 tokens per block). The interface uses a pull-based design: participants can claim their own rewards, making token distribution fully decentralized.
The number of tokens allocated to each participant changes dynamically with the participant count. Early participants receive larger individual rewards when the network is small. As the network grows and more participants join, the reward per participant naturally decreases.
Motivation
Traditional token distributions have often relied on a push-based model. The DApp iterates over the addresses of all participants and sends tokens to them in a batch. On blockchains such as Ethereum, however, the amount of computation that can be performed in a transaction is constrained by the block gas limit. As the participant count grows, distributing tokens becomes increasingly expensive and eventually impractical.
For example, even distributing as little as 0.0000001 tokens to each of 5000 addresses requires a substantial amount of gas. The DApp operator also has to pay the gas fees for submitting that transaction, which tends to centralize the operation.
A pull-based mechanism, in which each participant claims their own rewards, addresses this problem. At the time of the proposal, however, there was no standard mechanism for using this approach to distribute rewards efficiently to tens of thousands of participants.
ERC1973 introduces concepts such as TPP (Token Per Participant), a round mask, and participant masks to enable efficient, decentralized reward distribution. DApp developers can thus minimize their gas costs while designing sustainable reward systems for large networks.
Specification
Definitions
TPP (Token Per Participant)
TPP is the amount of tokens allocated to each participant in the ecosystem.
It is calculated by dividing the number of tokens minted per block by the number of active participants at that time.
For example, if 10 tokens are minted and there are 100 active participants, the TPP is 10 / 100 = 0.1 tokens.
This metric enables rewards to adjust dynamically as participants join or leave. When the number of participants is small, each receives a larger reward. The individual reward decreases naturally as more participants join.
What is roundMask?
The roundMask is a snapshot of the cumulative TPP across all previous blocks. It maintains the overall reward history and is updated over time.
Consider two minting events:
- First event 10 tokens are minted for 100 participants → TPP = 10 / 100
- Second event 12 tokens are minted for 95 participants → TPP = 12 / 95
The roundMask is then the sum 10/100 + 12/95.
This value is shared across the smart contract and serves as a common reference for calculating every participant's rewards.
What is participantMask?
The participantMask is a value used to track each participant's (msg.sender) individual reward entitlement.
The mask is updated when a participant joins or leaves the network.
When a participant joins, the preceding roundMask is recorded as their participantMask. It acts as a checkpoint from which the participant's rewards accrue.
Calculating rewards
Rewards are calculated as follows.
報酬 = 現在の roundMask - その参加者の participantMaskThe reward equals the difference between the cumulative reward across the network and the cumulative reward at the time the participant joined.
Reward calculation example
Consider the following conditions.
- 20 tokens are minted in each transaction.
- There are initially 10 participants.
- An eleventh participant joins at t2 and leaves before t5.
The roundMask changes as follows.
t1: roundMask = 20 / 10
t2: roundMask += 20 / 11
t3: roundMask += 20 / 11
t4: roundMask += 20 / 11
t5: roundMask += 20 / 10
t6: roundMask += 20 / 10The eleventh participant's participantMask when joining at t2 is 20 / 10. Since they leave before t5, their reward is calculated as follows.
[(20 / 11) + (20 / 11) + (20 / 11)] = 合計報酬In other words, the participant receives the increase in roundMask from t2 through t4.
Rejoining the network
If a participant who previously left rejoins the network at any later point (for example, t27 or t35), a new participantMask is assigned based on the roundMask at that time. This makes it possible to calculate rewards for each period of participation, even when a participant joins and leaves repeatedly.
What is tokensPerBlock?
This value specifies the amount of new tokens issued per block. It can be configured according to the network's growth and reward design (for example, 0.1, 10, or 1000 tokens).
What is blockFreezeInterval?
This parameter defines the number of blocks between permitted minting events. For example, if it is set to 50 and a mint occurs at block number 100, the next mint cannot occur before block 150. This helps prevent excessive reward issuance and control inflation. The example describes the intended interval; the reference implementation below uses a strict greater-than comparison, so with those parameters it first permits minting at block 151.
What is lastMintedBlockNumber?
This value records the block number at which tokens were last minted. Together with blockFreezeInterval, it determines when another mint is permitted.
What is totalParticipants?
This is the current number of active participants. It is used to calculate TPP and is updated whenever participants join or leave.
What is tokencontractAddress?
This is the token contract address that receives the minted tokens.
By default, it is the current contract itself (address(this)), but another address can be specified if needed.
This accommodates external ERC20 token contracts.
Interface
pragma solidity ^0.5.2;
import "openzeppelin-solidity/contracts/token/ERC20/ERC20Mintable.sol";
import "openzeppelin-solidity/contracts/token/ERC20/ERC20Detailed.sol";
contract Rewards is ERC20Mintable, ERC20Detailed {
using SafeMath for uint256;
uint256 public roundMask;
uint256 public lastMintedBlockNumber;
uint256 public totalParticipants = 0;
uint256 public tokensPerBlock;
uint256 public blockFreezeInterval;
address public tokencontractAddress = address(this);
mapping(address => uint256) public participantMask;
/**
* @dev constructor, initializes variables.
* @param _tokensPerBlock The amount of token that will be released per block, entered in wei format (E.g. 1000000000000000000)
* @param _blockFreezeInterval The amount of blocks that need to pass (E.g. 1, 10, 100) before more tokens are brought into the ecosystem.
*/
constructor(
uint256 _tokensPerBlock, uint256 _blockFreezeInterval
) public ERC20Detailed("Simple Token", "SIM", 18){
lastMintedBlockNumber = block.number;
tokensPerBlock = _tokensPerBlock;
blockFreezeInterval = _blockFreezeInterval;
}
/**
* @dev Modifier to check if msg.sender is whitelisted as a minter.
*/
modifier isAuthorized() {
require(isMinter(msg.sender));
_;
}
/**
* @dev Function to add participants in the network.
* @param _minter The address that will be able to mint tokens.
* @return A boolean that indicates if the operation was successful.
*/
function addMinters(address _minter) external returns (bool) {
_addMinter(_minter);
totalParticipants = totalParticipants.add(1);
updateParticipantMask(_minter);
return true;
}
/**
* @dev Function to remove participants in the network.
* @param _minter The address that will be unable to mint tokens.
* @return A boolean that indicates if the operation was successful.
*/
function removeMinters(address _minter) external returns (bool) {
totalParticipants = totalParticipants.sub(1);
_removeMinter(_minter);
return true;
}
/**
* @dev Function to introduce new tokens in the network.
* @return A boolean that indicates if the operation was successful.
*/
function trigger() external isAuthorized returns (bool) {
bool res = readyToMint();
if(res == false) {
return false;
} else {
mintTokens();
return true;
}
}
/**
* @dev Function to withdraw rewarded tokens by a participant.
* @return A boolean that indicates if the operation was successful.
*/
function withdraw() external isAuthorized returns (bool) {
uint256 amount = calculateRewards();
require(amount >0);
ERC20(tokencontractAddress).transfer(msg.sender, amount);
}
/**
* @dev Function to check if new tokens are ready to be minted.
* @return A boolean that indicates if the operation was successful.
*/
function readyToMint() public view returns (bool) {
uint256 currentBlockNumber = block.number;
uint256 lastBlockNumber = lastMintedBlockNumber;
if(currentBlockNumber > lastBlockNumber + blockFreezeInterval) {
return true;
} else {
return false;
}
}
/**
* @dev Function to calculate current rewards for a participant.
* @return A uint that returns the calculated rewards amount.
*/
function calculateRewards() private returns (uint256) {
uint256 playerMask = participantMask[msg.sender];
uint256 rewards = roundMask.sub(playerMask);
updateParticipantMask(msg.sender);
return rewards;
}
/**
* @dev Function to mint new tokens into the economy.
* @return A boolean that indicates if the operation was successful.
*/
function mintTokens() private returns (bool) {
uint256 currentBlockNumber = block.number;
uint256 tokenReleaseAmount = (currentBlockNumber.sub(lastMintedBlockNumber)).mul(tokensPerBlock);
lastMintedBlockNumber = currentBlockNumber;
mint(tokencontractAddress, tokenReleaseAmount);
calculateTPP(tokenReleaseAmount);
return true;
}
/**
* @dev Function to calculate TPP (token amount per participant).
* @return A boolean that indicates if the operation was successful.
*/
function calculateTPP(uint256 tokens) private returns (bool) {
uint256 tpp = tokens.div(totalParticipants);
updateRoundMask(tpp);
return true;
}
/**
* @dev Function to update round mask.
* @return A boolean that indicates if the operation was successful.
*/
function updateRoundMask(uint256 tpp) private returns (bool) {
roundMask = roundMask.add(tpp);
return true;
}
/**
* @dev Function to update participant mask (store the previous round mask)
* @return A boolean that indicates if the operation was successful.
*/
function updateParticipantMask(address participant) private returns (bool) {
uint256 previousRoundMask = roundMask;
participantMask[participant] = previousRoundMask;
return true;
}
}Variables and modifier
roundMask
uint256 public roundMask;A variable that records the cumulative reward snapshot. It stores the total amount of tokens distributed per participant across all previous minting events. It serves as the reference for calculating each participant's rewards.
Parameter
roundMask- The cumulative token distribution value.
lastMintedBlockNumber
uint256 public lastMintedBlockNumber;A variable that records the block number of the last mint.
It is used with blockFreezeInterval to control when the next mint can occur.
Parameter
lastMintedBlockNumber- The block number of the most recent mint.
totalParticipants
uint256 public totalParticipants = 0;A variable that records the current number of active participants.
It is used to calculate the token distribution per participant (TPP).
Its value changes through the addMinters or removeMinters functions.
Parameter
totalParticipants- The number of active minters.
tokensPerBlock
uint256 public tokensPerBlock;A variable that records the number of tokens minted per block. It controls the rate of token issuance.
Parameter
tokensPerBlock- The amount of tokens generated per block, expressed in wei.
blockFreezeInterval
uint256 public blockFreezeInterval;A variable that controls the minting interval in blocks. A new mint is not permitted until the specified number of blocks has elapsed since the last mint.
Parameter
blockFreezeInterval- The number of blocks to wait before minting becomes available.
tokencontractAddress
address public tokencontractAddress = address(this);The address of the token used for reward transfers. By default, the contract itself is an ERC20 token and pays rewards out of its own balance.
Parameter
tokencontractAddress- The address from which tokens are transferred.
participantMask
mapping(address => uint256) public participantMask;A mapping that records the reference value used to calculate rewards for each participant.
It stores a snapshot of roundMask at the time the participant last withdrew rewards or first joined.
Parameter
participantMask- The roundMask reference value for each participant address.
isAuthorized
modifier isAuthorized() {
require(isMinter(msg.sender));
_;
}A modifier that checks whether the caller is a minter.
It ensures that msg.sender is a minter authorized by the isMinter function of ERC20Mintable.
Parameter
msg.sender- The caller address checked for minter authorization.
Functions
addMinters
function addMinters(address _minter) external returns (bool) {
_addMinter(_minter);
totalParticipants = totalParticipants.add(1);
updateParticipantMask(_minter);
return true;
}Adds a new minter (participant). It registers the supplied address as a minter, increments the participant count by one, and updates the participantMask for that address.
Argument
_minter- The address to register as a minter.
Return value
true- Returns
trueon success.
- Returns
removeMinters
function removeMinters(address _minter) external returns (bool) {
totalParticipants = totalParticipants.sub(1);
_removeMinter(_minter);
return true;
}Removes an existing minter from the network. It revokes the address's minter privileges and decrements the participant count by one.
Argument
_minter- The address of the minter to remove.
Return value
true- Returns
trueon success.
- Returns
trigger
function trigger() external isAuthorized returns (bool) {
bool res = readyToMint();
if(res == false) {
return false;
} else {
mintTokens();
return true;
}
}Mints tokens when the minting condition is met. If the required number of blocks has elapsed since the previous mint, it mints new tokens.
Return values
true- Minting succeeded.
false- The minting condition has not been met.
withdraw
function withdraw() external isAuthorized returns (bool) {
uint256 amount = calculateRewards();
require(amount >0);
ERC20(tokencontractAddress).transfer(msg.sender, amount);
}Allows a participant to withdraw their rewards.
It transfers the amount calculated by calculateRewards from the contract to msg.sender.
readyToMint
function readyToMint() public view returns (bool) {
uint256 currentBlockNumber = block.number;
uint256 lastBlockNumber = lastMintedBlockNumber;
if(currentBlockNumber > lastBlockNumber + blockFreezeInterval) {
return true;
} else {
return false;
}
}Checks whether new tokens can be minted. It determines whether the configured block interval has elapsed since the last mint.
Return values
true- Minting is permitted.
false- Minting is not yet permitted.
calculateRewards
function calculateRewards() private returns (uint256) {
uint256 playerMask = participantMask[msg.sender];
uint256 rewards = roundMask.sub(playerMask);
updateParticipantMask(msg.sender);
return rewards;
}Calculates the rewards allocated to a participant.
It determines the amount available to claim from the difference between roundMask and the participant's participantMask.
Return value
rewards- The amount of tokens msg.sender can receive.
mintTokens
function mintTokens() private returns (bool) {
uint256 currentBlockNumber = block.number;
uint256 tokenReleaseAmount = (currentBlockNumber.sub(lastMintedBlockNumber)).mul(tokensPerBlock);
lastMintedBlockNumber = currentBlockNumber;
mint(tokencontractAddress, tokenReleaseAmount);
calculateTPP(tokenReleaseAmount);
return true;
}Mints new tokens. It calculates the number of elapsed blocks and the resulting issuance amount, mints tokens to the contract, and updates TPP.
Return value
true- Minting succeeded.
calculateTPP
function calculateTPP(uint256 tokens) private returns (bool) {
uint256 tpp = tokens.div(totalParticipants);
updateRoundMask(tpp);
return true;
}Calculates the number of tokens distributed per participant (TPP).
It divides the total number of minted tokens by the participant count and updates roundMask with the resulting TPP.
Argument
tokens- The total amount of tokens minted in this event.
Return value
true- The calculation succeeded.
updateRoundMask
function updateRoundMask(uint256 tpp) private returns (bool) {
roundMask = roundMask.add(tpp);
return true;
}Updates roundMask.
It adds the new TPP value to update the cumulative reward snapshot.
Argument
tpp- The reward per participant.
Return value
true- The update succeeded.
updateParticipantMask
function updateParticipantMask(address participant) private returns (bool) {
uint256 previousRoundMask = roundMask;
participantMask[participant] = previousRoundMask;
return true;
}Updates an individual participant's mask.
It records roundMask at the point when the participant claims rewards or joins the network.
Argument
participant- The participant's address.
Return value
true- The snapshot was recorded successfully.
Additional context
Background
Incentives (rewards) play an important role in building a healthy and sustainable token economy within a DApp. They motivate participants to contribute to the network. At the time of the proposal, there was no standard mechanism for distributing rewards efficiently and equally to tens of thousands of participants.
Many DApps actually control reward distribution on the server side, relying on centralized infrastructure. Although they use a decentralized blockchain as their underlying platform, the reward mechanism itself remains centralized.
Problems with centralized reward distribution
Many DApps with functioning, sustainable token reward systems rely on centralized servers or a trusted group of nodes to periodically execute smart contracts and distribute tokens. This approach introduces several problems.
- A limited set of executors reduces censorship resistance.
- Dependence on an administrator prevents true autonomy.
- Reward distribution stops if the executing infrastructure fails.
The reward distribution mechanism can therefore undermine the decentralization of the entire DApp.
Objective of ERC1973
ERC1973 was designed to address these problems. Its central idea is to delegate reward distribution to the network participants themselves. Any participant can trigger the distribution, and the amount distributed is automatically adjusted according to the current number of participants.
This approach offers the following benefits.
- Removing the dependency on servers or specific nodes enables full decentralization.
- Adjusting the reward amount as participants join or leave makes the distribution scalable.
- Allowing any participant to trigger distribution supports an open, participatory economy.
ERC1973 is intended to serve as a foundation for autonomous, scalable incentive structures in DApps. Standardizing reward distribution is important to building genuinely decentralized applications.
Reference implementation
Introduction
ERC1973 proposes a mechanism for building scalable, decentralized reward distribution systems. As a historical working example, the proposal presents a contract deployed on Ropsten and the sequence of reward operations performed with it. Ropsten has since been retired. The following walkthrough explains what happens at each step.
Reference contract: Etherscan - Rewards contract (Ropsten)
Step 1: Deploy the contract
First, deploy the Rewards contract with the following two initial parameters.
_tokensPerBlock1e18(= 1 SIM token)_blockFreezeInterval1(= minting is possible every block)
This sets the issuance rate to 1 SIM token per block and the minimum block interval to one block.
Step 2: Register participants
Register the following two initial participants as minters (actors authorized to trigger rewards).
- Alice (address:
0x123) - Bob (address:
0x456)
Using addMinters(address) registers both participants in the network and makes them eligible for reward distribution.
Step 3: Trigger rewards and mint tokens (first round)
Either Alice or Bob calls trigger().
At this point, 65 blocks have elapsed since the previous mint, so 65 new SIM tokens are minted.
- Total issuance: 65 SIM
- Participants: 2 (Alice and Bob)
- Reward per participant (TPP): 32.5 SIM
The resulting roundMask(RM) is 32500000000000000000 (= 32.5 * 10^18).
Step 4: Alice withdraws her rewards
Alice calls withdraw() to claim her accumulated rewards.
- Amount received: 32.5 SIM
participantMask(PM): Alice's reward checkpoint is updated to32500000000000000000.
Step 5: Add participants (Satoshi and Vitalik)
Add two new participants.
- Satoshi (address:
0x321) - Vitalik (address:
0x654)
There are now four participants in total.
Step 6: Trigger rewards and mint tokens (second round)
When Alice, Bob, Satoshi, or Vitalik calls trigger() again, 101 blocks have elapsed and 101 SIM tokens are minted.
- Total issuance: 101 SIM
- Participants: 4
- Reward per participant (TPP): 25.25 SIM
The roundMask is updated as follows.
新RM = 32500000000000000000 + 25250000000000000000 = 57750000000000000000Step 7: Alice withdraws her rewards again
Alice claims her second reward. Her entitlement is the difference from her previous checkpoint.
- Difference:
57750000000000000000 - 32500000000000000000 = 25250000000000000000 - Amount received: 25.25 SIM
participantMask: Alice's PM is updated to57750000000000000000.
Step 8: Bob withdraws his rewards
Bob has not yet called withdraw(), so he receives the rewards from both rounds in one withdrawal.
- First round: 32.5 SIM (65 / 2)
- Second round: 25.25 SIM (101 / 4)
- Total: 57.75 SIM
participantMask: Bob's PM is also updated to57750000000000000000.
Citation
Lee Raj (@lerajk), Qin Jian (@qinjian), "ERC-1973: Scalable Rewards [DRAFT]," Ethereum Improvement Proposals, no. 1973, April 2019. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-1973.
Conclusion
ERC1973 proposes a decentralized token reward system that automatically adjusts reward distribution based on the number of participants in a DApp. This article covered that mechanism.
If you have any questions about the topic covered here, feel free to reach out via Twitter DM.
I also share technical content on other platforms.



