Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 41

Ethereum World Computer

Programmable Blockchain
What is Ethereum?

• Open-source Public Blockchain Platform

• Aims to "decentralize the web" by introducing static content publication,


dynamic messages, trustless transactions and an integrated user-interface

• Enable powerful programming through “Smart Contracts” and development of


“Decentralized Applications” (DApps)

• Peer to peer network protocol, with all nodes running the EVM

• Ethereum can be used for virtually any kind of transaction or agreement that
has an economic or governance aspect
2
Ethereum History

• Ethereum is an open blockchain platform that lets anyone build and use decentralized
applications that run on blockchain technology

• Introduced in 2013 by Vitalik Buterin (with Gavin Wood and Jeffrey Wilcke )

• Ethereum White Paper : ‘Ethereum: A Next-Generation Cryptocurrency and Decentralized


Application Platform’
• Born: January 31, 1994 
• Nationality: Russian-Canadian
• Alma mater: University of Waterloo (dropped out)

▪ Thiel Fellowship Award, 2014


▪ World Technology Award in the IT Software category, 2014
▪ Fortune 40 under 40 list, 2016
▪ Forbes 30 under 30 list, 2018
▪ Fortune the ledger 40 under 40 list, 2018
▪ University of Basel Honorary doctorate, 2018.
Ethereum - History

$18.4
Million

Blockchain Development Crowdfund Raise Founders


● White paper released ● In July-August, 2014 ● Vitalik Buterin, Mihai
2013. ● 11.9 million Ether were Alisie, Anthony Di
● Written in C++, Go & Rust. sold in crowd funding. Iorio, and Charles
● Initial development under ● Third highest crowd- Hoskinson
Ethereum Switzerland funded project at that ● Dr. Gavin Wood
● Ethereum Foundation was time ● Joseph Lubin
founded in June 2014
Release History & Roadmap

May 2015 30 July 2015 14 March 16 October 28 February TBA


Olympic Frontier 2016 2017 2019 Serenity
(Testnet) (Beta) Homestead Metropolis Metropolis Version 4
Version 0 Version 1 Version 2 (v. (v. Constantinople)
Byzantium) Version 3.5
Version 3
Ethereum Fork History

6
Latest Release

• Metropolis - v.Constantinople (On block 7,280,000 )

• Decrease Block Reward from 3 to 2 ETH.

• Delay the “Difficulty Bombing” to at least 12 months

• Block time reduced to 12 seconds (previously ~21 sec.)

• Reduction of Ethereum inflation to a low of 4.24 percent.

• Expected to reduce gas cost and cost on EVM.

7
Introduction to Ethereum

• A peer-to-peer network with an exchangeable crypto-currency that allows nodes to share


computing resources for the execution of programmable smart contracts on the blockchain.

• ‘World Computer’ : A single computing platform which anyone in the world is able to use.
– Any number of programs can be encoded and executed,
– Any participating code can interact and
– Have access to the state of each one of these programs
Features

• Adaptable and Flexible


• User authentication, verified by the use of cryptographic signatures.
• Easily deployable payment logic
• Total DDoS resistance
– Each application on Ethereum is not executed on any single node;
– Rather it is executed on each and every node on the system
• Limitless interoperability
– Each Ethereum contract can seamlessly interact with any other contract instance via the
provided interfaces
• No server infrastructure
Ethereum versus Bitcoin

• Similarities

– Ethereum has a blockchain


– Ethereum is public and permissionless
– Ethereum has Proof-of-Work (PoW) mining
– Ethereum has an inbuilt cryptocurrency
• Differences

– Ethereum’s block time is shorter


– Ethereum has smaller blocks
– The Ethereum Virtual Machine can run smart contracts
– ETH can issue tokens
Bitcoin vs Ethereum

Computational
Comparison:
Distributed Data Distributed Data
Storage Storage +
Bitcoin:
Computing
Jade sends 10BTC to Peter Value Token Bitcoin (BTC) Ether (ETH)
Block Time 10 Minutes 10-20 Secs
Block Size ~1 MB Depends (~25KB)
Ethereum:
Scripting Limited Smart Contract
Send 10ETH from Jade to Peter Shrinks ½ every 2.1L
Economic Model Fixed
if Jade’s balance is 15ETH and Blocks
the date is after 16.10.2019 Mining Reward 50 > 25 > 12.5 5>3>2
Transaction Fees Simple Complex
Computational Power Distributed Storage Turing Complete
Ethereum

Ethereum blockchain is a horizontal technology comprised of 4 basic components

