What is a long range attack in crypto and how can you prevent it?

What is a long range attack in crypto and how can you prevent it?

What is a long range attack?

A long range attack is an attack on blockchains that is mainly carried out within Proof of Stake (PoS) networks, such as Cardano and Ethereum. In a long range attack, a malicious actor attempts to create an alternative version of the blockchain by starting the attack from a block far in the past. The attacker tries to do this by building a new chain from that point, which can eventually become longer than the current ‘legitimate’ chain. Because many blockchains consider the longest chain to be the correct one, such an alternative history could theoretically be accepted as valid.

A long range attack is particularly suitable for PoS systems, because validators do not need to use computational power, but instead stake their tokens. When old private keys from former validators fall into the hands of an attacker (for example because they were sold or leaked), the attacker can use them to build an alternative chain from a point in the past, without the high costs associated with Proof-of-Work.

A long range attack is mainly carried out to invalidate previous transactions, enable double spending (double spending), or mislead the network.


Key Takeaways:

  • A long range attack is an attack within Proof-of-Stake networks where an attacker builds an alternative blockchain from a point far in the past using old validator keys.
  • By re-signing historical blocks and creating a longer alternative chain, an attacker can attempt to replace the valid chain and rewrite the transaction history.
  • Mechanisms such as checkpoints, slashing, and weak subjectivity have been developed to prevent this type of attack and ensure the integrity of the blockchain.
  • Proper management of private keys and preventing old validator keys from falling into the wrong hands plays a crucial role in reducing the risk of long range attacks.

How does a long range attack work?

The attacker starts the long range attack by obtaining old private keys from validators who were active in the past. This can happen, for example, when validators have sold their stake or did not properly secure their keys. Because these keys were once valid, they can be used to re-sign historical blocks.

Next, the attacker selects a block far in the past and attempts to build an alternative chain from that point. This is possible within blockchain technology because consensus in many systems is based on the validity of cryptographic signatures and the length of the chain, rather than on an absolute timeline. Because there is little to no competition on this old chain, the attacker can produce blocks relatively quickly. In some cases, this alternative chain can become longer than the current chain.

New nodes that join the network and do not have a full or recent history can be misled. They may consider the longest chain to be the correct one and therefore accept the malicious chain. This can lead to double spending, rewritten transactions, and a loss of trust in the network.

How can you prevent a long range attack?

Various mechanisms have been developed to help prevent a long range attack on a blockchain. The most impactful solution is the use of so-called ‘checkpoints’. These are points (blocks) embedded in the code of a blockchain that are considered final and can no longer be rewritten. Nodes do not accept alternative chains that diverge before these checkpoints.

Another well-known solution is the use of slashing mechanisms. This is a financial penalty that can be imposed on validators who attempt to commit fraud within the blockchain, for example by signing invalid blocks or conflicting chains. This makes it economically unattractive to participate in an attack.

Another important measure is the use of weak subjectivity. This means that new nodes do not rely solely on the longest chain, but also require a recent, trusted state of the blockchain (for example via a trusted source or checkpoint). This makes it more difficult for an attacker to rewrite the blockchain history.

Validators themselves can also take measures, such as securely storing their private keys. This prevents attackers from gaining access to old validator keys and reduces the risk of a long range attack.

Other common attacks

In addition to long range attacks, there are many other types of attacks within the crypto and blockchain world. The most well-known attack in crypto is the 51% attack, where a party attempts to gain the majority of computational power (in Proof-of-Work) or stake (in Proof-of-Stake) in order to gain control over the blockchain and manipulate transactions.

There is also the Sybil attack, an attack where a malicious party creates multiple fake identities to gain disproportionate influence over the network. This can be used, for example, to disrupt consensus mechanisms.

Other attacks are:

  • Eclipse attack: A node is isolated from the rest of the network and only connected to malicious nodes. This allows the attacker to manipulate the information the node receives.
  • Replay attacks: Transactions are executed again on multiple chains without the user intending it, often after a fork.
  • Smart contract attacks: Errors in the code of a smart contract are exploited to steal funds.

Final thoughts

A long range attack is an advanced type of attack that is particularly relevant in Proof-of-Stake networks, where an attacker attempts to rewrite the history of the blockchain using old validator keys. Although this poses a serious theoretical threat, modern blockchain protocols show that this risk can be effectively managed through mechanisms such as checkpoints, slashing, and weak subjectivity. These solutions ensure that malicious alternative chains are not easily accepted as valid, especially by new nodes.

At the same time, this type of attack highlights the importance of strong security practices and responsible behavior by validators, particularly in the area of key management. When private keys are securely managed and protocols are properly configured, the likelihood of a successful long range attack is significantly reduced. Ultimately, this type of attack underscores how important it is for blockchain networks to be not only efficient, but also robust and well protected against both known and advanced threats.

About Finst

Finst is a leading cryptocurrency platform in the Netherlands, providing ultra-low trading fees, institutional-grade security, and a comprehensive suite of crypto services such as trading, custody, staking, and fiat on/off-ramp. Finst, founded by DEGIRO's ex-core team, is authorized as a crypto-asset service provider under MiCAR by the Dutch Authority for Financial Markets (AFM) and serves both retail and institutional clients in 30 European countries.

The crypto platform you'll love

We are here to give you the tools, inspiration, and support you need to become a better investor.

Sign up