Introduction
After understanding the basic concept and meaning of Ethereum, next we will learn and explore the operation principle of Ethereum. Ethereum can not operate without the combination of the Solidity language, the Ethereum Virtual Machine and the consensus mechanism.
Concensus Mechanism
As we have learned in previous courses, blockchain networks need to reach a consensus before adding new blocks. The consensus mechanism, in turn, uses a network-specific cryptographic verification method to determine whether a particular transaction is legitimate or not. The Bitcoin network was the first blockchain network to use a proof-of-work (PoW) mechanism of work, and the Ethereum network, created as a reference to the Bitcoin network, was also the first to use a proof-of-work consensus mechanism to ensure that nodes across the network could agree on the state of the blockchain and ensure that the network functioned properly.
In September 2022, the Ethereum network officially completed The Merge, moving from Proof of Work to Proof of Stake (PoS). The PoW mining mechanism, which consumes computer power, is replaced by staking ETH as a verifier.
In the consensus mechanism of Ethereum, if a user wants to become a verifier, he must deposit 32 ETH into the deposit contract and run three separate software: execution client, consensus client and verifier. When depositing ETH, the user enters an activation queue that limits the rate at which new verifiers can join the network. Upon activation, the verifier will receive new blocks from peer nodes on the Ethereum network. The transactions delivered in the block are re-executed and the block signature is checked to ensure that the block is valid. The verifier then sends a vote in support of the block across the network (called authentication).
In proof-of-stake, the rhythm of generating blocks is fixed. Time in Ethereum is divided into time slots (12 seconds) and time periods (32 time slots). In each time slot, a verifier is randomly selected as the block proponent. This verifier is responsible for creating new blocks and sending them to other nodes on the network. Also, in each time slot, a committee of verifiers is randomly selected to determine the validity of the proposed block by their vote.
Compared to proof-of-work, the adoption of proof-of-stake gets rid of a lot of computer operations, no longer requires the large amount of energy generated in computing, while the threshold is lower, hardware requirements fall, participants can participate without purchasing high-performance mining equipment, and the risk of centralization is reduced by adding nodes that protect the security of the network.
Ethereum Virtual Machine
The Ethereum Virtual Machine (EVM) is an environment that allows smart contracts to run, allowing programmers to upload code to the Ethereum blockchain network and enabling the emergence of many decentralized applications (dApps). Alternatively, the EVM is a large computer distributed throughout the network, on which the code and data (specified by code and state variables) of each contract can be shared by all nodes. Each time a new Ethereum block is verified, an update of all state variables is determined, including the balance of all accounts. The Ethereum virtual machine can be built in order to provide a stable and reliable operating environment for smart contracts and to guarantee a high degree of certainty in the operating results.
Solidity Programming Language
Solidity is a statically typed programming language with syntax heavily influenced by JavaScript, which allows programmers to create smart contracts using the Solidity language. Currently, smart contracts running on the Ethernet blockchain network are written in the bytecode language and run on the Ethernet Virtual Machine (EVM).
Disclaimer
-
Crypto investment involves significant risks. Please proceed with caution. The course shall not be considered investment or financial advice.
Next: Lesson 3 - Introduction to Major EIP and ERC on Ethereum