Digital Ledger: A continually updated, network hosted database of all transactions

Consensus Mechanism : Responsible for verifying and Updating transactions

Digital Asset: The asset transacted on a Blockchain

Network Participants: Able to manipulate the Ledger and view past transactions
DApp - Definition & Features

• DApp is an abbreviated form for decentralized application.

• A DApp has its backend code running on a decentralized peer-


to-peer network

• Contrast this with an app where the backend code is running


on centralized servers.

• DApps have been mostly popularized by distributed ledger


technologies, namely the Ethereum Blockchain

• App = frontend + server

• DApp = frontend + contracts

13
Difference between App and dApp

- No notion of centrality - Notion of centrality


- Runs on a peer to peer network - Runs on a centralized server
- Source code of open source app is - Source code of app is not available to
available to all. all.
- App has crypto-tokens/digital assets - Chances of failure is more
for fueling itself. - Prone to attacks
- Generates tokens and has an inbuilt - Less reliable
consensus mechanism.
14
Ethereum dApp Architecture

HTML CSS JavaScript Ethereum


Client

Ethereum Ethereum
Web3 JSON - RPC Client Client
Ethereum dApp

Ethereum
Smart Contracts
Client

geth cpp pygethapp

Ethereum Network

15
Ethereum dApp Architecture

● Frontend: HTML + CSS + JavaScript

● web3.js: Ethereum JavaScript Library

- Is a collection of libraries
- allow you to interact with a local or remote ethereum node
- HTTP or IPC connection.
- reads and writes data from the blockchain with smart contracts.
- Web3.js talks to The Ethereum Blockchain with JSON RPC

16
Ethereum dApp Architecture

● JSON-RPC:

- Is a remote procedure call protocol encoded in JSON


- It is a simple protocol defining only a few data types and commands
- Is a stateless, lightweight remote procedure call (RPC) protocol.

● Ethereum Client:
- It refers to any node able to parse and verify the blockchain
- It also provides interfaces to create transactions
- Mine blocks which is the key for any blockchain interaction
- Example: geth (go-ethereum), pyethapp (Python), cpp-ethereum

17
Ethereum Tech Stack

Front-End / UI / DApp HTML LAMP iOS Android IoT API

Truffle
Abstracted Out
Web3

Smart Contracts
C++ Go
Ethereum Core ETH Geth Java Haskell

Ethereum Client

Windows Server Linux


Networking Layer
Dev VM

18
How Does Ethereum Work?
Segway into Ethereum Virtual Machine

19
How Ethereum Works: part 1

Wallet for managing Ether: Smart


Contracts/Keys to speak to network

Node: Connects to network

dApp: Interacts with Contracts on the


Network for a fee

20
How Ethereum Works: Part 2

States: Unique configuration of information in a

machine

Transitions: Transition Between State

Transition Conditions: Condition for State Change

Transition Actions: Action associated with transition

State Actions: Actions associated with given state


21
How Ethereum Works: Part 3

• When blockchain is created, genesis block is the first state


• ”blank state” - no transactions yet
• Transactions execute and move into final state
• Final state = current state

22
How Ethereum Works: Part 4

• These transactions of state, along with related data is grouped into blocks
and chained together

23
How Ethereum Works: Part 5

• State transition through transactions only occur when valid


• Currently validated through Proof of Work
• Forks can appear, but to determine which path is most valid ETH uses
• GHOST protocol (Greedy Heaviest Observed Subtree)

24
Summary

• State Machine

• Transactions initiates state change

• GHOST protocol ensure longest chain is the main chain

Next we dive into the EVM and break it down to its smallest
components!

25
What is EVM

“Runtime environment for smart contracts in Ethereum”


● It is sandboxed and isolated; meaning the code running inside EVM has no access to network, filesystem, or
other process

● It is a software that can execute Ethereum bytecode

● Smart contracts executed in EVM have limited access to other smart contracts (yet vulnerabilities are still
rampant)

● Follows the EVM spec (Eth protocol)

● Runs on a computer or server (in the node)

● Implemented in multiple languages

26
Why EVM

Why is a Virtual Machine needed?

Anything that runs on a blockchain needs to be immutable and must have the

ability to run through multiple nodes without compromising on its integrity.

To accomplish this, 3 things are needed:

● Deterministic

● Terminable

● Isolated
27
Ethereum Virtual Machine (EVM)

• Ethereum, defines a set of generalized protocols which


