satwikkansal / python_blockchain_app

A fully functional blockchain application implemented in Python from scratch (with tutorial).
819 stars 471 forks source link

What prevents a new node with a bigger chain to join and deceive everyone? #43

Open t3rmin4l opened 4 years ago

t3rmin4l commented 4 years ago

If a new node with a bigger chain than anyone's joins, wouldn't it be able to deceive everyone and everyone would accept its chain because it's the longest?

Popeyef5 commented 4 years ago

As I understand it, this is just a toy model for a blockchain. In a more real world scenario, the data stored consists of transactions (or anything really) which is cryptographically signed by the relevant parties. So you could not create blocks containing "fake" entries because you wouldn't be able to fake the signature. Transactions not only contain information about their content, but are also signed by the relevant author