<p><a href="https://bitcoin.stackexchange.com/q/658/5406">It could!</a> An attacker could replace a block at arbitrary depth given that they can maintain majority hashrate sufficiently long.</p>
<p>Every block in the Bitcoin blockchain commits to its predecessor by including the previous block's hash in the header. Therefore, each block inductively commits to all previous blocks. This prevents a block from being swapped out, because all blocks at a greater height would appear be invalid on a chaintip including the new block.</p>
<p>An attacker with majority hashrate would have to replace an old block and then build a competing alternative chaintip from that point until they achieve a greater total proof-of-work than the rest of the network. Since the attacker has majority hashrate per the premise, they are bound to produce more blocks than the rest of the network and will eventually pull ahead.</p>
<p>The difficulty in performing this attack in practice lies in the logistic challenge of acquiring hardware to achieve majority hashrate and the economic cost of maintaining the majority hashrate for such a period of time. Additionally, such an attack could potentially be rebuffed on the social layer by users coordinating to reject the attacker's chain, even then, such an attack would probably destroy the confidence of Bitcoin users in the stability of the network and would likely cause the price to tank, severely reducing the expected gains from such an attack.</p>

CC BY-SA 4.0
2021-06-18T18:35:45.193Z
2021-06-18T18:35:45.193Z
Murch
<p>Lets say the block height is currently 700000 and you computed a different version of block 699990 and broadcast it.</p>
<p>The old block 699991 cannot be considered a successor to the new 699990 because it references the hash of the old 699990, so the new 699990 is the top of a new fork of the blockchain.</p>
<p>Each node would consider the two forks, one has a block height of 699990 and the other has a block height of 700000 with ten more blocks worth of work in it, the nodes would choose the fork with 700000 blocks. Note that it isn't the length that matters but the amount of accumulated work.</p>
<p>So you can't just change one block, in this case you'd also have to compute successor blocks with a combined amount of work greater than the existing chain up to 700000. You'd have to do this faster then other miners are adding blocks on top of block 700000. So you'd probably have less than 10 minutes to do something that normally takes the best mining pools around 100 minutes.</p>

CC BY-SA 4.0
2021-06-16T15:19:43.283Z
If you have >51% of the hashrate for an extended period of time you can rewrite arbitrarily deep - bounded only by how long much time they can keep it up. The answer to OPs question is "yes, they can", I think.
Pieter Wuille
CC BY-SA 4.0
2021-01-17T11:22:27.613Z
2021-01-17T11:22:27.613Z
RedGrittyBrick
<p>I have read that it is not possible to reverse transactions already added to the blockchain but I do not understand why that is not possible in a 51% attack.</p>
<p>If an attacker was to change the information of a past transaction, the hash of that transaction would change. This would result in a different Merkle root for that specific block. Since the attacker controls 51% of the hash rate, he would have enough computational power to find the new Merkle Root and the nonce this new block in order to produce a valid proof of work. Then the minder could broadcast the proof of work and approve it himself since he controls the majority of the network. In that way he could change the contents of a past block.</p>
<p>My logic above is definitely flawed somehow. Could someone please explain why a 51% attack cannot change past transactions?</p>
<p>Does the digital signature somehow play a role in this? If yes how?</p>

<security><proof-of-work><majority-attack><best-chain>
Why can't a 51% attack change past blocks on the blockchain?
user10764803
# Why can't a 51% attack change past blocks on the blockchain?

(Asked by: username_0 on 2021-01-17)

I have read that it is not possible to reverse transactions already added to the blockchain but I do not understand why that is not possible in a 51% attack.

If an attacker was to change the information of a past transaction, the hash of that transaction would change. This would result in a different Merkle root for that specific block. Since the attacker controls 51% of the hash rate, he would have enough computational power to find the new Merkle Root and the nonce this new block in order to produce a valid proof of work. Then the minder could broadcast the proof of work and approve it himself since he controls the majority of the network. In that way he could change the contents of a past block.

My logic above is definitely flawed somehow. Could someone please explain why a 51% attack cannot change past transactions?

Does the digital signature somehow play a role in this? If yes how?

**Tags:** security, proof-of-work, majority-attack, best-chain


---

## 2 answers

### Answer by username_1 on 2021-06-18. Score: 3

[It could!](https://bitcoin.stackexchange.com/q/658/5406) An attacker could replace a block at arbitrary depth given that they can maintain majority hashrate sufficiently long.

Every block in the Bitcoin blockchain commits to its predecessor by including the previous block's hash in the header. Therefore, each block inductively commits to all previous blocks. This prevents a block from being swapped out, because all blocks at a greater height would appear be invalid on a chaintip including the new block.

An attacker with majority hashrate would have to replace an old block and then build a competing alternative chaintip from that point until they achieve a greater total proof-of-work than the rest of the network. Since the attacker has majority hashrate per the premise, they are bound to produce more blocks than the rest of the network and will eventually pull ahead.

The difficulty in performing this attack in practice lies in the logistic challenge of acquiring hardware to achieve majority hashrate and the economic cost of maintaining the majority hashrate for such a period of time. Additionally, such an attack could potentially be rebuffed on the social layer by users coordinating to reject the attacker's chain, even then, such an attack would probably destroy the confidence of Bitcoin users in the stability of the network and would likely cause the price to tank, severely reducing the expected gains from such an attack.


---

### Answer by username_2 on 2021-01-17. Score: 1

Lets say the block height is currently 700000 and you computed a different version of block 699990 and broadcast it.

The old block 699991 cannot be considered a successor to the new 699990 because it references the hash of the old 699990, so the new 699990 is the top of a new fork of the blockchain.

Each node would consider the two forks, one has a block height of 699990 and the other has a block height of 700000 with ten more blocks worth of work in it, the nodes would choose the fork with 700000 blocks. Note that it isn't the length that matters but the amount of accumulated work.

So you can't just change one block, in this case you'd also have to compute successor blocks with a combined amount of work greater than the existing chain up to 700000. You'd have to do this faster then other miners are adding blocks on top of block 700000. So you'd probably have less than 10 minutes to do something that normally takes the best mining pools around 100 minutes.

> **Comments:**
> **username_3**: If you have >51% of the hashrate for an extended period of time you can rewrite arbitrarily deep - bounded only by how long much time they can keep it up. The answer to OPs question is "yes, they can", I think.  

---

