Parent chains retarget separately
The controller above governs the kHeavyHash seal. Merge-mined work is tracked per parent chain, because their block times span an order of magnitude and a single threshold could not serve all of them.
Each chain’s retarget moves its share difficulty toward the rate that produces
that share count. Where donor protection is configured, the budget also shrinks
linearly once Kronex difficulty passes 75% of the donor chain’s own difficulty
and reaches zero at 90%, so Kronex stops asking a parent chain for more work
before it becomes a burden on it.
Difficulty and share difficulty
Consensus difficulty is not the number a pool hands a miner. The two scales are exactly 2^32 apart, and mixing them up is the single most common integration bug — a pool that converts by hand usually ends up either accepting nothing or accepting everything. Index[2] of the krnx_getWork result is the exact
target of the current work — use it as it is. Stratum runs on its own scale,
where the target is (2^224 - 1) / difficulty and difficulty 1 is worth about
2^32 hashes:
netdiff/8, floor at netdiff/4096, ceiling at
netdiff. Above that ceiling every share is already a block, and the pool goes
blind to a miner that produces nothing.