Implement participant rewards in phases:
- define reward policy in the manifest;
- create a deterministic reward calculation module;
- integrate contribution outputs from scoring;
- generate simulation reports;
- add compact contract accounting and claim flow.
The first delivery should work in simulation mode even before all on-chain reward settlement pieces are complete.
Make reward behavior explicit and task-specific.
Documentation/technical/manifest.mdcache_model_0/manifest.json- task registration or model-owner docs
- add a
reward_policyblock; - define
client_reward_pool,planned_global_iterations, budget mode, split mode, and unspent budget behavior; - document how
reward_policydepends onscoring_policy.contribution; - reject reward activation when required contribution outputs are unavailable.
Create a reusable module that calculates deterministic per-client rewards from policy and scoring outputs.
dincli/services/rewards.py
- load and validate
reward_policy; - validate required scoring and contribution outputs;
- select rewardable clients;
- calculate global-iteration budget;
- apply contribution weighting;
- apply optional max-share caps;
- handle rollover and rounding dust;
- generate a reward calculation report.
{
"task_id": task_id,
"global_iteration": gi,
"iteration_budget": iteration_budget,
"rollover_in": rollover_in,
"rollover_out": rollover_out,
"total_rewarded": total_rewarded,
"clients": [
{
"address": client_address,
"eligible": True,
"aggregated": True,
"contribution_score_bps": 7100,
"adjusted_contribution_bps": 7100,
"weight_bps": 4200,
"reward_amount": reward_amount,
}
],
"reward_report_cid": reward_report_cid,
}Consume only contribution-plane outputs for reward weighting while using admission-plane outputs as gates.
From scoring-mechanism/implementation.md:
cache_model_0/services/scoring.pycache_model_0/services/contribution.py- normalized auditor results;
contributionReportCID.
- wire reward calculation after contribution report generation;
- require admitted and aggregated model indexes by default;
- reject missing or stale contribution reports;
- include scoring policy hash and contribution report CID in reward reports.
Let model owners simulate and finalize participant rewards for a global iteration.
dincli modelowner rewards simulatedincli modelowner rewards calculatedincli modelowner rewards finalizedincli modelowner rewards status
- display client contribution scores and proposed rewards;
- warn when rewards are disabled or contribution mode is unavailable;
- upload reward reports to IPFS;
- submit compact reward summaries on chain when supported.
Add compact reward-pool and claim accounting without placing raw contribution math on chain.
foundry/src/DINTaskCoordinator.sol- potentially a new
foundry/src/DINTaskRewards.sol - mirrored Hardhat contracts if the repo keeps both contract sets
Add or introduce:
struct TaskRewardPool {
address token;
uint256 clientRewardPool;
uint256 totalPaid;
uint256 totalRollover;
uint256 plannedGlobalIterations;
bool initialized;
}
struct IterationRewardSummary {
uint256 iterationBudget;
uint256 totalRewarded;
uint256 rolloverOut;
bytes32 rewardReportCID;
bytes32 payoutRoot;
bool finalized;
}For DevNet, direct per-client finalized amounts are acceptable. For larger rounds, prefer a payout root and proof-based claims.
Candidate functions:
initializeClientRewardPool(taskId, token, amount, plannedGlobalIterations)finalizeIterationRewards(taskId, gi, iterationBudget, totalRewarded, rolloverOut, rewardReportCID, payoutRoot)claimClientReward(taskId, gi, amount, proof)getRewardPool(taskId)getIterationRewardSummary(taskId, gi)
Produce simulation results for WP 3.1 deliverables before relying on live claims.
tests/rewards/- or
dincli/services/rewards.pyunit tests plus ascripts/simulate_rewards.py
- number of global iterations;
- client count per iteration;
- reward pool size;
- eligibility rate;
- contribution score distribution;
- anomaly rate;
- max-share cap;
- rollover policy.
- per-client payouts;
- per-iteration budget usage;
- unspent rollover;
- concentration metrics;
- proof that total paid never exceeds pool;
- examples for equal, skewed, zero, and adversarial contribution distributions.
Add tests for:
- equal contribution split;
- weighted contribution split;
- ineligible clients receive zero;
- missing contribution outputs disable payout;
- zero contribution rolls budget forward;
- max-client-share cap;
- deterministic rounding behavior;
- total paid never exceeds client pool.
Add tests for:
- reward pool initialization;
- iteration reward finalization;
- duplicate finalization rejection;
- claim once only;
- over-claim rejection;
- total paid bound;
- CID and payout-root storage.
- add manifest
reward_policy; - implement
dincli/services/rewards.py; - consume mocked contribution outputs;
- generate local reward reports.
- consume real contribution reports from the scoring layer;
- produce simulation results for representative global iterations;
- document fairness outcomes.
- add reward-pool and iteration-summary storage;
- finalize reward reports on chain;
- keep claims simple for DevNet.
- add claim flow;
- add proof-based payout root if participant counts require it;
- integrate CLI status and claim commands.
Implementation is complete when:
reward_policyis documented and parsed;- reward calculation consumes contribution-plane scoring outputs;
- per-global-iteration budgets are deterministic;
- per-client rewards are contribution-weighted;
- ineligible clients receive zero;
- rollover and rounding are handled by policy;
- simulation results are generated;
- compact reward summaries can be finalized on chain or prepared for that path.