Most people familiar with cryptocurrencies know that a blockchain is a chain of transaction blocks tied together by cryptographic hashes. Many could also identify what a smart contract can do, based on an understanding of Ethereum. However, when it comes to more technical terminology, such as Virtual Machines, Turing-completeness, or opcodes, it can start to get a little too technical. Here, we explain some of these concepts in a beginner-friendly way.
What is a Virtual Machine?
Ethereum introduced the first virtual machine, so we’ll use it as an example to explain how one works. Essentially, it’s a processing machine for smart contracts running on Ethereum. In this context, a smart contract can be anything from a simple ERC20 token to a more complex set of code underpinning a decentralized application.
The Ethereum Virtual Machine (EVM) creates an abstraction layer between the smart contract code and the machine that executes it – the Ethereum network. Smart contracts on Ethereum are coded in Solidity, a programming language developed by one of the Ethereum founding members, Dr. Gavin Wood.
The EVM doesn’t execute Solidity code directly. Instead, when a developer is ready to deploy their smart contract, the code is compiled into opcodes. Opcodes are a set of 140 unique instructions that the EVM uses to execute specific tasks based on the smart contract’s coded instructions.
Each opcode has a defined base gas cost, although some may also charge a dynamic gas cost. Gas is the computational effort that it will …
Story continues on Zycrypto