Live tape
Top 8, mentions 7d11,043NVDA4,947 mentions▲ +0.08GOOGL1,313 mentions▲ +0.03META1,166 mentions▲ +0.05NKE1,030 mentions+0.01MRVL807 mentions▲ +0.08MSFT623 mentions▲ +0.07SNDK605 mentions▲ +0.07QQQ552 mentions▲ +0.08

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.