EVM is the abbreviation of Ethereum Virtual Machine. For users who have not been exposed to software development, EVM may seem obscure and difficult to understand. However, if we first compare it to what a Java virtual machine is, it may be easier to understand.
1. Simple analogy: EVM is to Ethereum as Java Virtual Machine is to Java language
Before development, programmers need to compile Java code into bytecode, but computers cannot recognize bytecode. The role of the Java virtual machine is to compile bytecode into machine code instructions that the computer system can recognize and then run on the computer. Similarly, the existence of EVM is to allow programmers to run contract codes written in Solidity in the Ethereum environment.
It can be seen that Ethereum is equivalent to a computer environment, and EVM is responsible for compiling contract codes into machine codes that Ethereum can recognize and run. When the network is relatively prosperous, that is, when developers have a strong demand for building applications, thousands of new codes will be 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 it, the code on Ethereum will not be effective, and even if developers are diligently writing programming languages, it is equivalent to stopping. 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 in this way, the code they write into the system will be all bugs.
To further strengthen readers' understanding of EVM, we might as well clarify two concepts first: virtual machine and Turing completeness.
2. Understand the two most critical concepts: virtual machines and Turing completeness
First of all, a virtual machine (VM) refers to a complete computer system with complete hardware system functions that is simulated by software and runs in a completely isolated environment.
That is to say, the work that can be done in a physical computer can also be done in a virtual machine. The virtual machine generates a new virtual image of the existing operating system and 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 Ethereum's virtual machine (EVM) is the operating environment of Ethereum smart contracts, and nodes in the system can use EVM to run their own DAPPs. In addition, since the operating environment of the Ethereum virtual machine is completely isolated from the main chain, this naturally forms a testing environment. This testing environment gives many developers who have no experience in blockchain technology the opportunity to boldly try and make mistakes, because their erroneous codes will not affect Ethereum smart contracts at all.
Secondly, Turing complete is a technical term, named after British mathematician Alan Turing, who invented the first Turing machine, which is the forerunner of today's computers. Later, the computer industry used Turing completeness to refer to the ability to handle calculations of any complexity. In theory, Ethereum can deploy computer programs of any type and function, but these programs are distributed, not centralized as we usually see, and all this is due 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 application.
Finally, combining these two concepts, we can see that EVM is a fully virtualized computer system that can perform calculations of any complexity. From this point of view, it is like the brain of Ethereum.
3. Critical modules in the EVM execution process
The operation of EVM is closely related to the Ethereum ecosystem. Therefore, many Ethereum terms that seem obscure but familiar to us are actually closely related to EVM.
The first is the opcode. EVM interprets and translates instructions written in Solidity through opcodes. There are currently more than 140 different opcodes in EVM, which are similar to instructions issued directly by EVM. For example, the CREAT opcode corresponds to creating a smart contract, and the STOP opcode means pausing a running contract;
The second is the Gas fee. The Gas fee is the resource used to execute code in the EVM environment, measured in "gwei" (Ether unit). Specifically, the execution of any transaction requires the consumption of computing resources and storage space, just like any application downloaded on a 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 is like that between a car and gasoline. Every time EVM executes an instruction, it consumes a corresponding amount of Gas fees;
The last step is to execute the transfer function, which is also where the EVM and all Ethereum users can be related. The specific steps of the EVM when transferring money are as follows:
1) Check whether there are any errors, including the transfer value and the validity of the signature;
2) Calculate the Gas fee required for the transfer and execute the Gas fee collection instruction;
3) Transfer digital assets to the specified address.
It should be noted that if EVM detects that the transferor has not paid enough fees, the transfer will be rolled back and the transfer fee will not be refunded, and it will be paid directly to the miner. In addition, if the transaction fails due to an error in the recipient's address, EVM will return the transfer principal and fees to the payer intact.
4. A brief analysis of the concept and important trends of the EVM public chain
Ethereum has firmly established itself as the leader in the public chain sector, accounting for the vast majority of the industry in terms of both the number of ecological applications and the total locked-up volume. Therefore, the mainstream public chains on the market all choose to be compatible with EVM, which is why they are named EVM public chains.
EVM compatibility means that the smart contracts built on its public chain can be migrated back and forth on Ethereum quickly, conveniently and at low cost, and can be seamlessly transferred. At present, many public chains are under development and have deliberately implemented EVM compatibility functions to maximize the ability to undertake Ethereum overflow projects, similar to the traffic diversion in mobile Internet gameplay. Therefore, many public chain project parties will achieve EVM compatibility as their biggest selling point and attraction.
Of course, judging from the current market situation, the final winner of the EVM-compatible chain is still few and far between. The OKC public chain is likely to succeed in the next stage by virtue of its compatibility with EVM.
On May 10, 2021, the OKC public chain mainnet officially achieved EVM compatibility, thus entering a new era. As a 100% open source public chain, OKC generates a new block every 0.5 seconds, with excellent performance. Compared with other EVM-compatible public chains, it has more stable performance, more efficient speed, and a stronger ecological scale.
OKC public chain is backed by OKX, which has been upgraded to a global Web3 infrastructure service provider. OKC's Web3 ecosystem already covers the world's largest digital asset trading platform, Web3 digital wallets compatible with the world's best currencies, and the most cost-effective NFT market. With this, the OKC public chain can obtain a steady stream of ecological resources, and after being compatible with EVM, these advantages will be continuously magnified and accumulated. Compared with other EVM public chains, the OKC public chain is even more unique.
One example is enough to prove the unique advantages that OKC can bring into play after being compatible with EVM:
After the OKC public chain was launched in 2021, the developer community open-sourced the original EVM virtual machine code and shared it with the Cosmos community, solving the compatibility problem with Ethereum for the Cosmos network.
5. What is eWASM? What is its relationship with EVM?
Friends who are familiar with the Ethereum ecosystem know that Ethereum 2.0 is the ultimate form of Ethereum. After implementing 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 EVM, EVM is really unable to adapt to the ideal state of Ethereum 2.0. Therefore, eWASM (ETH version of WebAssemly) has become the successor and substitute of EVM.
WebAssemly is the assembly language 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 better performance, lower storage costs, a more secure execution environment, and more language support.

According to the assumption, eWASM has better performance and better scalability than EVM, and can support programming languages such as Solidity, C++, Rust, and AssemblyScript, making it easier to develop contracts. eWASM is also compatible with current Web standards, making it easier to run in ordinary browsers, and users can 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 already or are using WASM.
#ETH #Binance #Web3 $BTC #热门话题 #pyth
It is worth noting that Ethereum 2.0 is divided into three stages: PoS, sharding, and the last one, eWASM. At present, the transition to POS, that is, the merger, which everyone is most concerned about, is still in the preparation process. Therefore, eWASM, which still needs time, has not been updated frequently, but its concept is attractive enough. Whether eWASM can really leverage the entire Ethereum 2.0 as it is envisioned, we will continue to pay attention.