Why Proof Of Work?

When I first read that proof of work was a way to achieve consensus on the blockchain network by solving a resource-intensive math puzzle it made little sense to me.

It made little sense to me because I didn't understand how solving complex math problems ensured that a network remained uncorrupted. After all, however complex these problems were they remained solvable, so what's the point?

It was after getting my hands dirty playing around with blockchain tech is when I began to understand.

The thing is most articles kept mentioning how the math problems are complex leaving the reader to naturally assume that this is what makes it impossible to corrupt the blockchain ledger.

How Proof Of Work ensures the integrity of the blockchain?

The blockchain primarily is used for record-keeping, for example, in the case of Bitcoin it's used to track transactions. And this record is out in the open for everyone to look at.

When someone wants to add a new transaction record, is when they or some else performs this complex math computation that has nothing to do with the transaction itself but just like a road bump is there to create a barrier to entry.

The value of the effort you put in to solve this math problem is rewarded in Bitcoins and also allows you to enter the original transaction request into the blockchain.

Now remember there is no central place where the blockchain lives. Copies of the blockchain is held on different computers owned by people around the world, each computer is known as a node. To ensure that all copies remain the same a consensus needs to be drawn whenever a new record needs to be synced. To do this each node verifies the math solution you provide and either realize it's not correct or the rest of the blockchain entries are different from what they have then they collectively reject it.

Although it takes a bit of work to solve the math problem it's easier to verify so drawing a consensus is a much faster process.

If you controlled more than half of the computers within the network then you can fool the rest that your copy of the blockchain is the right one since the majority of the computers within the network have your malicious record. As you can imagine given the number of nodes currently present on the Bitcoin chain and the amount of computation required to override the current blockchain this is more or less a fruitless venture.

All the Bitcoins in circulation now were produced through Proof Of Work, an act known as mining. So you see if you are going to add a lot of computing resources to the Bitcoin network just to gain a majority stake (51%+) and to rewrite the blockchain ledger through Proof Of Work then well you will be spending way more than you stand to gain if you have a financial goal in mind, hence why Proof Of Work helps ensure the integrity of the blockchain network.

Here is another article for you 😊 "BrainFuck Interpreter using method chaining"