<blockquote>
  <p>When there's a re-org of the chain of several blocks, isn't the total chainwork of both chains compared?</p>
</blockquote>

<p>Yes, that's true. In fact, that's how a reorg <a href="https://bitcoin.stackexchange.com/questions/37273/how-is-a-blockchain-split-resolved/37275#37275">of any size is considered</a>. However, that wasn't always the case. In the first version of Bitcoin, the client compared purely by chain height. In version 0.3.3 (released July 2010) we switched to comparing by chain work. Today, you can't pull off a timewarp attack without a majority of hashpower.</p>

<p>However, let's say that you <em>did</em> have a majority of hashpower. What could you do with a time warp attack? You could mint an arbitrary number of blocks, and get more mining reward than you're entitled to. You could prevent the timestamp from advancing. </p>

CC BY-SA 3.0
2016-09-10T17:53:33.147Z
2016-09-19T02:54:28.180Z
2017-04-13T12:47:32.940Z
Nick ODell
<p>I more or less understand how an attacker (with less than 50%+1 of the hashing power) can artificially lower the block difficulty by messing with timestamps. I also understand how such an attacker could, on his own chain, at one point "ramp up" the difficulty of his last blocks to match the current chain's difficulty (I've read the other questions containing the <em>time-warp-attack</em> tag). What I don't understand is how at one point his chain, with less total chainwork, can be accepted by the network.</p>

<p>Say we're at block 100 on the honest chain and an attacker crafted a fake chain starting from block 50. He's now at block 105 and his block 105 has the same difficulty (that he ramped up) as the honest's chain 's block 100. He decides to broadcast his chain and he "wins" because he succeeded with his time warp attack (the question here is not about the feasability, budget-wise, of pulling such an attack today on the Bitcoin network: it's about the technical aspect of the attack).</p>

<p>What I don't get is that the honest chain has more total chainwork from block 50 to 100 than the total chainwork on the attacker's chain from block 50 to 105. The attacker, in the case of a time warp attack, has less than 50%+1 of the hashrate. So it's impossible for him to come up with <em>x</em> blocks that have more total PoW than the <em>y</em> blocks that the honest majority have mined meanwhile (even if he has more blocks, without 50%+1 he simply cannot have more chainwork than the honest majority).</p>

<p>So how comes that this re-org is accepted by the clients? When there's a re-org of the chain of several blocks, ain't the total chainwork of both chains compared?</p>

CC BY-SA 4.0
2024-01-07T13:15:48.330Z
Does this answer your question? [What is time warp attack and how does it work in general?](https://bitcoin.stackexchange.com/questions/75831/what-is-time-warp-attack-and-how-does-it-work-in-general)
Antoine Poinsot
<proof-of-work><attack><timestamp><time-warp-attack>
How does a time warp attack work?
Cedric Martin
# How does a time warp attack work?

(Asked by: username_0 on 2016-09-10)

I more or less understand how an attacker (with less than 50%+1 of the hashing power) can artificially lower the block difficulty by messing with timestamps. I also understand how such an attacker could, on his own chain, at one point "ramp up" the difficulty of his last blocks to match the current chain's difficulty (I've read the other questions containing the *time-warp-attack* tag). What I don't understand is how at one point his chain, with less total chainwork, can be accepted by the network.

Say we're at block 100 on the honest chain and an attacker crafted a fake chain starting from block 50. He's now at block 105 and his block 105 has the same difficulty (that he ramped up) as the honest's chain 's block 100. He decides to broadcast his chain and he "wins" because he succeeded with his time warp attack (the question here is not about the feasability, budget-wise, of pulling such an attack today on the Bitcoin network: it's about the technical aspect of the attack).

What I don't get is that the honest chain has more total chainwork from block 50 to 100 than the total chainwork on the attacker's chain from block 50 to 105. The attacker, in the case of a time warp attack, has less than 50%+1 of the hashrate. So it's impossible for him to come up with *x* blocks that have more total PoW than the *y* blocks that the honest majority have mined meanwhile (even if he has more blocks, without 50%+1 he simply cannot have more chainwork than the honest majority).

So how comes that this re-org is accepted by the clients? When there's a re-org of the chain of several blocks, ain't the total chainwork of both chains compared?

**Tags:** proof-of-work, attack, timestamp, time-warp-attack

> **Comments:**
> **username_1**: Does this answer your question? [What is time warp attack and how does it work in general?](https://bitcoin.stackexchange.com/questions/75831/what-is-time-warp-attack-and-how-does-it-work-in-general)  

---

## 1 answers

### Answer by username_2 on 2016-09-10. Score: 4

> When there's a re-org of the chain of several blocks, isn't the total chainwork of both chains compared?

Yes, that's true. In fact, that's how a reorg [of any size is considered](https://bitcoin.stackexchange.com/questions/37273/how-is-a-blockchain-split-resolved/37275#37275). However, that wasn't always the case. In the first version of Bitcoin, the client compared purely by chain height. In version 0.3.3 (released July 2010) we switched to comparing by chain work. Today, you can't pull off a timewarp attack without a majority of hashpower.

However, let's say that you *did* have a majority of hashpower. What could you do with a time warp attack? You could mint an arbitrary number of blocks, and get more mining reward than you're entitled to. You could prevent the timestamp from advancing.


---

