Skip to content

Reward Currency Design

O edited this page Dec 23, 2025 · 1 revision

Reward Currency Design Analysis

Problem Statement

Different types of rewards should be paid in different currencies based on their purpose:

  1. Measurement Rewards: Should be paid in the same O currency as the measurement (e.g., water price in EUR β†’ pay in OEUR)
  2. Stabilization Mining Rewards: Should be paid in the same O currency being stabilized (e.g., stabilizing OEUR β†’ pay in OEUR)
  3. Traditional Mining (PoW/PoB): Should be in a fixed currency since hardware costs are USD-based globally

Current Implementation Analysis

Traditional Mining Rewards (PoW/PoB)

  • Current: Hardcoded as 2,800 OUSD per block
  • Rationale: βœ… Correct - Hardware costs are similar in USD worldwide
  • Status: Already using OUSD βœ“

Measurement Rewards

  • Current: Uses generic CAmount reward_amount without currency specification
  • Issue: Not currency-aware - all rewards likely paid in same currency
  • Need: Should extract currency from measurement and pay in matching O currency

Stabilization Mining Rewards

  • Current: Creates rewards for unstable currencies but doesn't specify payment currency
  • Issue: Amount stored as CAmount (generic), not currency-specific
  • Need: Should pay in the currency being stabilized (e.g., stabilizing OEUR β†’ pay in OEUR)

Proposed Design

1. Traditional Mining Rewards (PoW/PoB)

Decision: Use OUSD

  • Rationale: Hardware costs are similar in USD globally
  • Implementation: Already correct βœ“
  • Block Reward: 2,800 OUSD per block
  • PoB Reward: 2,240 OUSD per block

2. Measurement Rewards

Decision: Pay in the submitter's birth currency (not the measurement currency)

  • Rationale: Users from different countries are invited to submit measurements
  • They may submit measurements for currencies different from their birth currency
  • Users should be rewarded in their own birth currency for ease of use
  • Example: User from Mexico (birth currency OMXN) submits EUR water price β†’ Pay in OMXN
  • Implementation: Extract birth currency from user's public key via BrightID database

3. Stabilization Mining Rewards

Decision: Pay in the same O currency being stabilized

  • Stabilizing OEUR β†’ Pay recipients in OEUR
  • Stabilizing OMXN β†’ Pay recipients in OMXN
  • Rationale: Recipients in that currency region can use the reward directly
  • Implementation: Use the unstable currency code to create currency-specific rewards

Implementation Status

Completed Changes

  1. Traditional Mining (src/consensus/o_rewards.h):

    • βœ… Already using OUSD
    • βœ… Documented rationale (hardware costs in USD globally)
  2. Measurement Rewards (src/consensus/measurement_rewards.h):

    • βœ… Added reward_currency field to MeasurementRewardTransaction
    • βœ… Updated serialization to include currency
    • ⏳ TODO: Extract currency from measurement data when creating rewards
    • ⏳ TODO: Convert fiat currency code (USD, EUR) to O currency code (OUSD, OEUR)
  3. Stabilization Mining (src/consensus/stabilization_helpers.cpp):

    • βœ… Currency already tracked in unstable_currency field
    • βœ… Added logging to indicate currency being paid
    • ⏳ TODO: Extract currency from measurement data when creating rewards
    • ⏳ TODO: Use multi-currency outputs when fully integrated

Future Work

Multi-Currency Transaction Integration:

  • Currently rewards use legacy CTxOut (single currency)
  • When multi-currency transactions are fully integrated:
    • Use CMultiCurrencyTxOut for measurement rewards
    • Use CMultiCurrencyTxOut for stabilization rewards
    • Convert currency codes to CurrencyId using CurrencyRegistry::GetCurrencyId()
    • Create outputs with appropriate MultiCurrencyAmount for each currency

Currency Decision Summary

Reward Type Currency Rationale
PoW Block Mining OUSD Hardware costs are USD-based globally
PoB Block Mining OUSD Hardware costs are USD-based globally
Measurement Rewards Submitter's birth currency Users from different countries submit measurements; reward them in their own currency
Stabilization Rewards Same as unstable currency Reward stabilization in the affected currency

Multi-Currency Transaction Support

O Blockchain already has multi-currency support (CMultiCurrencyTxOut). We need to:

  1. Use multi-currency outputs for measurement and stabilization rewards
  2. Keep traditional mining rewards in single-currency (OUSD) for simplicity
  3. Ensure currency conversion is handled correctly

Clone this wiki locally