Skip to main content

Consensus Mechanism

QoreChain implements Triple-Pool Composite Proof-of-Stake (CPoS), a consensus mechanism that classifies validators into three specialized pools and uses reputation-weighted selection to balance security, decentralization, and performance. CPoS is implemented in the x/qca module and operates on top of the QoreChain Consensus Engine.

The reinforcement-learning optimization layer that tunes consensus parameters at runtime is branded PRISM (Policy-driven Reinforcement-learning for Intelligent State Machines). See the PRISM Consensus Engine for details.

The diagram below summarizes one block/consensus cycle of Triple-Pool CPoS on the QoreChain Consensus Engine, and shows where PRISM feeds back into the tunable x/qca parameters.


Triple-Pool Architecture

CPoS divides the active validator set into three pools based on reputation, stake, and delegation metrics. Each pool serves a distinct role in the consensus process.

Pool Classification

PoolCriteriaSelection Weight
RPoS (Reputation Proof-of-Stake)Reputation score >= 70th percentile AND self-bonded stake >= median40%
DPoS (Delegated Proof-of-Stake)Total delegation >= 10,000 QOR35%
PoS (Standard Proof-of-Stake)All remaining active validators25%

Classification is evaluated with the following priority: RPoS > DPoS > PoS. A validator that qualifies for both RPoS and DPoS is assigned to RPoS.

Reclassification occurs every 1,000 blocks. At each reclassification epoch:

  1. Collect reputation scores — Reputation scores are collected from the x/reputation module for all active validators.
  2. Compute reputation threshold — The 70th-percentile reputation threshold is computed from the sorted score distribution.
  3. Compute median self-bonded stake — The median self-bonded stake is computed from the sorted stake distribution.
  4. Reassign validators — Each active validator is reassigned to the highest-priority pool for which it qualifies.
  5. Default assignment — Unclassified validators (those not yet evaluated) default to the PoS pool.

Pool-Weighted Proposer Selection

Block proposer selection follows a two-stage deterministic process.

Stage 1: Pool Selection

A deterministic random value selects which pool proposes the next block:

seed = SHA256(lastBlockHash || height || "pool")
randVal = uint64(seed[:8]) / MaxUint64 // uniform in [0, 1)

The pool is chosen by comparing randVal against cumulative weight thresholds:

  • randVal < 0.40 → RPoS pool
  • 0.40 <= randVal < 0.75 → DPoS pool
  • randVal >= 0.75 → PoS pool

Stage 2: Within-Pool Selection

Within the selected pool, the proposer is chosen via a reputation × stake weighted CDF. For each validator in the pool:

  1. The reputation score r is retrieved from x/reputation.
  2. The composite weight is w = r * tokens.
  3. A cumulative distribution function (CDF) is constructed from all composite weights.
  4. The proposer is selected using a deterministic random draw against the CDF, seeded by the block hash and height.

Fallback Behavior

If the selected pool is empty, the system falls back to the PoS pool. If the PoS pool is also empty, selection falls back to reputation-weighted selection across the full active validator set.


Custom Bonding Curve

Validator rewards are computed using a multi-factor bonding curve that incentivizes long-term participation, high reputation, and alignment with protocol growth phases.

Formula

R(v, t) = beta * S_v * (1 + alpha * ln(1 + L_v)) * Q(r_v) * P(t)

Factor Definitions

FactorSymbolDescriptionDefault
Base Reward MultiplierbetaScales the overall reward magnitude1.0
Self-Bonded StakeS_vThe validator's self-bonded tokens (uqor)--
Loyalty SensitivityalphaControls how much loyalty duration amplifies rewards0.1
Loyalty DurationL_vNumber of consecutive blocks the validator has been active--
Reputation QualityQ(r_v)Maps reputation r to a reward multiplier in [0.75, 1.25]--
Protocol PhaseP(t)Phase-dependent multiplier to bootstrap or moderate rewardsSee below

Reputation Quality Function

Q(r) = 1 + 0.5 * (r - 0.5)

The result is clamped to the range [0.75, 1.25]:

Reputation ScoreQ(r)
0.00.75
0.250.875
0.51.0
0.751.125
1.01.25

Protocol Phase Multipliers

PhaseP(t)Description
Genesis1.5Higher rewards to bootstrap the validator set
Growth1.0Standard rewards during network expansion
Mature0.8Reduced emission as the network stabilizes

Deterministic Math

The ln(1 + L_v) computation uses a Taylor series approximation with argument reduction (TaylorLn1PlusX), operating entirely on LegacyDec fixed-precision decimals. No floating-point arithmetic is used in consensus-critical reward calculations.


