Online Courses
Blockchain Security
Online Courses
Blockchain Security
  • Blockchain Security
  • Fundamentals of Blockchain Security
    • Introduction to blockchain
    • The promises of blockchain
    • Inside the blockchain hype
    • Blockchain structures
    • What is public-key cryptography?
      • How does public-key cryptography work?
      • Public-key cryptography in the blockchain
    • Security assumptions of public-key cryptography
      • Quantum computing
    • Hash function in blockchain
      • Properties of hash functions
      • Hash functions in the blockchain
      • Blockchain security hash key functions
    • Quiz
  • Consensus Algorithm Security
    • Introduction
      • The Byzantine generals problem
      • Security via scarcity
      • Common blockchain consensus algorithms
      • The longest chain rule
    • Proof of work
      • Inside PoW mining
    • Attacking proof of work
      • The 51% attack
      • Denial of service: Artificial difficulty increases
    • Proof of stake
      • Choosing the block creator
    • Attacking PoS consensus
      • XX% attack and the PoS "timebomb"
      • Fake stake attacks
      • Long-range attack
      • Nothing at stake problem
      • Sour milk attack
    • Quiz
  • Blockchain in Action
    • Nodes and network
      • Inside the node
      • How blocks are created
    • Attacking block creation
      • Denial-of-service
      • Frontrunning
      • Selfish mining
      • SPV mining
    • Attacking blockchain nodes
      • Blockchain software misconfiguration
      • Denial of service
      • Malicious transactions
    • Attacking the blockchain network
      • Eclipse attack
      • Routing attack
      • Sybil attack
    • Quiz
  • Smart Contract Security
    • What are smart contracts?
      • Smart contracts
    • General programming vulnerabilities
      • Arithmetic vulnerabilities
      • Right-to-left control character
    • Blockchain vulnerabilities
    • Ethereum vulnerabilities
    • Quiz
  • Beyond the Basics
    • Alternative distributed ledger architectures
      • Introduction to DAGs
      • Introduction to block lattices
      • Introduction to sidechains
    • Second-level blockchain protocols
      • How a state channel works
    • Advanced cryptography in blockchain
      • Multisignatures
      • Zero-knowledge proofs
      • Stealth addresses
      • Ring signatures
      • Commitment schemes
    • Quiz
  • Cumulative Quiz
Powered by GitBook
On this page
  1. Consensus Algorithm Security
  2. Attacking PoS consensus

Long-range attack

A long-range attack takes advantage of the longest chain rule. Whichever of two chains is the longest is accepted by other nodes

The attacker builds a fake version of the chain from a block where they have some stake. When they are selected to create a block, they build one. When someone else is selected, they skip that block

Over time, the attacker's block rewards give them a controlling stake on the chain. This allows it to grow quickly enough to eventually overtake the main chain

Key points

  1. Long-Range Attack: A long-range attack is a type of attack that takes advantage of the longest chain rule in a blockchain. The attacker aims to create a longer chain where they control all the stake.

  2. Building a Divergent Blockchain: To perform a long-range attack, the attacker starts by building a divergent blockchain right away. They create a malicious chain alongside the main chain.

  3. Actions on the Malicious Chain: On the malicious chain, if the attacker is selected to create a block, they build a legitimate block and add it to their chain. If they are not selected, they don't create a block.

  4. Actions on the Main Chain: On the main chain, the attacker deliberately skips their opportunity to create a block. This is because every block they create on the main chain is one more block they have to catch up with later.

  5. Growing the Malicious Chain: The goal of the attack is to continuously reinvest the block rewards on the malicious chain, increasing the attacker's stake percentage. Over time, the attacker aims to overtake the main chain.

  6. Overtaking the Main Chain: Through continuous block creation and stake reinvestment, the attacker eventually reaches a point where they control all the stake in their malicious chain. They can then overtake the main chain and become the longest chain.

  7. Time and Feasibility: The time it takes to perform a long-range attack depends on the percentage of staked resources the attacker controls at the beginning. If they control a significant portion, the attack can be executed more quickly.

PreviousFake stake attacksNextNothing at stake problem

Last updated 9 months ago