Skip to content

Balance Rewards

The Balance Rewards feature is a unique aspect of the Xahau network that allows users to accumulate and claim rewards based on their account balance. This feature is implemented through a combination of native code (BalanceRewards Amendment) and hook code (Genesis Account’s Reward Hook).

A ClaimReward transaction allows an account to claim the rewards it has accumulated. The rewards can be claimed by the account owner or by a specified issuer. The account can also opt-out of rewards by setting the Flags field to 1.

The GenesisMint transaction type is also associated with the Balance Rewards feature. This is an Emitted transaction that is executed through the Reward Hook every time a user claims balance rewards.

(Requires the IOURewardClaim amendment.)

The IOURewardClaim amendment extends the reward mechanic to IOU currencies issued by any account. The same area-under-the-curve calculation (hold time × hold amount) that governs XAH genesis rewards is applied to IOU token holders, with the issuer’s Hook controlling payout logic.

  1. Opt-in: A token holder submits a ClaimReward transaction with the ClaimCurrency field specifying the IOU. This initialises reward-tracking counters (LowReward or HighReward) directly on the trustline (RippleState ledger object).
  2. Accumulation: After every transaction that modifies the trustline balance, the ledger automatically updates the TrustLineRewardAccumulator field. This tracks the cumulative product of balance × ledgers elapsed since the last reset.
  3. Claim: When the holder submits another ClaimReward with ClaimCurrency, the ledger resets the counters and fires the issuer’s Hook (which must be installed and must fire on ClaimReward transaction). The Hook reads the accumulated value and emits a reward payment in whatever form the issuer chooses.
XAH Genesis RewardsIOU Rewards
AmendmentBalanceRewardsIOURewardClaim
Counters stored onAccountRootRippleState (trustline)
Accumulator typeUInt64 (drops / 1,000,000)Amount (in the token’s units)
Payout handled byGenesis account HookIssuer account Hook
Issuer restrictionMust be genesis accountAny account with a Hook on ClaimReward transaction, except AMM accounts