Mastering Ethereum
上QQ阅读APP看书,第一时间看更新

Introducing the Ethereum Virtual Machine

The Ethereum Virtual Machine (EVM) is a virtual machine that allows code to be executed with limitations regarding gas costs and price, where each individual interacting with it must pay a fee to protect the network from spamming attacks, so that many decentralized nodes can interact with each other using the same software. It processes bytecode that gets generated with assembly code, which, in turn, uses instruction called operational codes (opcodes). It's a Turing complete computer.

When I say Turing complete, I mean that the smart contract programming languages running on top of Ethereum have the following properties:

  • They have unlimited access to random access memory (RAM)
  • They can make decisions based on the information available in memory
  • They can run forever with the help of while, for, and recursive loops
  • They can use functions

What this means, is that smart contracts are capable of executing any operation that you give them, given enough time and resources. This is important to understand to avoid confusions when someone says that Ethereum is a Turing complete blockchain.