Difficulty Specification

cASERT — Contextual Adaptive Stability & Emission Rate Targeting
Difficulty Adjustment

Unified consensus-rate control combining bitsQ primary controller, equalizer profiles, and anti-stall for ConvergenceX Proof-of-Work.

CONSENSUS | Integer-only arithmetic · Q16.16 fixed-point · Per-block retargeting

bitsQ Primary Controller

Exponential Foundation
EXPONENTIAL FOUNDATION (2020)

cASERT's bitsQ primary controller originally used an exponential moving average formula (half-life based), pioneered by Mark Lundeberg and Jonathan Toomim for Bitcoin Cash (November 2020 hard fork). Since block 5,175, bitsQ uses an avg288-based model: it compares the average of the last 288 block intervals against the 600s target. Since block 5,270, a dynamic cap scales with deviation (0% dead band at ±15s, then 0%/0.5%/1.0%/2.0%/3.0% max). Median removed from consensus (block 5,270+). Block 5,323 hotfix. The half-life exponential is preserved for pre-5175 blocks only. cASERT was designed by NeoB for SOST Protocol (2026), extending the controller with equalizer profiles and anti-stall decay into a unified consensus-rate control system for ConvergenceX.

PropertyDetail
Core formulanext_bitsq = anchor_bitsq * 2^(-td / halflife)
Time delta (td)actual_time - expected_time (deviation from ideal schedule)
Exponential responseDifficulty doubles/halves every halflife period
SOST implementationInteger-only cubic polynomial approximation of 2^x
EncodingQ16.16 fixed-point arithmetic, no floating point in consensus
BITSQ mode (current)avg288-based (block 5,175+): avg of last 288 intervals vs 600s target. Dynamic cap (5,270+): 0% dead band (±15s), 0%/0.5%/1.0%/2.0%/3.0% max. Median removed from consensus (block 5,270+). Block 5,323 hotfix
Median288Median removed from consensus (block 5,270+)
Legacy half-lifeV1: 48h (genesis–1,449), V2: 24h (1,450–5,174). Preserved for historical blocks only
Legacy delta capV1: 6.25%, V2: 12.5% symmetric. Preserved for historical blocks only
TARGET_SPACING600s (10 minutes)
Key principle: For blocks < 5,175, the bitsQ controller is anchor-based (exponential half-life). For blocks ≥ 5,175, bitsQ is avg288-based: it compares the average of the last 288 block intervals against the 600s target, with a dynamic cap (block 5,270+) that scales with deviation. Median removed from consensus (block 5,270+). Block 5,323 hotfix. The anchor-based formula is preserved for historical blocks only.

cASERT Architecture

