# Long Range Attack On PoS

Posted by 刘学枫 on January 10, 2019

## Introduction

Long Range Attack is an attack behavior that attacker make a conflict point on a historic block in order to construct a private chain and overtake the legal main chain.

This attack is seem to be only appeared in Proof of Stake-based blockchain theoretically due to the weak subjectivity and costless simulation of such consensus algorithm.

Long Range Attack 是一种在历史区块上制造分叉链的攻击行为，其主要是利用私链来替换主链进行获利行为。

## Steps to launching

The actual steps to lauch Long Range Attack is as follow:

1. The attacker works privately on a block at some height(e.g. N-10000, N is the current height of mainchain) to build a conflicting sidechain with a fraction q of total amount of coins being staked on the mainchain at that height. And he modifies his client to disable any incoming or outgoing client connections.

2. Than the attacker starts minting blocks, copying each block’s transactions from the mainchain in order. He will have mined every block and gain the coinstake reward from that since no one else is on the private chain, althogh he may wait for serverl rounds to produce a block(i.e. every round he has a probability q to validate a block and the q will be increasing for the block rewards and transaction fees).
3. Repeat step 2 until the height of sidechain catches up with the mainchain, the attacker broadcast his private chain to the network and tempt other clients to accept it. Eventually the private chain wiil be valid and rewrite history of old mainchain.

The attack is successful dependent on whether the sidechain caught up with the mainchain or not.

Long Range Attack的攻击流程如上所示，该攻击是否成功主要取决于私链的长度能否大于主链。一般而言，主链上的区块生成速率是比私链的生成速率大，但基于一些理论假设则该攻击仍然有可能发生。

## Conclusion

Long Range Attack has not been happened in reality, but we can not consider it never appear. There is an expectation leading to this situation if the mainchain can not generate blocks in an expected way that some validators skip to validate blocks. It decreases the rate of generating block while the rate on sidechain increases gradually since the attacker gains all the block rewards and transaction fees.

## Reference

[1]How does the secret chain catch up with the real chain in the longe range attack

[2]Proof of Stake FAQs