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

Lecture 2

Uploaded by

boooom86608
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Lecture 2

Uploaded by

boooom86608
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

Ethereum Blockchain

by Muhammad Usama Riaz


Learning Objectives - Ethereum Blockchain

● Discuss, at a conceptual level, the innovation of the


Ethereum Blockchain, namely, the smart contract.
● Illustrate Ethereum Blockchain protocol: structural
elements and operational aspects.
● Demonstrate the concept of gas, the fuel or payment
model for code execution, and the incentive model of
Ethereum Blockchain.
What we going to learn this week

○ Ethereum Blockchain
■ Ethereum Blockchain: Smart Contracts
■ Ethereum Structure
■ Ethereum Operations
■ Incentive Model
● Bitcoin blockchain is the mother of all blockchains.
○ It was intended for peer to peer transfer of value
○ It does that well.
● Around 2013, a framework for code execution was introduced by
Ethereum Founders.
● The centerpiece and thrust of this Ethereum blockchain is a smart
contract.
Togged diagram
What is Smart Contract ?
What is Smart Contract
● A smart contract is a piece of code deployed in the blockchain node.
● Execution of a smart contract is initiated by a message embedded in
the transaction.
● Digital currency transfer request simple addition and subtraction.
● Ethereum enables transaction that may carry out more sophisticated
operations.
For example, a transaction could require a conditional transfer, it may
require some evaluation, it may need more than one signature for transfer
of assets, or it may involve waiting for a specific time or date.
Smart Contracts vs Traditional Contracts
Traditional Contracts Smart Contracts

Third Party Government, banks, None


lawyers, etc.
Execution Time Days or weeks Minutes

Transparency Unavailable or little Available

Security Limited Cryptographically


secure
Cost Expensive Cheap

Signature Manual Digital

Archiving Difficult Easy


Types of Smart Contracts

● Smart Legal Contracts: These are used when there is a need to impose
legal obligations towards both parties of the contract.
● DAO: Decentralized Autonomous Organization includes blockchain-related
communities each having particular responsibilities and specific roles in a
certain situation. Their roles are codded into blockchain contracts.
● ALC: Application Logic Contracts include application-based codes that allow
it to sync with other blockchain contracts. This enables the use of IoT with the
blockchain.
Smart Contract Structure

● A smart contract resembles a class definition in an object oriented


design.
● It has data, functions or methods with modifiers public or private
● Along with getter and set of functions.
● Specific programming languages have been designed for coding
smart contracts.
● Solidity is one such language.
Code Execution

● Where does the code in the smart contract get executed?


● Where is it located in a node?
● We need a computational infrastructure to execute any arbitrary code.
● Every node in Ethereum network should be able to execute the code
● Irrespective of that underlying type of hardware or operating system.
Ethereum Virtual Machine (EVM)

● An EVM provides a run anywhere obstruction layer for the contract


code.
● A smart contract written a high level programming language is
translated into EVM byte code, and then, deployed on the Ethereum
Virtual Machine, EVM.
● Every node will host the same smart contract codes on the EVM.
Ethereum Structure
Ethereum Virtual Machine (EVM)

● Ethereum formally introduce the concept of an account as a part of


the protocol.
● The account is the originator and the target of a transaction.
● A transaction directly updates the account balances as opposed to
maintaining the state such as in the bitcoin UTXOs.
● It allows for transmit of value and messages and data between the
accounts that may result in the state transitions.
● These transfers are implemented using transactions.
Types of accounts

● There are two types of accounts


● Externally Owned Accounts and Contract Accounts.
● Externally Owned Accounts or EOA are controlled by private keys.
● Contract Accounts or CA are controlled by the code and can be
activated only by an EOA.
● An externally owned account is needed to participate in the Ethereum
network.
● It interacts with the blockchain using transactions

You might also like