0% found this document useful (0 votes)
0 views

Lecture 11. Ethereum and EVM Overview

Ethereum is a decentralized blockchain platform that enables smart contracts and decentralized applications (dApps) using its native cryptocurrency, Ether (ETH). The Ethereum Virtual Machine (EVM) executes smart contracts, ensuring reliability and security across the network, while Ethereum 2.0 enhances scalability and energy efficiency through a transition to Proof of Stake. Despite challenges like scalability and high gas fees, Ethereum's robust ecosystem supports various applications and continuous innovation.

Uploaded by

malik saad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

Lecture 11. Ethereum and EVM Overview

Ethereum is a decentralized blockchain platform that enables smart contracts and decentralized applications (dApps) using its native cryptocurrency, Ether (ETH). The Ethereum Virtual Machine (EVM) executes smart contracts, ensuring reliability and security across the network, while Ethereum 2.0 enhances scalability and energy efficiency through a transition to Proof of Stake. Despite challenges like scalability and high gas fees, Ethereum's robust ecosystem supports various applications and continuous innovation.

Uploaded by

malik saad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 21

Ethereum and EVM Overview

Kiran Amjad

1
Introduction to Ethereum
• Ethereum is a decentralized, open-source blockchain platform that enables smart
contract functionality, allowing developers to create decentralized applications
(dApps) beyond cryptocurrency use.
• It was proposed by Vitalik Buterin in 2013 and officially launched in 2015 to
address the limitations of Bitcoin's scripting capabilities.
• Ethereum serves as a global computing platform using Ether (ETH) as its native
cryptocurrency to pay for transaction fees and computational services.
• The Ethereum network supports both public and private deployments, making it
flexible for enterprise and community use.
• The core innovation of Ethereum is the Ethereum Virtual Machine (EVM), which
executes code exactly as programmed, without downtime or third-party
interference.
Key Features of Ethereum
•Ethereum introduces programmable smart contracts that are automatically
executed when specific conditions are met, enabling trustless automation.
•Ether (ETH) is used to incentivize participants, pay for gas (transaction and
computation fees), and serve as a store of value within the network.
•Ethereum is Turing-complete, meaning developers can write complex logic
into contracts to suit a wide range of applications.
•Ethereum’s decentralized structure ensures that no central authority controls
the network, enhancing transparency and censorship resistance.
•Its large and active developer community contributes to a robust ecosystem of
libraries, tools, and standards.
Ethereum Virtual Machine (EVM)
• The EVM is the computation engine of Ethereum that executes smart contracts
and runs the entire network’s decentralized logic.
• It provides a runtime environment that is sandboxed and isolated from the host
computer, ensuring secure execution.
• EVM supports various programming languages (primarily Solidity and Vyper)
which are compiled into low-level bytecode for execution.
• Each Ethereum node runs the EVM, validating transactions and maintaining
consensus on the current state.
• The deterministic nature of EVM means it produces the same output given the
same input and state, ensuring reliability across nodes.
How Ethereum Transactions Work
•Ethereum transactions are digitally signed instructions from one account to
another that may involve sending ETH or triggering a smart contract.
•Every transaction must include gas fees, which are calculated based on
computational complexity and network congestion.
•When a transaction is broadcasted, it is picked up by miners (or validators
in Ethereum 2.0) who include it in the next block.
•Upon block confirmation, the transaction is finalized and the state changes
are recorded across all Ethereum nodes.
•Transactions can be simple ETH transfers, contract deployments, or
function calls to existing contracts.
Ethereum Accounts
•Ethereum supports two types of accounts: externally owned accounts (EOAs)
and contract accounts.
•EOAs are controlled by private keys and are used to initiate transactions and
hold ETH or tokens.
•Contract accounts are controlled by code and exist as deployed smart
contracts with their own logic and behavior.
•Only EOAs can initiate transactions; contracts can only respond to
transactions or trigger others during execution.
•Account balances, contract code, and storage are all part of the Ethereum
state managed by the network.
Gas and Transaction Costs
• Gas is a unit of computation that measures how much work is required to perform
operations on the Ethereum network.
• Each transaction requires a certain amount of gas, and users must specify both gas
limit and gas price to ensure successful execution.
• Gas fees compensate miners or validators for including and processing the
transaction in a block.
• Complex operations such as loops or storage changes require more gas,
preventing abuse and denial-of-service attacks.
• Unused gas is refunded, while exceeding the gas limit causes the transaction to
fail but still consume the gas sent.
Ethereum Blockchain Structure
•Ethereum uses a blockchain structure where each block contains a list of
transactions and a reference to the previous block.
•Unlike Bitcoin, Ethereum blocks include not only transactions but also
the resulting state changes and logs.
•Each block contains metadata such as timestamp, block number, miner
address, and gas usage data.
•Ethereum blocks are added through a consensus mechanism (originally
Proof of Work, now Proof of Stake with Ethereum 2.0).
•The block structure allows the network to maintain an immutable,
chronological record of state transitions.
Solidity and EVM Bytecode
• Smart contracts written in Solidity are compiled into EVM bytecode before
deployment on the blockchain.
• Bytecode is the low-level machine-readable code that the EVM can execute
securely and deterministically.
• Developers must be cautious about efficiency, as each bytecode operation
consumes gas, directly impacting cost.
• Tools like Remix IDE and Hardhat help write, test, and deploy Solidity contracts
to the EVM.
• Understanding bytecode is useful for optimizing smart contracts and analyzing
on-chain behaviors.
State and Storage in Ethereum
•Ethereum maintains a global state that includes account balances, smart contract
code, and storage variables.
•State changes occur as transactions are executed and stored on the blockchain for
future reference.
•Smart contracts can persist data using key-value mappings in their internal storage,
which is expensive in terms of gas.
•The EVM uses Merkle Patricia Trees to efficiently manage and verify the state
across the network.
•State is essential for maintaining the logic and data flow of dApps built on
Ethereum.
Events and Logs in Ethereum
•Events in Ethereum allow smart contracts to communicate with external
applications by emitting logs during execution.
•Logs are stored on the blockchain but not within the contract's internal state,
making them cheaper to access.
•dApps use events to trigger UI updates or notify users about changes such
as transfers, approvals, or executions.
•Events support indexed parameters, enabling efficient searching and
filtering on the blockchain.
•Using events improves contract observability and helps with debugging and
analytics.
Consensus in Ethereum
•Ethereum originally used Proof of Work (PoW) for consensus, which required
miners to solve computational puzzles.
•Ethereum transitioned to Proof of Stake (PoS) with the Ethereum 2.0 upgrade to
enhance scalability and energy efficiency.
•In PoS, validators are randomly selected to propose and attest blocks based on the
amount of ETH they have staked.
•This new mechanism reduces energy consumption while maintaining
decentralization and security.
•Consensus ensures that all network participants agree on the current state and
transaction history.
Ethereum 2.0 and The Merge
•Ethereum 2.0 refers to the major upgrade that moved Ethereum from PoW to PoS
through an event known as "The Merge."
•The Merge combined the original Ethereum chain with the Beacon Chain, which
was already running PoS.
•Post-Merge, Ethereum now benefits from increased energy efficiency and
foundation for future scalability improvements.
•Upcoming enhancements like sharding will further improve throughput and reduce
costs.
•Ethereum 2.0 aligns the network with long-term sustainability and mass adoption
goals.
Ethereum Use Cases
•Ethereum enables a wide variety of applications including decentralized finance
(DeFi), NFTs, gaming, and supply chain tracking.
•DeFi platforms like Uniswap, Compound, and Aave leverage Ethereum’s smart
contract functionality to offer trustless financial services.
•Non-fungible tokens (NFTs) use Ethereum to establish ownership and
transferability of unique digital assets.
•Enterprise solutions use Ethereum for transparent auditing, digital identity, and
secure data sharing.
•Ethereum’s open ecosystem encourages continuous innovation through
community-built tools and dApps.
Challenges in Ethereum
• Scalability remains a concern, as Ethereum can only handle a limited number of
transactions per second in its base layer.
• High gas fees during network congestion make small or low-value transactions
less viable.
• Smart contract vulnerabilities and hacks have led to significant financial losses
and require better security practices.
• Regulatory uncertainty around cryptocurrencies and smart contracts may impact
Ethereum’s adoption in some regions.
• Competing blockchains with faster speeds and lower costs present alternatives to
Ethereum, challenging its dominance.
The Ethereum Ecosystem
•Ethereum's ecosystem includes wallets (like MetaMask), developer tools (like
Truffle), testnets (like Goerli), and frameworks (like Hardhat).
•It supports a range of token standards like ERC-20 (fungible tokens) and ERC-
721 (NFTs) which power most dApps.
•Layer 2 solutions like Optimism and Arbitrum aim to enhance scalability by
offloading computation and transactions from the main chain.
•Community-driven governance, such as Ethereum Improvement Proposals
(EIPs), shapes the future of the platform.
•The vibrant developer and user community make Ethereum the most active
blockchain platform globally.
Layer 2 Solutions and Scaling Ethereum
•Layer 2 (L2) solutions are built on top of Ethereum to improve transaction speed
and reduce gas costs without sacrificing security.
•Rollups (Optimistic and ZK-Rollups) bundle many transactions off-chain and
post a summary on-chain to reduce congestion.
•Sidechains operate independently but are compatible with Ethereum, allowing
faster and cheaper interactions.
•Popular L2 platforms include Arbitrum, Optimism, Polygon, and StarkNet,
supporting dApp scalability.
•L2 adoption is critical to Ethereum's future, especially for mass adoption in
gaming, NFTs, and DeFi sectors.
Tools for Ethereum Development
• Developers use tools like Remix IDE for writing, compiling, and deploying smart
contracts in a web-based environment.
• Truffle is a development framework that supports testing, compiling, and
managing Ethereum projects.
• Hardhat provides local blockchain simulation, contract deployment, and
integration testing tools with plugins.
• MetaMask is a popular browser extension wallet that allows users to interact with
dApps and manage ETH.
• Ethereum testnets (like Goerli and Sepolia) provide safe environments to test
smart contracts before mainnet deployment.
Conclusion and Key Takeaways
•Ethereum is more than just a cryptocurrency platform it’s a decentralized
world computer enabling complex smart contracts and dApps.
•The Ethereum Virtual Machine (EVM) is at the core of the platform,
providing a secure and consistent environment for contract execution.
•Key components like gas, accounts, consensus, and storage play crucial roles
in the functioning of Ethereum.
•While Ethereum faces challenges like scalability and gas costs, continuous
improvements like Ethereum 2.0 and Layer 2 solutions show promise.
•A strong understanding of Ethereum and EVM lays the foundation for deeper
exploration into smart contract development and blockchain applications.
Discussion Questions
• How does the EVM contribute to Ethereum’s decentralized nature, and what
would be the consequences if EVM execution was not deterministic?
• In what ways does Ethereum 2.0 improve upon the limitations of the original
Ethereum architecture, and what new challenges might arise?
• Considering the high gas fees and competition from other platforms, what
strategies can Ethereum use to maintain its leadership in the blockchain space?
Next Lecture Preview

• Lecture 12 : Deploying Smart Contracts on


Testnet
Understanding the fundamental components of
blockchain.

21

You might also like