Cointime

Download App
iOS & Android

Slow Block Validation Attacks

From lopp blog by Jameson Lopp

One potential threat for disrupting the game theory of mining is an attack in which an adversarial miner constructs complex blocks containing transactions that take an inordinately long amount of computational resources (and thus time) to validate. This is one of many reasons for which developers have advocated for keeping block sizes small.

The quadratic signature hashing attack is one such issue that was addressed with the addition of Segregated Witness. There are still other outstanding issues that need resolution, and Rusty Russell's Great Script Restoration Project aims to rectify them by implementing a more precise system of calculating computation cost of transaction validation.

Recently I wondered: how much of an advantage would performing a slow block validation attack actually give to an adversarial miner? To describe the effective hashrate advantage a miner gains by delaying other miners from starting to mine a new block for X seconds, we can model the situation with the following factors:

Variables:

  • T: Expected time to find a block in seconds (600).
  • X: Time delay (in seconds) the miner imposes on other miners by sending them a block that's slow to validate.
  • Z​: Proportion of total hashrate the attacking miner controls.

Of course in reality, the X delay will vary from miner to miner because it's dependent upon the speed of the hardware that's running their fully validating node software.

Any given miner’s expected time to mine the next block follows an exponential distribution with a rate proportional to their hashrate. Given that the expected block time for the entire network is 600 seconds, the rate of block finding will be:

  • Miner's rate: Z / 600
  • Rest of network's rate: (1-Z) / 600

We can now calculate the probability that a slow block validation attacking miner finds the next block before the rest of the network if they have a head start of X seconds:

Graphing Some Scenarios:

The resulting outcome is actually not as bad as I expected, as I was naively thinking that an attacker that can delay the rest of the network by 10 minutes can effectively 51% attack the network. But we have to keep in mind that the attacker themselves is still required to mine a block at the same high difficulty and their true hashrate doesn't increase, thus their expected time to find a valid block remains the same.

Another surprising finding is that this attack actually becomes less effective as the attacker's hashrate increases. That is to say, the required head start in order to achieve a similar multiplier effect increases more as the attacker's real hashrate increases.

An attacker with 1% of the total network hashrate can double their effective hashrate if they can give themselves a 7 minute head start mining the next block.

An attacker with 5% of the total network hashrate can double their effective hashrate if they can give themselves a 8 minute head start mining the next block.

An attacker with 10% of the total network hashrate can double their effective hashrate if they can give themselves a 9 minute head start mining the next block.

An attacker with 20% of the total network hashrate can double their effective hashrate if they can give themselves a 12 minute head start mining the next block.

What Would Happen Practically?

To be clear, if extremely complex blocks that were slow to validate started flooding the network, sophisticated miners would not simply stop hashing. I expect that most of them would validate the block header (which is always fast) and would start working on mining a template for an empty block that contained no transactions.

Miners won't add transactions into their block template until they're sure it's safe to do so by updating their UTXO set after the previous block's transactions are fully validated.

Thus, if such an attack were to occur, the attacking miner would not suddenly become the dominant miner for all blocks, but they likely WOULD become the only miner including transactions in blocks. As such, we'd expect the on chain transaction throughput to plummet, causing the supply of block space to plummet, and thus if demand remained the same then the going rate for block space and thus transaction fees would spike rather high.

As such, the expected profitability from such an attack would be excess transaction fees achieved by essentially cornering the market for block space. This could potentially be a fairly profitable attack if it is conducted during a time in which demand for block space is already high.

Comments

All Comments

Recommended for you

  • How currencies for online games were created

    Game money as one of the main game tools was present in computer and console games of the 1980s. From there, they migrated to the 1990s and at the very beginning of the zero years of our century in the online version of these games.

  • Create, Sell, and Earn: Orb’s New Sticker Tool for Creators

    Orb, one of the leading Web3 social apps, just rolled out a major update that’s set to revolutionize how creators monetize their content.

  • SOL breaks through $160

    the market shows that SOL has broken through $160 and is currently trading at $160.01, with a 24-hour increase of 2.14%. The market is volatile, so please be prepared for risk control.

  • BTC breaks through $68,600

    the market shows BTC has broken through $68,600 and is now trading at $68,602.48, with a 24-hour increase of 0.67%. The market is volatile, so please be prepared for risk control.

  • BLUR is currently trading at $0.2718, up 12.2% in 24 hours

    the market shows that BLUR is currently trading at $0.2718, with a 24-hour increase of 12.2%. The market is volatile, so please be prepared for risk management.

  • SOL breaks through $160

     the market shows that SOL has broken through $160 and is currently trading at $160.02, with a 24-hour increase of 2.87%. The market is volatile, so please be prepared for risk control.

  • ETH breaks through $2,700

    the market showed ETH breaking through $2,700, currently reporting at $2,700.28, with a 24-hour increase of 2.29%. The market is volatile, so please be prepared for risk control.

  • ARB breaks through $0.6

    the market showed that ARB broke through 0.6 US dollars and is now reporting at 0.61 US dollars, with a 24-hour increase of 8.93%. The market fluctuations are large, so please be prepared for risk control.

  • dYdX is now trading at $1.25, up 30.3% in 24 hours

    according to market data, dYdX is currently trading at $1.25, with a 24-hour increase of 30.3%. The market is volatile, so please exercise caution and manage your risks.

  • Possible futures of the Ethereum protocol, part 3: The Scourge

    One of the biggest risks to the Ethereum L1 is proof-of-stake centralizing due to economic pressures. If there are economies-of-scale in participating in core proof of stake mechanisms, this would naturally lead to large stakers dominating, and small stakers dropping out to join large pools. This leads to higher risk of 51% attacks, transaction censorship, and other crises. In addition to the centralization risk, there are also risks of value extraction: a small group capturing value that would otherwise go to Ethereum's users.