Live tape
Top 8, mentions 7d2,137GOOGL453 mentions▲ +0.06NVDA345 mentions▲ +0.07META271 mentions▲ +0.05QQQ266 mentions▲ +0.09SPY256 mentions▲ +0.04AAPL193 mentions▲ +0.04MSFT178 mentions▲ +0.06TSLA175 mentions▲ +0.06

How Does Blockchain Fix An Infinite Loop?

What Is An Infinite Loop?

An infinite loop is a sequence in a computer program looping continuously without stopping. Infinite loops are usually a bug and stop when a server is shut down to fix the bug, rewrite the code attached to the bug, and then redeploy the program.

This wouldn’t work on a decentralized and distributed blockchain network. It would be difficult to stop all the nodes around the world. Even if you were, with increasing transactions per second, this would cause thousands of transactions to build up. Even if it were for a minute.

Ethereum Gas And Infinite Loops

To stop this issue, Ethereum introduced Gas. Like a car that stops when it runs out of gas, if a transaction runs out of gas it’s stopped.

Before sending a transaction you set a gas limit you’d be willing to pay. If a transaction or smart contract gets stuck in a loop and runs out of ‘gas’ it reverts the computation and sends it back to you, without the gas you lost, unfortunately.

Gas also prevents spamming and DDoS attacks. Paying the gas fee for thousands of bots to flood a system would cost an attacker too much to be worth it. Making a blockchain system even more secure for its users.

The Distributed Newsletter

The week’s numbers, every figure sourced and sample sized, in your inbox each Friday.