

secondary title
A simple analogy: EVM is to Ethereum, just as the Java Virtual Machine is to the Java language
Before doing development, the programmer needs to compile the Java code into bytecode, but the computer cannot recognize the bytecode. The function of the Java virtual machine is to compile the bytecode into a machine code instruction that the computer system can recognize, and then run it on the computer. run. Similarly, the EVM exists to allow programmers to use the contract code written in Solidity to run in the Ethereum environment.
It can be seen that Ethereum is equivalent to a computer environment, and EVM is responsible for compiling the contract code into machine code that Ethereum can recognize to run. When the network is relatively prosperous, that is, when the demand for developers to build applications is relatively strong, thousands of new codes are written into the Ethereum network every day or even every hour. However, if these contract codes cannot be compiled into language signals that the system can recognize, they cannot be converted into specific instructions and programs. Therefore, we can regard EVM as the most important resource converter in the Ethereum ecosystem. Without him, the code on Ethereum cannot take effect, even if the developers work tirelessly to write the programming language, it is tantamount to stopping the update. It should be noted that if the code of any program stops updating, it means that it is coming to an end. In addition, without EVM, no one can execute program software on the Ethereum protocol, because the code they write into the system is full of bugs.
secondary title
Understand the two most critical concepts: virtual machine and Turing completeness
First of all, a virtual machine (Virtual Machine) refers to a complete computer system that is simulated by software and has complete hardware system functions and runs in a completely isolated environment.
That is to say, the work that can be done on the physical computer can be realized on the virtual machine. By generating a new virtual image of the existing operating system, the virtual machine has exactly the same functions as the Windows system, but it runs independently and will not affect the real system.
Therefore, it can be understood that the Ethereum virtual machine (EVM) is the operating environment of the Ethereum smart contract, and the nodes in the system can use the EVM to run their own DAPP. In addition, since the operating environment of the Ethereum virtual machine is completely isolated from the main chain, it naturally forms a testing environment. This kind of testing environment gives many developers who have no experience in blockchain technology the opportunity to boldly try and make mistakes, because their error codes will not affect the Ethereum smart contract at all.
Second, Turing complete is a technical term, named after British mathematician Alan Turing, who invented the first Turing machine, the forerunner of today's computers. Later, the computer industry used Turing completeness to refer to calculations that can handle calculations of any complexity. Theoretically, Ethereum can deploy computer programs of any type and function, but these programs are distributed rather than centralized as we usually see, and all this needs to be attributed to the underlying design of EVM. From this perspective, Bitcoin is not Turing complete, because it is just a distributed ledger and cannot execute any applications.
secondary title
Key modules in the EVM execution process
The operation of EVM closely revolves around the ecology of Ethereum. Therefore, many Ethereum terms that make us feel obscure but familiar are actually closely related to EVM.
The first is the opcode. EVM interprets and translates instructions written by Solidity through opcodes. There are currently more than 140 different opcodes in the EVM, and they are similar to instructions issued directly by the EVM. For example, the CREAT opcode corresponds to creating a smart contract, and the STOP opcode means to suspend the running contract;
The second is the gas fee. Gas fees are the resources used to execute code in the EVM environment, measured in "gwei" (units of ether). Specifically, the execution of any transaction requires the consumption of computing resources and storage space, just like any application we download on our mobile phone requires power and memory. This part of implicit consumption is intuitively converted into explicit Gas fee costs on the chain. The relationship between EVM and Gas fees, such as cars and gasoline, every time EVM executes an instruction, it will consume the corresponding amount of Gas fees;
The last is to execute the transfer function, which is where EVM and all Ethereum users can be related. The specific steps of EVM transfer are as follows:
1) Check whether there is any error, including the transfer value and the validity of the signature, etc.;
2) Calculate the gas fee required for the transfer, and execute the command to charge the gas fee;
3) Transfer the digital assets to the specified address.
secondary title
A brief analysis of the concept and important trends of the EVM public chain
Ethereum is firmly in the leading position in the public chain track, accounting for the vast majority of the industry in terms of both the number of ecological applications and the total amount of locked positions. Therefore, the mainstream public chains on the market are all compatible with EVM, which is why they are named EVM public chains.
EVM compatibility refers to the smart contracts built on its public chain, which can be migrated and seamlessly moved back and forth on Ethereum quickly, conveniently and at low cost. At present, in the development of many public chains, EVM-compatible functions are deliberately implemented to maximize the function of undertaking Ethereum spillover projects, which is similar to the drainage in mobile Internet gameplay. Therefore, many public chain project parties will realize EVM compatibility as their biggest selling point and attraction.
secondary title
What are eWASMs? What is its relationship with EVM?
Friends who are familiar with the Ethereum ecology know that Ethereum 2.0 is the ultimate form of Ethereum. After realizing the POW-to-POS mechanism, it can handle all computing tasks with high performance, even comparable to Web2 Internet products. However, according to the current underlying design and performance of the EVM, the EVM really cannot adapt to the ideal state of Ethereum 2.0. Therefore, eWASM (ETH version of WebAssemly) has become the successor and substitute of EVM.
Let me tell you, WebAssemly is the assembly on the Web. As a Web execution environment that has emerged in recent years, it is a binary instruction format designed for stack-based virtual machines. Compared with JavaScript, it has advantages such as better performance, lower storage cost, safer execution environment, and more language support.
According to the assumption, because eWASM has better performance and better scalability than EVM, it can support programming languages such as Solidity, C++, Rust, AssemblyScript, etc., and it will be easier to develop contracts. eWASM is also compatible with current web standards, making it easier to run in common browsers, allowing users to access DApps without extensions.
In addition, Ethereum is not the only one that uses WASM as its underlying execution engine. EOS, Dfinity, Polkadot, Tron, Cardano, Spacemesh, etc. have all adopted or are using WASM.
That's all for today's sharing, and I will bring you an analysis of leading projects on other tracks later. If you are interested, you can pay attention. I will also sort out some cutting-edge consultation and project reviews from time to time, and welcome all like-minded people in the currency circle to explore together.
That's all for today's sharing, and I will bring you an analysis of leading projects on other tracks later. If you are interested, you can pay attention. I will also sort out some cutting-edge consultation and project reviews from time to time, and welcome all like-minded people in the currency circle to explore together.