About Technology Wallets Governance Academy News Community
Technology advanced

The ASERT Difficulty Algorithm

A deep technical dive into the ASERT difficulty adjustment algorithm adopted by Marscoin in 2024 — why it was chosen, how it works, and why it matters for a Mars-bound blockchain.

By Marscoin Foundation July 8, 2024 Updated February 1, 2025 12 min read

ASERT Difficulty Explained — Before and After visualization of block time stability

Why Difficulty Adjustment Matters

Every Proof of Work blockchain faces a fundamental challenge: how do you maintain consistent block times as the network’s total hash power fluctuates?

If miners join the network, blocks are found faster than intended. If miners leave, blocks slow down. Without a mechanism to compensate, block times become unpredictable — sometimes seconds, sometimes hours.

For Marscoin, this is especially critical. The target block time of ~123 seconds (approximately one Mars minute × 2) is a deliberate design choice. If blocks arrive erratically, the entire governance and transaction infrastructure built on top of the blockchain becomes unreliable.

The difficulty adjustment algorithm is the heartbeat regulator of the blockchain.

The Problem with Legacy Algorithms

Marscoin originally used a difficulty adjustment mechanism inherited from Litecoin: recalculate difficulty every N blocks based on the average time those blocks took to mine.

This approach has well-documented problems:

The Oscillation Problem

When difficulty is recalculated in discrete steps (every N blocks), the adjustment is always retrospective. The difficulty for the next N blocks is based on what happened during the previous N blocks. If hash power changes rapidly — miners switching between chains, for example — this creates oscillations:

  1. Hash power surges → blocks come fast → difficulty jumps up
  2. Miners leave (difficulty is now too high) → blocks come slowly → difficulty drops
  3. Miners return (difficulty is now too low) → cycle repeats

This “sawtooth” pattern is disruptive. Transaction confirmation times become unpredictable, and the blockchain’s effective throughput swings wildly.

The Gaming Problem

Discrete adjustment windows can be gamed. Miners can strategically time their hash power to mine easy blocks and leave before difficulty catches up. This is sometimes called difficulty exploitation and it particularly affects smaller chains like Marscoin that share the Scrypt algorithm with larger networks.

What ASERT Is

ASERT stands for Absolutely Scheduled Exponentially Rising Targets. It was originally developed for Bitcoin Cash (BCH) by Jonathan Toomim and Mark Lundeberg, and has since been adopted by several other chains.

The core insight is elegantly simple:

Instead of adjusting difficulty in discrete windows, calculate the ideal difficulty for every single block based on how much time has elapsed since a reference point.

The Formula

For any block at height h with timestamp t, ASERT calculates the target difficulty as:

target = anchor_target × 2^((t - anchor_time - ideal_block_time × (h - anchor_height)) / halflife)

Where:

  • anchor_target — the difficulty at the reference (anchor) block
  • anchor_time — the timestamp of the anchor block
  • ideal_block_time — the target spacing (123 seconds for Marscoin)
  • anchor_height — the block height of the anchor block
  • halflife — the time constant controlling how fast difficulty responds (typically 2 days)

What This Means in Practice

  1. If blocks are arriving on schedule, the exponential term is zero, and difficulty remains unchanged
  2. If blocks are arriving too fast (hash power has increased), the exponential term pushes difficulty up — immediately, for the very next block
  3. If blocks are arriving too slowly (hash power has decreased), difficulty drops — again, immediately

There is no lag. No oscillation. No discrete windows to game. The adjustment is continuous and deterministic.

Why Marscoin Chose ASERT

ASERT was activated on the Marscoin network at block 3,000,000 in July 2024 after extensive testing and community discussion. The reasons were specific and compelling:

1. Protection Against Hash-Raiding

Marscoin shares the Scrypt algorithm with Litecoin and hundreds of other chains. Large Scrypt mining pools can temporarily redirect massive hash power to smaller chains, mine a burst of easy blocks, and leave. ASERT’s per-block adjustment eliminates the exploitation window:

  • Hash power surge → difficulty rises immediately on the next block
  • Miners leave → difficulty drops immediately, so honest miners aren’t punished with stuck blocks

2. Preparation for Merged Mining

In February 2025, Marscoin activated AuxPoW (Auxiliary Proof of Work) for merged mining with other Scrypt chains. Merged mining causes rapid, large fluctuations in effective hash power as pools add and drop Marscoin as an auxiliary chain. ASERT handles these fluctuations gracefully — it was designed for exactly this scenario.

3. Mars Communication Constraints

On Mars, the network will operate with a small, variable number of mining nodes. Hash power may fluctuate dramatically as power systems cycle, equipment fails, or new hardware comes online. A difficulty algorithm that responds instantly and smoothly to these changes is essential for maintaining usable block times.

4. Mathematical Elegance

ASERT is stateless — each block’s difficulty can be calculated from the anchor block alone, without reference to any intermediate blocks. This makes it:

  • Trivial to verify (independent nodes always agree)
  • Resistant to timestamp manipulation (compared to algorithms that use recent block timestamps)
  • Efficient to compute (a single exponential calculation)

The Activation

ASERT was implemented in Marscoin Core versions 1.6.5 and 1.7.5 and activated at block height 3,000,000. The transition was coordinated with:

  • All major node operators upgrading in advance
  • Exchange partners (LBank, Dex-Trade) updating their nodes
  • Mining pools adjusting their difficulty targeting
  • The Electrum wallet releasing a compatible update (v1.6.5)

The activation was smooth. Block times stabilized almost immediately to the target ~123 second interval, and the previously observed oscillation patterns disappeared.

Measuring the Impact

Before ASERT, Marscoin’s block time variance was significant. Blocks could range from 30 seconds to 15+ minutes depending on Scrypt mining pool activity. After activation:

MetricBefore ASERTAfter ASERT
Average block time~145 sec (23% over target)~124 sec (0.8% over target)
Block time std. deviation~180 sec~45 sec
Blocks > 10 min~8% of blocks<0.5% of blocks
Blocks < 30 sec~12% of blocks<2% of blocks

The improvement was immediate and sustained.

Looking Forward

ASERT provides the foundation for Marscoin’s next technical milestones:

  • Merged mining stability — ASERT handles the hash power fluctuations inherent in AuxPoW mining
  • Multi-node Mars networks — when Marscoin nodes eventually operate on Mars, ASERT will handle the small and variable hash power environment
  • Potential algorithm transitions — if Marscoin transitions to RandomX (under discussion), ASERT will manage the hash power redistribution during the transition

The ASERT adoption represents Marscoin’s commitment to choosing the best available technology for its specific constraints, rather than simply inheriting defaults from parent chains.


ASERT was activated at Marscoin block height 3,000,000 in July 2024. The implementation follows the specification originally published by Jonathan Toomim and Mark Lundeberg for Bitcoin Cash. Marscoin’s implementation was adapted for the 123-second target block time and Scrypt PoW algorithm.

Topics
ASERT difficulty adjustment consensus mining technical
Olympus
Olympus Online