Glossary

Long-Range Attack

A long-range attack is a proof-of-stake vulnerability where an attacker rewrites blockchain history using old validator keys.

Key Takeaways

  • A long-range attack targets proof-of-stake blockchains by rewriting history from a point far in the past, exploiting the fact that PoS block production costs nothing once you hold the signing keys.
  • Three variants exist: simple (rewrite from genesis), posterior corruption (buy old validator keys), and stake grinding (manipulate block randomness). All exploit the nothing-at-stake problem unique to PoS.
  • Mitigations include weak subjectivity checkpoints, key-evolving signatures, unbonding delays, and finality gadgets that make reverting finalized blocks economically prohibitive.

What Is a Long-Range Attack?

A long-range attack is a class of attack against proof-of-stake blockchains in which an adversary forks the chain from a point far in the past and constructs an alternative history that competes with or replaces the canonical chain. Unlike short-range attacks that fork from recent blocks, long-range attacks exploit a fundamental property of PoS: block production does not consume a physical resource, so historical blocks can be re-created at negligible cost.

In proof-of-work systems like Bitcoin, rewriting history requires re-mining every block, expending real energy proportional to the accumulated difficulty. An attacker cannot outpace the honest chain without sustained majority hash power. In PoS, signing a block is computationally trivial. Once a validator's key exists, it can sign blocks on any number of competing forks at no marginal cost. This property is called "costless simulation" and makes long-range attacks a design constraint that every PoS protocol must explicitly address.

No major PoS chain has suffered a successful long-range attack in production. The absence of incidents reflects the effectiveness of deployed mitigations rather than the absence of the vulnerability. Academic research consistently demonstrates that without these defenses, PoS chains relying solely on honest-majority assumptions cannot guarantee safety against history revision.

How It Works

Long-range attacks come in three main variants, each exploiting a different aspect of the PoS trust model. All share the same root cause: in PoS, the "work" required to produce a block is a cryptographic signature, which costs effectively nothing to compute.

Simple Attack (Genesis Rewrite)

The most straightforward variant. An attacker who held a majority of stake at or near genesis privately builds an entirely alternative chain from that point forward. Because PoS block creation is computationally cheap, the attacker can generate blocks for all intervening slots offline and release the fork once it appears longer or heavier than the canonical chain.

  1. The attacker identifies a point in the past where they controlled sufficient stake
  2. They begin building an alternative chain from that point, signing blocks with the old keys
  3. Working offline, they generate months or years of alternative history
  4. They broadcast the competing chain to the network, potentially causing a chain reorganization

A new node syncing from scratch has no way to distinguish the attacker's chain from the honest chain purely based on protocol rules. Both chains appear valid, and both have valid validator signatures.

Posterior Corruption

Also called a "founders' attack," this variant is more practical than the simple attack because it does not require the attacker to have ever held majority stake themselves. Instead, the attacker acquires old private keys from validators who have since withdrawn their stake and are no longer economically bonded to the network.

Former validators face no slashing risk on their withdrawn stake, so they may sell or leak their keys cheaply. The attacker collects enough old keys to represent a majority of stake at some historical epoch, then uses them to sign a fork from that point. The resulting chain looks legitimate to any node evaluating it from scratch.

Stake Grinding

Rather than rewriting deep history, stake grinding manipulates the randomness used for leader election. When selected to produce a block, the attacker iterates over many possible block contents (varying transactions, timestamps, or other malleable fields) to find one whose hash biases the next random seed in their favor.

This gives the attacker a disproportionate share of future block production rights, enabling them to extend a private fork faster than the honest chain. While each individual grind provides a small advantage, the effect compounds over time. Modern PoS protocols use verifiable random functions (VRFs) to make the randomness resistant to grinding.

Why PoW Is Immune

Long-range attacks are unique to PoS because of the asymmetry in block production cost. Consider the comparison:

PropertyProof of WorkProof of Stake
Block production costEnergy expenditure per blockCryptographic signature (negligible)
Rewriting historyMust re-expend all energyOnly need old keys
Old credentialsOld ASICs are irrelevantOld keys can sign new forks
Cost of equivocationMust split hash powerZero marginal cost

In PoW, an attacker must sustain a 51% attack in real time, paying ongoing energy costs. In PoS, a historical majority suffices because signatures are free to produce retroactively.

Mitigations

Every production PoS protocol deploys one or more defenses against long-range attacks. No single mitigation is universally adopted: different chains make different tradeoffs.

Weak Subjectivity Checkpoints

The most widely used defense. Nodes periodically accept a trusted checkpoint (a recent finalized block hash) and refuse to revert beyond it. New nodes must obtain a recent checkpoint from a trusted source before syncing: a friend, a block explorer, or the client development team.

