Why can't a 51% attack change past blocks on the blockchain? 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?
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.