cASERT is a unified three-layer consensus-rate control system: (1) the bitsQ primary controller provides difficulty adjustment (avg288-based since block 5,175, with dynamic cap since block 5,270), (2) equalizer profiles introduce discrete hardening levels when the chain runs ahead of schedule, and (3) anti-stall decay ensures liveness under sudden hashrate loss. ConvergenceX PoW has a stability_metric (gradient descent convergence) that can be tightened. cASERT monitors how far ahead of schedule the chain is and introduces discrete hardening levels to prevent fast-block attacks. The equalizer ceiling is height-gated: H13 pre-V12 (#5,750..#7,349) and H20 from V12 (#7,350+). Profiles H14–H20 activate at V12 #7,350; H21–H35 stay reserved (margin=115).

Equalizer Profiles (E4–H35)
5-SIGNAL EWMA CONTROLLER
ProfileH=ScaleKStepsMarginCompute
E7A-71112001
E6A-61121952
E5A-51221904
E4A-41231856
E3A-31331809
E2A-213417512
E1A-114417016
B0A014416516
H1A+114516020
H2A+215515525
H3A+315615030
H4A+416614536
H5A+525514050
H6A+625613560
H7A+726613072
H8A+826712584
H9A+927712098
H10A+10278115112
H11A+11288115128
H12A+12289115144
H13A+13299115162
H14A*+142910115180
H15A*+1521010115200
H16A*+1621011115220
H17A*+1721111115242
H18A*+1821112115264
H19A*+1921212115288
H20A*+2021213115312
H21R+2121313115338
H22R+2221314115364
H23R+2321414115392
H24R+2421415115420
H25R+2521515115450
H26R+2621516115480
H27R+2721616115512
H28R+2821617115544
H29R+2921717115578
H30R+3021718115612
H31R+3121818115648
H32R+3221819115684
H33R+3321919115722
H34R+3421920115760
H35R+3522020115800

43 profiles E7(-7) through H35(+35). H10–H35 margin=115. Compute = scale × k × steps.
A = Active pre-V12 (#5,750..#7,349) — 21 profiles E7 through H13.
A* = Active from V12 (#7,350+) — 7 additional profiles H14 through H20 (new ceiling).
R = Reserved — H21 through H35 post-V12 (15 profiles). Defined in specification, reserved for future activation as network hashrate grows. Relief valve: V8 single E7 cliff at 605 s (5,750+) → V9 staged drop 3/60 s from 540 s (6,550+) → V10 granular drop 1/60 s from 600 s (6,700+). Floor stays at E7.
V6 calibration (5,050): lag cap H ≤ lag, live lag (disabled at V10), anti-stall 60 min. bitsQ avg288-based (5,175+), dynamic cap (5,270+). This completes the cASERT equalizer calibration.

BIDIRECTIONAL

Easing & Hardening

The equalizer operates bidirectionally: E7–E1 ease stability (only after 6h extra at B0), B0 is the baseline, H1–H35 harden when blocks are fast. All 43 profiles defined. Pre-V12: 21 active E7–H13, 22 reserved H14–H35. V12 (#7,350+): 28 active E7–H20, 15 reserved H21–H35. Safety rules cap at B0 when behind schedule or with <10 blocks. Slew rate: ±1 profile level per block (V6, block 5,000+).

43 PROFILES

Independent Tuning

43 profiles E7(-7) through H35(+35). Each profile has independently tuned scale, k, steps, and margin. Higher profiles impose stricter stability_metric thresholds on ConvergenceX, making it progressively harder to produce fast blocks. H5–H35 use scale=2 (V6 calibration). H35 is the hardest reserved profile (k=20, steps=20, margin=115).

ANTI-STALL

Decay Anti-Stall

If no block is found for an extended period, the cASERT level decays to B0 via zone-based rates. Activation: always 7,200s (2 hours) since V3.1. Easing profiles E1–E4 activate only after 6 hours extra at B0. This prevents mining deadlock when hashrate drops suddenly.

ZONE-BASED DECAY TO B0

After activation, decay uses current level zone (not original):
H35→...→H7: FAST (600s/level = 10min/level) — 60 min
H6→H5→H4: MEDIUM (900s/level = 15min/level) — 45 min
H3→H2→H1: SLOW (1200s/level = 20min/level) — 60 min

Decay stops at B0. Easing E1–E4 only after 6 hours extra at B0.

Exponential Heritage

Properties Inherited from BCH Exponential Retarget
SHARED LINEAGE
PropertyDetail
Exponential moving average formula2^(-td / halflife) — same mathematical approach
Anchor-based calculationUses first block of epoch as anchor reference
Q16.16 fixed-point encodingSame integer representation, no floating point
Global difficulty clampsMIN_BITSQ / MAX_BITSQ bounds enforced
Per-block retargetingEvery block, not every N blocks
Epoch structureBLOCKS_PER_EPOCH = 131,553 blocks (~2.5 years)
Heritage note: cASERT's bitsQ controller originally built on BCH's exponential per-block retarget approach (V1: 48h half-life, V2: 24h half-life with 12.5% delta cap). Since block 5,175, bitsQ uses an avg288-based model with a dynamic cap (block 5,270+) that scales with deviation (0% dead band at ±15s, 0%/0.5%/1.0%/2.0%/3.0% max). Median removed from consensus (block 5,270+). Block 5,323 hotfix. The half-life exponential is preserved for historical blocks only. These changes, combined with the equalizer and anti-stall layers, make cASERT a unified system purpose-built for ConvergenceX.
cASERT Fork History
CONSENSUS UPGRADES
VersionBlockChanges
V1Genesis48h half-life, 6.25% delta cap, ±1 slew rate
V21,45024h half-life, 12.5% delta cap
V34,100Slew rate ±1 → ±3, lag floor (lag/8 minimum profile), improved equalizer responsiveness
V3.14,110Stored profile_index from BlockMeta (prevents slew rate bypass), anti-stall always 7,200s
V44,200Ahead Guard: clamps bitsQ relaxation to 1.56%/block when chain ≥16 blocks ahead (H8+). Hysteresis: enter ≥16, exit ≤8
V65,000Slew rate ±3 → ±1, H10–H35 scale=2 (V6 calibration), H35 hardest (k=20, steps=20, margin=115)
V7 avg2885,175bitsQ switches to avg288-based: avg of last 288 block intervals vs 600s target. Half-life exponential no longer used (preserved for historical blocks only)
V7 dyncap5,270Dynamic cap: 0% dead band (±15s), 0%/0.5%/1.0%/2.0%/3.0% max scaling with deviation. Median removed from consensus (block 5,270+). Block 5,323 hotfix
V8 cliff5,750Single-step relief valve: profile drops to E7 after 605 s without a block. H13 ceiling (was H12). Removes H10/H11 dead-zones during stalls.
V9 staged6,550Staged relief cascade: drop 3 profile levels every 60 s starting at 540 s elapsed. Floor stays at E7. Future-drift cap MAX_FUTURE_DRIFT_STAGED=60 s.
V10 granular6,700Granular relief cascade: drop 1 profile level every 60 s starting at 600 s elapsed. Lag-advance disabled at this height — lag is computed strictly from chain.back().time, validation deterministic w.r.t. block.timestamp. Floor stays at E7. No supply / reward change.

All forks are forward-only (no regenesis). Nodes enforce fork rules based on block height.

What is New in cASERT

Novel Components
SOST-SPECIFIC
FeatureDescription
Anti-stall decayDecay activates after 7,200s (always 2 hours) without a block — zone-based, proportional, no ceiling
Level systemDiscrete levels (not continuous) for deterministic consensus — any two nodes compute the same level
Floor at B0Chain always gets at least B0 stability requirements, even when behind schedule
Stateless recalculationAny node can compute the cASERT level from the chain alone, no extra state needed
ConvergenceX integrationcASERT adjusts the stability_metric threshold, not the PoW target directly
Contraction coefficientc = 7/10, ensuring d_final <= 0.7 * d_initial + margin
Anti-Stall Mechanism
DECAY PROTOCOL

The anti-stall decay ensures liveness under sudden hashrate loss. If no valid block arrives for DECAY_START seconds, the cASERT hardening is gradually reduced. This decay is deterministic and computed from the timestamp of the previous block, making it fully verifiable by all nodes.

ConditionResponse
Stall < activation thresholdNo decay — cASERT level applies at full scale
Stall >= activation thresholddecay_factor reduces cASERT scale progressively
ResultMining continues even if hashrate drops dramatically
Design rationale: Discrete levels (rather than a continuous function) eliminate consensus ambiguity from rounding differences between implementations. Every conforming node will compute exactly the same level for the same chain state.

Consensus Parameters

Parameter Table
IMMUTABLE CONSTANTS
ParameterValueDescription
BITSQ mode (current)avg288-based (5,175+)Compares avg of last 288 block intervals vs 600s target. Half-life exponential preserved for pre-5175 blocks only
BITSQ dynamic cap0%/0.5%/1.0%/2.0%/3.0% (5,270+)Dead band ±15s (0%), then scales with deviation. Median removed from consensus (block 5,270+). Block 5,323 hotfix
Legacy HALF_LIFEV1: 172,800s (48h), V2: 86,400s (24h)Preserved for historical blocks: V1 genesis–1,449, V2 1,450–5,174
Legacy DELTA_CAPV1: 6.25%, V2: 12.5%Preserved for historical blocks: V1 genesis–1,449, V2 1,450–5,174
TARGET_SPACING600s10-minute target between blocks
BLOCKS_PER_EPOCH131,553Blocks per difficulty epoch (~2.5 years)
GENESIS_BITSQ765,730Initial difficulty in Q16.16 (11.6841, calibrated)
MIN_BITSQ65,536Minimum difficulty (1.0 in Q16.16)
MAX_BITSQ16,711,680Maximum difficulty (255.0 in Q16.16)
CASERT_H_MIN / H_MAX-4 / 35Profile range: E7 (deep easing) to H35 (max hardening); 43 profiles. Pre-V12: 21 active E7–H13. V12 (#7,350+): 28 active E7–H20.
CASERT_K_R0.05Instantaneous rate gain (was 0.25)
CASERT_K_L0.40Schedule lag gain — dominant (was 0.10)
CASERT_K_I0.15Integrator gain (was 0.05)
CASERT_K_B0.05Burst score gain (was 0.30)
CASERT_K_V0.02Volatility gain (was 0.10)
SLEW_RATE±1/block (V6+)Max profile change per block (V3: ±3, V6 block 5,000: returned to ±1)
ANTISTALL_FLOOR7,200s2-hour minimum before anti-stall decay activates
ANTISTALL_DECAYzone-basedH35–H7: 600s/lvl, H6–H4: 900s/lvl, H3–H1: 1200s/lvl. Decays to B0. E1–E4 after 6h at B0.
Safety: behind schedulecap B0Never harden when chain is behind schedule (lag ≤ 0)
Safety: <10 blockscap B0Require 10 blocks before any hardening
CX_C_NUM / CX_C_DEN7/10Convergence ratio for stability test
Source reference: All parameters are defined in include/sost/params.h and include/sost/pow/casert.h. These values are consensus-critical and immutable.
Implementation: cASERT is validated as part of the L2 block validation layer (header context checks). See include/sost/block_validation.h for the full consensus pipeline.
🎮