Ethereum
Last updated
Last updated
Ethereum is a decentralized, open-source blockchain system that features smart contract functionality. It was proposed in late 2013 by programmer Vitalik Buterin and development was crowdfunded in 2014. The network went live on July 30, 2015. Ethereum allows developers to build and deploy decentralized applications (dApps) and is powered by its native cryptocurrency, Ether (ETH).
In the Ethereum universe, there is a single, canonical computer (called the Ethereum Virtual Machine, or EVM) whose state everyone on the Ethereum network agrees on. Everyone who participates in the Ethereum network (every Ethereum node) keeps a copy of the state of this computer. Additionally, any participant can broadcast a request for this computer to perform arbitrary computation. Whenever such a request is broadcast, other participants on the network verify, validate, and carry out ("execute") the computation. This execution causes a state change in the EVM, which is committed and propagated throughout the entire network.
Ethereum architecture consists of multiple entities that make its blockchain network. An Ethereum network has all the nodes connected to each other using the P2P network protocol; each node keeps the latest copy of the Ethereum blockchain ledger. A user can interact with the Ethereum network via the Ethereum client. The Ethereum client can be a desktop/mobile/web page:
Let's discuss these entities:
In a P2P network, two or more computers are connected to share their resources without going to a centralized server or machine. Nodes connected in a P2P network can share or consume network resources.
Nodes are devices in the blockchain network, which make the mesh of the blockchain network. Nodes can perform various types of tasks, such as being an active computer, cell phone, or disk drive as long as they are connected to the internet, and they participate in a blockchain network.
A node keeps the latest copy of the blockchain data (ledger) and, in some cases, processes the transactions as well. Miners put nodes on the network and willingly share their computing power or disk space. Nodes can be of two types—full nodes or light nodes.
A full node in a blockchain network maintains the complete data structure of the blockchain ledger and participates in the blockchain network by verifying every block and transaction using their consensus rules. Full nodes always keep the latest copy of the ledger.
A light node does not maintain the full copy of the blockchain ledger. It verifies the transaction using a method called Simple Payment Verification (SPV). SPV allows a node to verify whether a transaction has been included in the blockchain or not. This is verified without the need to download the entire blockchain on a machine. A light node just downloads the header information of the blocks, hence lower storage space is required in running light nodes.
Owners of the nodes willingly contribute their computing resources or hard disk space to store and validate transactions; in return, they collect block reward and transaction fees from the transactions. The nodes that perform transaction execution and verification are called miners.
The blockchain maintains a series of blocks. Each block is linked together with the last generated block. A block contains multiple transactions. At the time of writing this book, blocks are generated using a PoW consensus algorithm called Ethash in Ethereum. In future it is planned to change to PoS.
Miners share their processing power with the Ethereum blockchain network to process all pending transactions and generate a new block. Each block is generated in approximately 15 seconds. At the time of writing, a miner who generates the block is rewarded with 3 ETH in their wallet. It is proposed that, in the future, it will be reduced from 3 ETH to 2 ETH per block. It may change in future as well.
Each block has a defined gas limit: as of now, it is 8 million gas per block. This means that the total gas consumed by the transactions included in the block cannot exceed the 8 million gas limit per block.
A block contains a block header and transactions. A block can contain at least one transaction. A new block is added to the blockchain and linked to the previous block. The very first block in the blockchain is called the genesis block:
The block header contains metadata about the block and the previous block. It contains multiple fields, but it's only necessary to understand a few to have an idea of block generation:
The Parent Hash always points to the parent block of the newly generated block. This child-to-parent link goes on until the genesis block.
The Nonce is the number that is found by the miner to solve the cryptographic puzzle. The Receipts Root is the Keccak 256-bit hash of the root node of the tree structure, which is populated with the receipts of each transaction.
The Timestamp is the time when the block is found and added to the blockchain.
The Transactions Root is the Keccak 256-bit hash of the root node of the tree structure, which is populated with each transaction.
The State Root is the Keccak 256-bit hash of the root node of the state tree, after all transactions are executed.
First, Ethereum’s consensus mechanism has transitioned from Proof of Work (PoW) to Proof of Stake (PoS) with the Ethereum 2.0 upgrade. In PoS, validators are selected to propose and validate new blocks based on the amount of ETH they have staked, rather than relying on computational power, which improves energy efficiency and security.
Cryptography techniques are central to Ethereum’s security. It uses Elliptic Curve Digital Signature Algorithm (ECDSA) for public-key cryptography, allowing users to generate a private-public key pair. This ensures that only the owner of a private key can authorize transactions, while the public key allows others to verify the transaction’s authenticity.
Ethereum operates on a layered structure, where Layer 1 is the base blockchain responsible for transaction validation, security, and consensus, while Layer 2 solutions such as rollups and state channels are built on top to enhance scalability and reduce transaction costs without compromising the security of the base layer.
At the heart of Ethereum are smart contracts, which are self-executing programs stored on the blockchain. They automate and enforce agreements between parties without intermediaries. Written primarily in Solidity, smart contracts allow for the development of decentralized applications (dApps) and decentralized finance (DeFi) systems, making Ethereum the foundation for many Web3 innovations.