Ethereum defines a "weak subjectivity period" during which a checkpoint remains valid. Nodes that have been offline longer than this period must fetch a fresh checkpoint before resuming. This converts long-range forks into protocol violations that honest nodes simply ignore. The tradeoff is a weak trust assumption: you must trust at least one source of checkpoint information.

Key-Evolving Signatures (KES)

Used prominently by Cardano's Ouroboros Praos protocol. The validator's signing key is divided into time periods. After each period, the key evolves forward and the old version is securely erased. Even if a current key is compromised, the attacker cannot recover past-period keys, making it cryptographically impossible to forge signatures on historical blocks.

// Simplified KES key evolution concept
// Each period produces a new key; old keys are destroyed

Period 0: key_0 → sign blocks [0..129600]
Period 1: key_1 = evolve(key_0) → sign blocks [129601..259200]
  // key_0 is securely erased
Period 2: key_2 = evolve(key_1) → sign blocks [259201..388800]
  // key_1 is securely erased

// An attacker who obtains key_2 cannot reconstruct key_0 or key_1
// Therefore cannot forge blocks from periods 0 or 1

Cardano's KES keys evolve every 129,600 slots and can evolve up to 62 times before the validator must register a new operational certificate.

Unbonding Delays

Cosmos-SDK chains enforce a 21-day unbonding period during which validators remain slashable after they stop validating. Ethereum imposes a variable withdrawal queue. These delays ensure that validators cannot immediately sell their keys after exiting, raising the cost of posterior corruption.

The unbonding period must be longer than the weak subjectivity period for the defense to be effective. If validators can exit faster than nodes refresh their checkpoints, a window for posterior corruption opens.

Finality Gadgets

Protocols like Ethereum's Casper FFG provide economic finality: reverting a finalized block requires destroying at least one-third of all staked ETH. At current staking levels, this amounts to billions of dollars, making the attack economically prohibitive for any recently finalized block. Byzantine fault tolerant protocols like Tendermint (used by Cosmos) achieve instant finality: once two-thirds of validators sign a block, it cannot be reverted at all.

Bitcoin-Anchored Checkpointing

An emerging approach pioneered by Babylon Labs timestamps PoS checkpoints into Bitcoin's PoW chain. This inherits Bitcoin's cost-of-rewrite as an external trust anchor: to revert a PoS checkpoint that has been confirmed on Bitcoin, an attacker would need to also rewrite the Bitcoin chain. This approach allows PoS chains to benefit from Bitcoin's security without requiring their own PoW.

Why It Matters

Long-range attacks represent a fundamental design challenge for any PoS system. They illustrate why simply replacing PoW with PoS is not a drop-in swap: the security model changes in subtle but critical ways. Understanding these attacks helps evaluate the security guarantees of different blockchain architectures.

For systems like Spark that operate as a layer 2 on Bitcoin, the long-range attack problem is largely inherited from the base layer's consensus mechanism. Bitcoin's proof-of-work provides strong protection against history rewriting, and layer-2 protocols anchor their state to Bitcoin's chain. This is one of the key security advantages of building on a PoW base layer rather than relying purely on PoS assumptions.

The tradeoffs involved in mitigating long-range attacks also affect payment finality. Weak subjectivity checkpoints introduce a trust assumption that pure PoW chains avoid. Unbonding delays reduce capital efficiency for validators. Key-evolving signatures add operational complexity. Each PoS chain makes its own tradeoff among these options, and understanding long-range attacks is essential to evaluating those choices.

Risks and Considerations

New Node Vulnerability

Nodes syncing from scratch are the primary target. Without a recent checkpoint, they cannot distinguish an attacker's chain from the honest chain. This makes the initial sync process a critical trust boundary for PoS networks. Users who spin up a node after being offline for an extended period must obtain a fresh checkpoint from a trusted source.

Checkpoint Centralization

Weak subjectivity checkpoints solve the long-range attack problem but introduce their own trust assumption. If checkpoint distribution becomes centralized (for example, if most users rely on a single block explorer), the checkpoint provider becomes a target for attack or censorship. Decentralizing checkpoint distribution remains an active area of research.

Key Storage After Exit

Even after unbonding, former validators should securely destroy their old signing keys. Protocols that do not enforce key destruction (through mechanisms like KES) rely on validators following best practices voluntarily. In practice, key material may persist in backups, cloud storage, or compromised infrastructure long after a validator exits.

Interaction with Other Attacks

Long-range attacks can compound with other PoS vulnerabilities. Combined with the nothing-at-stake problem, an attacker can sign blocks on multiple forks simultaneously. Combined with a chain reorganization, they can attempt to reverse finalized transactions. Understanding these interactions is important for assessing the overall security of a PoS network.

This glossary entry is for informational purposes only and does not constitute financial or investment advice. Always do your own research before using any protocol or technology.