Progressive Slashing

QoreChain replaces flat slashing rates with a progressive penalty model that escalates consequences for repeat offenders while allowing infractions to decay over time.

Formula

penalty = base_rate * escalation_factor^effective_count * severity_factor

Temporal Decay

Past infractions contribute a decaying weight to the effective count:

effective_count = SUM( 0.5^(blocks_since_i / decay_halflife) )

For each past infraction i, the contribution halves every decay_halflife blocks (default: 100,000). This means a single old infraction at 200,000 blocks ago contributes only 0.25 to the effective count.

Severity Factors

Infraction TypeSeverity Factor
Downtime1.0
Double Sign2.0
Light Client Attack3.0

Maximum Penalty

The penalty is capped at 33% per slash event, regardless of how many past infractions a validator has accumulated.

Example Calculation

A validator with 2 prior infractions (one at 50,000 blocks ago, one at 150,000 blocks ago) commits a double-sign:

  1. Decay contributions:
    • Infraction 1: 0.5^(50000 / 100000) = 0.5^0.5 = 0.707
    • Infraction 2: 0.5^(150000 / 100000) = 0.5^1.5 = 0.354
    • effective_count = 0.707 + 0.354 = 1.061
  2. Escalation: 1.5^1.061 = 1.516
  3. Penalty: 0.01 * 1.516 * 2.0 = 0.0303 (3.03%)

Compare this to a first-time offender: 0.01 * 1.5^0 * 2.0 = 0.02 (2.0%).


QDRW Governance

QoreChain governance uses Quadratic Delegation with Reputation Weighting (QDRW) to prevent plutocratic capture while rewarding long-term network participants.

Voting Power Formula

VP(v) = sqrt(staked + 2 * xQORE) * ReputationMultiplier(r)

Where:

  • staked = the voter's bonded QOR tokens
  • xQORE = the voter's xQORE balance (long-term staking derivative)
  • 2 = the xQORE weight multiplier (governance-configurable)
  • r = the voter's reputation score from x/reputation

Reputation Multiplier

The reputation multiplier maps r in [0, 1] to a multiplier in [0.5, 2.0] via a sigmoid curve:

ReputationMultiplier(r) = 0.5 + 1.5 * sigmoid(6 * (r - 0.5))
Reputation ScoreMultiplier
0.00.50
0.10.52
0.20.58
0.30.71
0.40.93
0.51.25
0.61.57
0.71.79
0.81.92
0.91.98
1.02.00

Quadratic Scaling

The square root function ensures that voting power scales sub-linearly with stake. A voter with 4x the stake of another voter receives only 2x the voting power, not 4x. This prevents large token holders from dominating governance decisions.

Deterministic Math

IntegerSqrt uses Newton's method with LegacyDec precision. SigmoidApprox uses a Taylor-series ExpApprox with 12 terms. All governance math is fully deterministic across all validator nodes.


QCA Parameters

The following table lists all governance-configurable parameters in the x/qca module:

Core Parameters

ParameterTypeDefaultDescription
use_reputation_weightingbooltrueEnable reputation-weighted proposer selection
min_reputation_scorefloat640.1Minimum reputation score for active participation

Pool Configuration

ParameterTypeDefaultDescription
classification_intervaluint641000Blocks between pool reclassification
weight_rposLegacyDec0.40RPoS pool selection weight
weight_dposLegacyDec0.35DPoS pool selection weight
min_delegation_dposuint6410,000,000,000Minimum delegation for DPoS (10,000 QOR in uqor)
rep_percentile_rposuint6470Reputation percentile threshold for RPoS

Bonding Curve Configuration

ParameterTypeDefaultDescription
alphaLegacyDec0.1Loyalty sensitivity coefficient
betaLegacyDec1.0Base reward multiplier
phase_multiplierLegacyDec1.5Protocol phase reward multiplier (Genesis phase)

Slashing Configuration

ParameterTypeDefaultDescription
base_rateLegacyDec0.01Base slash rate (1%)
escalation_factorLegacyDec1.5Progressive escalation base
max_penaltyLegacyDec0.33Maximum penalty per event (33%)
decay_halflifeuint64100,000Blocks for infraction weight half-life

QDRW Governance Configuration

ParameterTypeDefaultDescription
enabledboolfalseEnable QDRW governance tally
xqore_multiplierLegacyDec2.0xQORE weight relative to staked tokens
rep_min_multiplierLegacyDec0.5Minimum reputation multiplier
rep_max_multiplierLegacyDec2.0Maximum reputation multiplier