have become the pillars of the development of
decentralized applications. At the heart of this, lies the
Ethereum Virtual Machine.
Ethereum Virtual Machine (EVM)

• EVM is a virtual machine designed to be run by all participants in a peer to peer network

• Can read and write to a blockchain both executable code and data

• Verify digital signatures, and is able to run code in Turing complete manner

• It will only execute code when it receives a message verified by a digital signature, and the
information stored on the blockchain tells it is appropriate to do so.

• Practically, EVM can be thought of as a large decentralized computer with millions of objects
called “accounts” which have the ability to maintain an internal database, execute code and
also they can talk to each other.
Ethereum Virtual Machine (EVM)

• The Ethereum virtual machine is the engine in which transaction code gets executed

• E.V.M. enables the development of potentially thousands of different applications all on one
platform

• Contracts written in a smart contract-specific programming language are compiled into


‘bytecode’, which an EVM can read and execute.

• It actually handles the internal state and computation in Ethereum.


Turing Completeness

● Machine that can simulate any computer algorithm

● Allows for loops, makes Ethereum vulnerable to halting problem

● Cannot determine whether a program will run infinitely

● System fees (gas) prevent this from occurring > protects network from malicious
actors trying to put network in infinite loop

31
Ethereum Concepts - Accounts

• Accounts

– Entity that holds an internal state that is associated with an account


– The public key is also considered the address of the account.

There are two types of accounts:

– Externally Owned Accounts (EOA)


– Contract Accounts
Ethereum Concepts - Accounts

• Externally Owned Accounts (EOA)

– A personal account controlled by a private key.


– The owner of the private key can send ether or messages to other external accounts.

• Contract Accounts

– Accounts which are controlled by smart contract code


– EOA can activate these contracts
– The smart contracts get executed whenever a transaction is being sent to the contract
account.
– The users can create new contracts and deploy them in to the blockchain to perform
specified tasks
Ethereum Concepts - Ether

Ether

• Ether is the name of the crypto-currency used to


pay for transactions on the ethereum network.

• Asides from paying for general transactions and


services, Ether is also used to buy Gas, which in Unit Wei Value Wei
turn is used to pay for computation within the wei 1 wei 1
EVM.
Kwei (babbage) 1e3 wei 1,000
Mwei (lovelace) 1e6 wei 1,000,000
• Ether is the metric unit and has a lot of
Gwei (shannon) 1e9 wei 1,000,000,000
denominations which help accurately pay for
transactions and gas. microether (szabo) 1e12 wei 1,000,000,000,000
1,000,000,000,000,
milliether (finney) 1e15 wei
000
• The smallest denomination a.k.a base unit is
called Wei. ether 1e18 wei
1,000,000,000,000,
000,000
Ethereum Concepts - GAS

• Every contract and transaction have a fixed start price used to pay the miner as mining rewards
in return for the computational power spend by him.

• Ethereum users also have to pay transaction fee to the Ethereum network for performing any
transaction over the Ethereum Blockchain
Ethereum Concepts – Gas Price

• It represents the actual cost to be spent as Gas cost in terms of a currency like Ether.

• Usually the gas price will be floating value to stabilize the value of gas, which means that with
the changes in currency values, the gas price also changes to adapt to the value change.
Ethereum concepts – Block Gas Limit

• It specifies the maximum amount of gas that can be used per block..

• It is depicted as the
– maximum computational load,
– volume of transaction,
– or the block size,
– and the miners can gradually change the gas limit over a period of time.
Ethereum concepts – Gas Fee

• It is the amount of Gas needed to be paid to execute a particular transaction or contract.

• The miners will get paid with the gas fee based on the computational expenses incurred to
build a block.
Ethereum Transaction

• Every transaction in an Ethereum Blockchain consists of 6 fields :

– The recipient of the transaction (either user or smart contract).


– Signature of the sender for identifying and validating the message being sent.
– VALUE field that specifies the amount of wei to be transferred from the sender to the
receiver.
– DATA field (Optional) that holds the message being sent to a contract.
– TRANSACTION GAS LIMIT value – maximum number of gas sender willing to spend on a
particular transaction.
– GAS PRICE value - specifies the amount that the sender is willing to pay for gas.

One unit of gas corresponds to the execution of one atomic instruction, i.e., a computational step
Development for the Ethereum World Computer

• It involves different “layers”

• Frontend with HTML/CSS/JavaScript

• Backend with the Ethereum blockchain

• Different languages (JavaScript for


frontend dev, Solidity for backend dev)
THANK YOU

You might also like