Download the whitepaper of Abelian’s Difficulty Smoothing Algorithm here.
Introduction
The Difficulty Smoothing Algorithm (DSA) is how the Abelian network adjusts mining difficulty so that new blocks stay close to the target time of 256 seconds. It took effect at block 284,000 on 3 June 2024, replacing the original adjustment cycle of 4,000 blocks.Why difficulty adjustment matters
Abelian uses Proof-of-Work. Miners compete to produce the next block, and difficulty controls how hard that work is. If more mining power joins the network, blocks would arrive too quickly unless difficulty rises. If miners leave, blocks would slow down unless difficulty falls. The network’s target is an average of 256 seconds per block.The original adjustment method
At launch, Abelian updated difficulty once every 4,000 blocks, a period the Foundation calls an epoch. That is about 12 days at the target block time. At the end of each epoch, the network estimated recent hash rate and scaled the next epoch’s difficulty up or down. If an epoch took longer than about 12 days, difficulty was reduced so the next blocks would come in faster. If an epoch finished early, difficulty was increased so the next blocks would take longer. The aim was still 256 seconds per block, but the network could only correct course once every few thousand blocks.Why the network needed a change
Until June 2024, hash rate often swung sharply from one epoch to the next. The Foundation attributed this to miners moving between Abelian and other GPU-minable networks as difficulty, and therefore profitability, changed. Those swings showed up in block times. In the two epochs from 25 April to 3 June 2024, average block times in the first epoch peaked at about 1,300 seconds, while the second epoch fell as low as about 80 seconds. Both extremes created problems. When many miners joined, block times shortened and throughput rose, but poorly connected nodes could struggle to keep up, which the Foundation said could cause frequent soft forks and wasted work. When miners left, block times stretched out and transactions took longer to confirm, which hurt usability.How DSA works
DSA updates difficulty much more often, and it pays more attention to recent conditions. The network now adjusts every 200 blocks. The Foundation calls this period a slot, which is about 14 hours at the target block time. To choose the next slot’s difficulty, DSA looks at the most recent 20 slots and computes a weighted average hash rate, giving more weight to later slots than to earlier ones. It then sets the next difficulty so that, if hash rate stays near that estimate, average block time should return to 256 seconds. In simple terms, difficulty rises when recent blocks have been faster than 256 seconds, and falls when they have been slower. A single adjustment is also capped. The ratio between the weighted average hash rate and the most recent slot’s hash rate is limited to the range from ¼ to 4. If the next slot’s hash rate stayed the same as the last slot, that cap keeps the implied average block time between 64 and 1,024 seconds. The cap stops difficulty from jumping too far in one step when hash rate changes suddenly.What the Foundation reported after launch
In its July 2024 whitepaper, the Abelian Foundation said that after DSA activated, block times quickly moved back toward the 256-second target. For the period from 24 June to 5 July 2024, it reported average block times between 166 and 334 seconds, a much narrower range than the swings seen just before the upgrade.How does the DSA calculation works?
How does the DSA calculation works?
At the end of each 200-block slot, DSA estimates how much work the network did and how long that slot took, then uses those figures to set the next target.A valid block must have a hash below a 256-bit threshold called the . The
bits field in a block header is a compact encoding of that target. Because there are possible hash values, the chance of a single hash meeting the target is about . The expected number of hashes needed to find a valid block, which the paper calls , is therefore:The avoids dividing by zero. is the amount of work done per second.A slot contains 200 blocks, so there are 199 intervals between the first and last block. is the difference between those two timestamps. The slot’s hash rate is:Equivalently, it is the difference in total work between the last and first block, divided by that same time difference.DSA then takes the hash rates of the previous 20 slots and computes a weighted average. The weight for slot , with for the oldest slot and for the newest, is:These weights add up to . The oldest slot contributes of the average, and the newest contributes .Next, DSA compares that weighted average with the most recent slot’s hash rate:The used for the next slot is:- the most recent slot’s hash rate, if the is greater than
- the weighted average, if the is between and inclusive
- the most recent slot’s hash rate, if the is less than
bits form and used for the next slot. Explorer difficulty is reported as , where is the maximum difficulty, whose bits value is 1d017c38.The whitepaper walks through this calculation for the slot from block 284,800 to 284,999. In that example, the was about , so the cap was applied, and the resulting difficulty was about .
