Skip to content

CheckerNetwork/spark-rewards

Folders and files

NameName
Last commit message
Last commit date
May 7, 2025
Apr 15, 2025
Oct 1, 2024
Mar 10, 2025
Mar 10, 2025
Oct 1, 2024
Mar 10, 2025
May 9, 2025
Oct 1, 2024
Oct 1, 2024
Feb 24, 2025
Mar 10, 2025
May 14, 2025
May 14, 2025
Nov 7, 2024
Mar 10, 2025

Repository files navigation

spark-rewards

This implements revision D of Meridian: Off-chain scheduled rewards.

Routes

GET /scheduled-rewards

Response:

{
  "address": "scheduledRewardsInAttoFIL",
  // ...
}

GET /scheduled-rewards/:address

Response:

"scheduledRewardsInAttoFIL"

POST /scores

Request:

{
  "participants": ["address" /* ... */],
  "scores": ["score" /* ... */],
  "signature": {
    "r": "...",
    "s": "...",
    "v": "..."
  }
}

Sign over a packed keccak256 with this schema:

['address[]', 'uint256[]']

The response includes the resulting scheduled rewards of all affected participants (excluding the burner address):

{
  "address": "scheduledRewardsInAttoFIL",
  // ...
}

POST /paid

Request:

{
  "participants": ["address" /* ... */],
  "rewards": ["amountInAttoFIL", /* ... */],
  "signature": {
    "r": "...",
    "s": "...",
    "v": "..."
  }
}

Sign over a packed keccak256 with this schema:

['address[]', 'uint256[]']

The response includes the resulting scheduled rewards of all affected participants:

{
  "adddress": "scheduledRewardsInAttoFIL",
  // ...
}

GET /log

The log endpoint returns an audit trail of all scheduled rewards changes over time:

[
  {
    timestamp: "2024-08-28T14:15:08.113Z",
    address: "address",
    scheduledRewardsDelta: "amountInAttoFIL",
    score: "score"
  }, {
    timestamp: "2024-08-28T14:15:25.441Z",
    address: "address",
    scheduledRewardsDelta: "negativeAmountInAttoFIL"
    // In case of a payout, no `score` is logged
  }
  // ...
]

Development

redis-server &
npm start