SlideShare a Scribd company logo
Exploring Ethereum
A (mostly) technical exploration of the Ethereum blockchain
Setting Some Context
So what is a blockchain anyway?
A bit of history…
In 2008 “someone” called Satoshi Nakamoto published a paper entitled - Bitcoin: A
peer to peer electronic cash system
In it was proposed a way to create decentralised global ledger amongst peers which
could record transactions of a digital currency - Bitcoin
The technology underlying the global ledger is commonly referred to as “Blockchain”
Eventually, Blockchain (the technology) evolved to refer to decentralised networks
that involve multiple entities using consensus algorithms to maintain a distributed
data store
What is a blockchain?
A blockchain is a data structure that makes it possible to
maintain a secure, immutable, decentralised, transaction
system.
A blockchain meets the above definition because it is -
Tamper evident
Decentralised
Un-censorable
Self healing
(Typical) Components of a public
Blockchain
A peer-to-peer (P2P) network connecting nodes and propagating transactions based on a standardised "gossip" protocol.
Messages, in the form of transactions, representing state transitions.
A set of consensus rules, governing what is a transaction and what makes it valid.
A state machine that processes transactions according to the consensus rules.
A chain of cryptographically secured blocks that acts as a journal of all the verified and accepted state transitions.
A consensus algorithm that decentralises control over the blockchain, by forcing participants to cooperate in the
enforcement of the consensus rules.
A game-theoretically sound incentive to economically secure the state machine in an open environment.
One or more open source software implementations of the above. All or most of these components are usually combined
in a single software client.
Crypto-currencies : the canonical
use case…
Bitcoin is the most popular and biggest crypto-
currency that uses blockchains as a ledger.
Crypto-currencies are a compelling use case for
blockchains as they provide a way to
decentralise money.
There are other use cases of blockchain like
Ethereum which aims to be a “world computer”.
An overview of Ethereum
How did Ethereum come about?
Ethereum was conceived at a time when people recognised the power of the
Bitcoin model, and were trying to move beyond cryptocurrency
applications.
Toward the end of 2013, Vitalik Buterin, a young programmer and Bitcoin
enthusiast, started thinking about further extending the capabilities of
Bitcoin and Mastercoin . Vitalik started sharing a whitepaper that
outlined the idea behind Ethereum: a Turing-complete, general-purpose
blockchain.
Dr. Gavin Wood, was one of the first people to reach out to Vitalik and offer
to help. Gavin became Ethereum’s cofounder, co-designer, and CTO.
Ethereum’s founders were thinking about a blockchain, that could support a
broad variety of applications by being programmed. The idea was that using
Ethereum, a developer could program their application without having to
implement peer-to-peer networks, blockchains, consensus algorithms, etc.
On July 30, 2015, the first Ethereum block was mined.
What is Ethereum?
Ethereum is often described as "the world computer.” But what does that mean?
From a technical perspective, Ethereum is a deterministic but practically unbounded state machine,
consisting of a globally accessible singleton state and a virtual machine that applies changes to that
state.
A more practical view would be - Ethereum is an open source, globally decentralised computing
infrastructure that executes programs called smart contracts. A blockchain is used to synchronise
and store the system’s state changes, along with a cryptocurrency called ether to meter and
constrain execution resource costs.
The Ethereum platform enables developers to build powerful decentralised applications with built-in
economic functions.
Ethereum Roadmap
Ethereum’s development was planned
over four distinct stages, with major
changes occurring at each stage.
The four main development stages are
codenamed Frontier, Homestead,
Metropolis, and Serenity.
A stage may include subreleases, known
as "hard forks," that change
functionality in a way that is not
backward compatible.
Components of Ethereum
P2P network - Ethereum runs on the Ethereum main network, which is addressable on TCP port 30303, and runs a protocol called
ÐΞVp2p.
Transactions - Ethereum transactions are network messages that include (among other things) a sender, recipient, value, and data
payload.
State machine - Ethereum state transitions are processed by the Ethereum Virtual Machine (EVM), a stack-based virtual machine that
executes bytecode (machine-language instructions). EVM programs, called "smart contracts," are written in high-level languages (e.g.,
Solidity) and compiled to bytecode for execution on the EVM.
Data structures - Ethereum’s state is stored locally on each node as a LevelDB database which contains the transactions and system
state in a serialized hashed data structure called a Merkle Patricia Tree.
Consensus algorithm - Ethereum uses Bitcoin’s consensus model, Nakamoto Consensus, which uses sequential single-signature blocks,
weighted in importance by PoW to determine the longest chain. However, there are plans to move to a PoS weighted voting system,
codenamed Casper.
Mining - Ethereum currently uses a PoW algorithm called Ethash, but this will eventually be dropped with the move to PoS at some
point in the future.
Clients - Ethereum has several interoperable implementations of the client software, the most prominent of which are Go-Ethereum
(Geth) and Parity.
Ethereum’s Turing Problem
Ethereum, they say, unlike Bitcoin, is Turing complete. What exactly does that mean?
In 1936 Alan Turing created a mathematical model of a computer consisting of a state machine that manipulates symbols by reading and writing them on
sequential memory (resembling an infinite-length paper tape).
He further defined a system to be Turing complete if it can be used to simulate any Turing machine.
Turing proved that you cannot predict whether a program will terminate by simulating it on a computer. In simple terms, we cannot predict the path of a
program without running it.
Ethereum’s ability to execute a stored program, in a state machine called the Ethereum Virtual Machine, while reading and writing data to memory makes it
a Turing-complete system.
To answer the halting problem, Ethereum introduces a metering mechanism called gas. As the EVM executes a smart contract, it carefully accounts for
every instruction (computation, data access, etc.). Each instruction has a predetermined cost in units of gas. For example -
Adding two numbers costs 3 gas
Calculating a Keccak-256 hash costs 30 gas + 6 gas for each 256 bits of data being hashed
Sending a transaction costs 21,000 gas
When a transaction triggers the execution of a smart contract, it must include an amount of gas that sets the upper limit of what can be consumed running
the smart contract. The EVM will terminate execution if the amount of gas consumed by computation exceeds the gas available in the transaction.
Ethereum Wallet
At a high level, a wallet is a software application that serves as the primary user interface to
Ethereum. It controls access to a user’s money, managing keys and addresses, tracking the balance,
and creating and signing transactions.
MetaMask is a browser extension wallet that runs in your browser (Chrome, Firefox, Opera, or Brave
Browser). It is easy to use and convenient for testing, as it is able to connect to a variety of Ethereum
nodes and test blockchains. MetaMask is a web-based wallet.
Jaxx is a multiplatform and multicurrency wallet that runs on a variety of operating systems,
including Android, iOS, Windows, macOS, and Linux. It is often a good choice for new users as it is
designed for simplicity and ease of use.
MyEtherWallet is a web-based wallet that runs in any browser.
Emerald Wallet is designed to work with the Ethereum Classic blockchain, but is compatible with
other Ethereum-based blockchains. Emerald Wallet can run a full node or connect to a public remote
node, working in a "light" mode.
A quick note about Ether
Ethereum’s currency unit is called ether, identified also as "ETH" or with the
symbols Ξ (from the Greek letter "Xi" that looks like a stylized capital E) or, less
often, ♦: for example, 1 ether, or 1 ETH, or Ξ1, or ♦1.
Ether is subdivided into smaller units, down to the smallest unit possible, which
is named wei. One ether is 1 quintillion wei (1 * 1018 or
1,000,000,000,000,000,000).
Ethereum Specification
Ethereum is defined in english and mathematical (formal) specification called the "Yellow Paper”.
As a result of Ethereum’s clear formal specification, there are a number of independently developed, yet interoperable, software
implementations of an Ethereum client.
Currently, there are six main implementations of the Ethereum protocol, written in six different languages:
Parity, written in Rust
Geth, written in Go
cpp-ethereum, written in C++
pyethereum, written in Python
Mantis, written in Scala
Harmony, written in Java
There exist a variety of Ethereum-based networks that largely conform to the formal specification defined in the Ethereum Yellow
Paper, but which may or may not interoperate with each other.
The Ethereum Virtual Machine
A stack-based virtual machine with an ephemeral memory byte-array and persistent key-value storage (persisted
in a Merkle tree).
Elements on the stack are 32-byte words, and all keys and values in storage are 32 bytes.
There are over 100 opcodes, divided into categories in multiples of 16. The specification for each opcode can be
found in the yellow paper.The list of opcodes specifies how much gas each one consumes
To force all executions to terminate, each operation is tagged with an explicit cost, denominated in gas. Executions
must specify a maximum amount of gas, such that using more than that amount throws an OutOfGas exception.

# schema: [opcode, ins, outs, gas]
opcodes = {
# arithmetic
0x00: ['STOP', 0, 0, 0],
0x01: ['ADD', 2, 1, 3],
...
0xf4: ['DELEGATECALL', 6, 0, 40],
0xff: ['SUICIDE', 1, 0, 0],
}
Image courtesy “Mastering Ethereum”
https://github.com/ethereumbook/ethereumbook/blob/develop/images/evm-architecture.png
Ethereum Consensus
In computer science, the term "consensus" predates blockchains and is related to the broader problem of synchronizing state in
distributed systems, such that different participants in a distributed system all (eventually) agree on a single system-wide state.
The creator of the original blockchain, Bitcoin, invented a consensus algorithm called proof of work (PoW). The colloquial term for
PoW is "mining," which creates a misunderstanding about the primary purpose of consensus.
Ethash is the Ethereum PoW algorithm. It uses an evolution of the Dagger–Hashimoto algorithm and the general steps is as follows
There exists a seed which can be computed for each block by scanning through the block headers up until that point.
From the seed, one can compute a 16 MB pseudorandom cache. Light clients store the cache.
From the cache, we can generate a 1 GB dataset, with the property that each item in the dataset depends on only a small
number of items from the cache. Full clients and miners store the dataset.
Mining involves grabbing random slices of the dataset and hashing them together. Verification can be done with low memory
by using the cache to regenerate the specific pieces of the dataset that you need, so you only need to store the cache.
The large dataset is updated once every 30000 blocks, so the vast majority of a miner's effort will be reading the dataset,
not making changes to it.
The Ethereum network is designed to produce a block every 12 seconds. This is substantially faster
than the 10 minute interval imposed by Bitcoin.
The GHOST protocol (Greedy Heaviest Observed Subtree) was introduced in 2013 as a way of
combating the way that fast block time blockchains suffer from a high number of stale blocks.
A block must specify its parents and its number of Uncles.
An Uncle included in a block must be a direct child of the new block and less than seven blocks
below it in terms of height
It cannot be the direct ancestor of the block being formed.
An Uncle must have a valid block header.
An Uncle must be different from all other Uncles in previous blocks and the block being formed.
For every Uncle included in the block the miner gets an additional 3.125% and the miner of of
the Uncle receives 93.75% of a standard block reward.
Image Courtesy - https://ethereum.stackexchange.com/questions/268/ethereum-block-architecture/6413#6413
Programming on Ethereum -
Smart Contracts
The term smart contract has been used over the years to describe a wide
variety of different things. In the 1990s, cryptographer Nick Szabo coined the
term and defined it as “a set of promises, specified in digital form, including
protocols within which the parties perform on the other promises.”
In the context of Ethereum, the term is actually a bit of a misnomer, given that
Ethereum smart contracts are neither smart nor legal contracts.
Smart contracts are typically written in a high-level language, such as Solidity.
But in order to run, they must be compiled to the low-level bytecode that runs in
the EVM.
Once compiled, they are deployed on the Ethereum platform using a special contract
creation transaction, which is identified as such by being sent to the special contract
creation address, namely 0x0
Each contract is identified by an Ethereum address, which is derived from the contract
creation transaction as a function of the originating account and nonce. Contracts do not
have private keys.
All smart contracts in Ethereum are executed, ultimately, because of a transaction
initiated from an externally owned account. A contract can call other contracts but the
first contract in such a chain of execution will always have been called by a transaction
from an EOA.
Transactions are atomic. Transactions execute in their entirety, with any changes recorded
only if all execution terminates successfully.A failed transaction is still recorded as having
been attempted, and the ether spent on gas for the execution is deducted from the
originating account, but it otherwise has no other effects on contract or account state.
The Ethereum JSON-RPC Interface
Ethereum clients offer an application programming interface using JSON-RPC.
JSON-RPC is a stateless, light-weight remote procedure call (RPC) protocol. Primarily this
specification defines several data structures and the rules around their processing.
Usually, the RPC interface is offered as an HTTP service on port 8545. For security reasons it
is restricted, by default, to only accept connections from localhost (the IP address of your own
computer, which is 127.0.0.1).
To talk to an ethereum node from inside a JavaScript application use the web3.js library, which
gives a convenient interface for the RPC methods.
Writing simple contracts with
Remix and Ropsten
Remix is an online Solidity IDE - https://remix.ethereum.org
It can be used in conjunction with Metamask - https://metamask.io/ to deploy
simple contracts to various Ethereum networks.
We shall be setting up Metamask and connecting to the Ropsten Test net. We
shall then get some “test” Ether and do some transactions.
Finally, we will use Remix to develop, compile and deploy a simple contract to
Ropsten
The Truffle Development Toolchain
The Truffle Suite consists of the following tools -
Truffle - Development environment, testing
framework and asset pipeline with an interactive
console for compiling, deploying and testing smart
contracts
Ganache is a personal blockchain for Ethereum
development you can use to deploy your contracts and
run tests (CLI version was formerly called Test-RPC)
Drizzle is a collection of front end libraries that make
writing dapp front ends easier and more predictable.
https://www.truffleframework.com/docs
You can install it from Node : npm install -g truffle
“And.. That’s All
Folks !”
Acknowledgements
Mastering Ethereum, by Andreas M. Antonopoulos, Gavin Wood 
- https://ethereumbook.info/
Ethereum Wiki - https://github.com/ethereum/wiki/wiki
Truffle Framework - https://www.truffleframework.com/docs
Solidity Documentation - https://solidity.readthedocs.io/en/
develop/index.html
I am Nikhil -
Email : nikhilkrishna@gmail.com
Twitter: https://twitter.com/technikhil
Core Member BIG - https://t.me/bigorg

More Related Content

PPTX
Introduction to Ethereum
PPTX
Smart Contract & Ethereum
PPTX
Learning Solidity
PPTX
Ethereum Intro
PPTX
Introduction to Corda Blockchain for Developers
 
PPTX
Hyperledger Fabric
PPTX
solidity programming.pptx
PDF
All About Ethereum
Introduction to Ethereum
Smart Contract & Ethereum
Learning Solidity
Ethereum Intro
Introduction to Corda Blockchain for Developers
 
Hyperledger Fabric
solidity programming.pptx
All About Ethereum

What's hot (20)

PPTX
Ethereum Tutorial - Ethereum Explained | What is Ethereum? | Ethereum Explain...
PDF
Ethereum in a nutshell
PPTX
Ethereum
PPTX
Overview of Blockchain Consensus Mechanisms
PPTX
Write smart contract with solidity on Ethereum
PDF
Ethereum-Cryptocurrency (All about Ethereum)
PDF
Smart contracts using web3.js
PPTX
Ethereum
 
PPTX
Solidity
PPTX
Bitcoin, Ethereum, Smart Contract & Blockchain
PPTX
Blockchain - HyperLedger Fabric
PDF
Blockchain Technology | Blockchain Technology Explained | Edureka
PPTX
Intro to smart contract on blockchain en
PPTX
Crypto currency
PDF
The Ethereum Experience
PDF
Ethereum Solidity Fundamentals
PDF
Programming smart contracts in solidity
PDF
Ethereum A to Z
PDF
How does blockchain work
PPTX
BLOCKCHAIN
Ethereum Tutorial - Ethereum Explained | What is Ethereum? | Ethereum Explain...
Ethereum in a nutshell
Ethereum
Overview of Blockchain Consensus Mechanisms
Write smart contract with solidity on Ethereum
Ethereum-Cryptocurrency (All about Ethereum)
Smart contracts using web3.js
Ethereum
 
Solidity
Bitcoin, Ethereum, Smart Contract & Blockchain
Blockchain - HyperLedger Fabric
Blockchain Technology | Blockchain Technology Explained | Edureka
Intro to smart contract on blockchain en
Crypto currency
The Ethereum Experience
Ethereum Solidity Fundamentals
Programming smart contracts in solidity
Ethereum A to Z
How does blockchain work
BLOCKCHAIN
Ad

Similar to Exploring ethereum (20)

PPTX
Ethereum
PPTX
What is ethereum
PDF
Evaluation of Ethereum
PDF
What Is Ethereum? An Explanation for Beginners
PPTX
What is Ethereum? – A Complete Guide to Ethereum for Beginners
PPTX
Introduction to Ethereum,accounts, smart contract.pptx
PPTX
Ethereum Block Chain
PPTX
Ethereum
PDF
The JavaScript toolset for development on Ethereum
PDF
Javascript toolset for Ethereum Smart Contract development
PPTX
Block chain - Smart contacts.pptx
PDF
BlockChain Public
PPTX
Ethereum Block Chain
PDF
Ethereum ETH| Crypto Markets | Crypto Currency
PPTX
What is ethereum? which is the best place to buy ethereum Canada?
PDF
Unlocking the Potential of Ethereum for Your Home-Based Business.pdf
PDF
Blockchain Chapter #4.pdf
DOCX
Blockchain & decentralized finance (defi) | How blockchain technology is coup...
PDF
What Is Ethereum_.pdf
PPTX
Ethereum Smart contract
Ethereum
What is ethereum
Evaluation of Ethereum
What Is Ethereum? An Explanation for Beginners
What is Ethereum? – A Complete Guide to Ethereum for Beginners
Introduction to Ethereum,accounts, smart contract.pptx
Ethereum Block Chain
Ethereum
The JavaScript toolset for development on Ethereum
Javascript toolset for Ethereum Smart Contract development
Block chain - Smart contacts.pptx
BlockChain Public
Ethereum Block Chain
Ethereum ETH| Crypto Markets | Crypto Currency
What is ethereum? which is the best place to buy ethereum Canada?
Unlocking the Potential of Ethereum for Your Home-Based Business.pdf
Blockchain Chapter #4.pdf
Blockchain & decentralized finance (defi) | How blockchain technology is coup...
What Is Ethereum_.pdf
Ethereum Smart contract
Ad

Recently uploaded (20)

PDF
System and Network Administraation Chapter 3
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPTX
Introduction to Artificial Intelligence
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
history of c programming in notes for students .pptx
PPTX
ManageIQ - Sprint 268 Review - Slide Deck
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
top salesforce developer skills in 2025.pdf
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
ai tools demonstartion for schools and inter college
PPTX
Online Work Permit System for Fast Permit Processing
System and Network Administraation Chapter 3
Odoo POS Development Services by CandidRoot Solutions
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Introduction to Artificial Intelligence
Upgrade and Innovation Strategies for SAP ERP Customers
2025 Textile ERP Trends: SAP, Odoo & Oracle
Softaken Excel to vCard Converter Software.pdf
Adobe Illustrator 28.6 Crack My Vision of Vector Design
CHAPTER 2 - PM Management and IT Context
history of c programming in notes for students .pptx
ManageIQ - Sprint 268 Review - Slide Deck
Wondershare Filmora 15 Crack With Activation Key [2025
top salesforce developer skills in 2025.pdf
Navsoft: AI-Powered Business Solutions & Custom Software Development
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PTS Company Brochure 2025 (1).pdf.......
ai tools demonstartion for schools and inter college
Online Work Permit System for Fast Permit Processing

Exploring ethereum

  • 1. Exploring Ethereum A (mostly) technical exploration of the Ethereum blockchain
  • 2. Setting Some Context So what is a blockchain anyway?
  • 3. A bit of history… In 2008 “someone” called Satoshi Nakamoto published a paper entitled - Bitcoin: A peer to peer electronic cash system In it was proposed a way to create decentralised global ledger amongst peers which could record transactions of a digital currency - Bitcoin The technology underlying the global ledger is commonly referred to as “Blockchain” Eventually, Blockchain (the technology) evolved to refer to decentralised networks that involve multiple entities using consensus algorithms to maintain a distributed data store
  • 4. What is a blockchain? A blockchain is a data structure that makes it possible to maintain a secure, immutable, decentralised, transaction system. A blockchain meets the above definition because it is - Tamper evident Decentralised Un-censorable Self healing
  • 5. (Typical) Components of a public Blockchain A peer-to-peer (P2P) network connecting nodes and propagating transactions based on a standardised "gossip" protocol. Messages, in the form of transactions, representing state transitions. A set of consensus rules, governing what is a transaction and what makes it valid. A state machine that processes transactions according to the consensus rules. A chain of cryptographically secured blocks that acts as a journal of all the verified and accepted state transitions. A consensus algorithm that decentralises control over the blockchain, by forcing participants to cooperate in the enforcement of the consensus rules. A game-theoretically sound incentive to economically secure the state machine in an open environment. One or more open source software implementations of the above. All or most of these components are usually combined in a single software client.
  • 6. Crypto-currencies : the canonical use case… Bitcoin is the most popular and biggest crypto- currency that uses blockchains as a ledger. Crypto-currencies are a compelling use case for blockchains as they provide a way to decentralise money. There are other use cases of blockchain like Ethereum which aims to be a “world computer”.
  • 7. An overview of Ethereum
  • 8. How did Ethereum come about? Ethereum was conceived at a time when people recognised the power of the Bitcoin model, and were trying to move beyond cryptocurrency applications. Toward the end of 2013, Vitalik Buterin, a young programmer and Bitcoin enthusiast, started thinking about further extending the capabilities of Bitcoin and Mastercoin . Vitalik started sharing a whitepaper that outlined the idea behind Ethereum: a Turing-complete, general-purpose blockchain. Dr. Gavin Wood, was one of the first people to reach out to Vitalik and offer to help. Gavin became Ethereum’s cofounder, co-designer, and CTO. Ethereum’s founders were thinking about a blockchain, that could support a broad variety of applications by being programmed. The idea was that using Ethereum, a developer could program their application without having to implement peer-to-peer networks, blockchains, consensus algorithms, etc. On July 30, 2015, the first Ethereum block was mined.
  • 9. What is Ethereum? Ethereum is often described as "the world computer.” But what does that mean? From a technical perspective, Ethereum is a deterministic but practically unbounded state machine, consisting of a globally accessible singleton state and a virtual machine that applies changes to that state. A more practical view would be - Ethereum is an open source, globally decentralised computing infrastructure that executes programs called smart contracts. A blockchain is used to synchronise and store the system’s state changes, along with a cryptocurrency called ether to meter and constrain execution resource costs. The Ethereum platform enables developers to build powerful decentralised applications with built-in economic functions.
  • 10. Ethereum Roadmap Ethereum’s development was planned over four distinct stages, with major changes occurring at each stage. The four main development stages are codenamed Frontier, Homestead, Metropolis, and Serenity. A stage may include subreleases, known as "hard forks," that change functionality in a way that is not backward compatible.
  • 11. Components of Ethereum P2P network - Ethereum runs on the Ethereum main network, which is addressable on TCP port 30303, and runs a protocol called ÐΞVp2p. Transactions - Ethereum transactions are network messages that include (among other things) a sender, recipient, value, and data payload. State machine - Ethereum state transitions are processed by the Ethereum Virtual Machine (EVM), a stack-based virtual machine that executes bytecode (machine-language instructions). EVM programs, called "smart contracts," are written in high-level languages (e.g., Solidity) and compiled to bytecode for execution on the EVM. Data structures - Ethereum’s state is stored locally on each node as a LevelDB database which contains the transactions and system state in a serialized hashed data structure called a Merkle Patricia Tree. Consensus algorithm - Ethereum uses Bitcoin’s consensus model, Nakamoto Consensus, which uses sequential single-signature blocks, weighted in importance by PoW to determine the longest chain. However, there are plans to move to a PoS weighted voting system, codenamed Casper. Mining - Ethereum currently uses a PoW algorithm called Ethash, but this will eventually be dropped with the move to PoS at some point in the future. Clients - Ethereum has several interoperable implementations of the client software, the most prominent of which are Go-Ethereum (Geth) and Parity.
  • 12. Ethereum’s Turing Problem Ethereum, they say, unlike Bitcoin, is Turing complete. What exactly does that mean? In 1936 Alan Turing created a mathematical model of a computer consisting of a state machine that manipulates symbols by reading and writing them on sequential memory (resembling an infinite-length paper tape). He further defined a system to be Turing complete if it can be used to simulate any Turing machine. Turing proved that you cannot predict whether a program will terminate by simulating it on a computer. In simple terms, we cannot predict the path of a program without running it. Ethereum’s ability to execute a stored program, in a state machine called the Ethereum Virtual Machine, while reading and writing data to memory makes it a Turing-complete system. To answer the halting problem, Ethereum introduces a metering mechanism called gas. As the EVM executes a smart contract, it carefully accounts for every instruction (computation, data access, etc.). Each instruction has a predetermined cost in units of gas. For example - Adding two numbers costs 3 gas Calculating a Keccak-256 hash costs 30 gas + 6 gas for each 256 bits of data being hashed Sending a transaction costs 21,000 gas When a transaction triggers the execution of a smart contract, it must include an amount of gas that sets the upper limit of what can be consumed running the smart contract. The EVM will terminate execution if the amount of gas consumed by computation exceeds the gas available in the transaction.
  • 13. Ethereum Wallet At a high level, a wallet is a software application that serves as the primary user interface to Ethereum. It controls access to a user’s money, managing keys and addresses, tracking the balance, and creating and signing transactions. MetaMask is a browser extension wallet that runs in your browser (Chrome, Firefox, Opera, or Brave Browser). It is easy to use and convenient for testing, as it is able to connect to a variety of Ethereum nodes and test blockchains. MetaMask is a web-based wallet. Jaxx is a multiplatform and multicurrency wallet that runs on a variety of operating systems, including Android, iOS, Windows, macOS, and Linux. It is often a good choice for new users as it is designed for simplicity and ease of use. MyEtherWallet is a web-based wallet that runs in any browser. Emerald Wallet is designed to work with the Ethereum Classic blockchain, but is compatible with other Ethereum-based blockchains. Emerald Wallet can run a full node or connect to a public remote node, working in a "light" mode.
  • 14. A quick note about Ether Ethereum’s currency unit is called ether, identified also as "ETH" or with the symbols Ξ (from the Greek letter "Xi" that looks like a stylized capital E) or, less often, ♦: for example, 1 ether, or 1 ETH, or Ξ1, or ♦1. Ether is subdivided into smaller units, down to the smallest unit possible, which is named wei. One ether is 1 quintillion wei (1 * 1018 or 1,000,000,000,000,000,000).
  • 15. Ethereum Specification Ethereum is defined in english and mathematical (formal) specification called the "Yellow Paper”. As a result of Ethereum’s clear formal specification, there are a number of independently developed, yet interoperable, software implementations of an Ethereum client. Currently, there are six main implementations of the Ethereum protocol, written in six different languages: Parity, written in Rust Geth, written in Go cpp-ethereum, written in C++ pyethereum, written in Python Mantis, written in Scala Harmony, written in Java There exist a variety of Ethereum-based networks that largely conform to the formal specification defined in the Ethereum Yellow Paper, but which may or may not interoperate with each other.
  • 16. The Ethereum Virtual Machine A stack-based virtual machine with an ephemeral memory byte-array and persistent key-value storage (persisted in a Merkle tree). Elements on the stack are 32-byte words, and all keys and values in storage are 32 bytes. There are over 100 opcodes, divided into categories in multiples of 16. The specification for each opcode can be found in the yellow paper.The list of opcodes specifies how much gas each one consumes To force all executions to terminate, each operation is tagged with an explicit cost, denominated in gas. Executions must specify a maximum amount of gas, such that using more than that amount throws an OutOfGas exception.
 # schema: [opcode, ins, outs, gas] opcodes = { # arithmetic 0x00: ['STOP', 0, 0, 0], 0x01: ['ADD', 2, 1, 3], ... 0xf4: ['DELEGATECALL', 6, 0, 40], 0xff: ['SUICIDE', 1, 0, 0], }
  • 17. Image courtesy “Mastering Ethereum” https://github.com/ethereumbook/ethereumbook/blob/develop/images/evm-architecture.png
  • 18. Ethereum Consensus In computer science, the term "consensus" predates blockchains and is related to the broader problem of synchronizing state in distributed systems, such that different participants in a distributed system all (eventually) agree on a single system-wide state. The creator of the original blockchain, Bitcoin, invented a consensus algorithm called proof of work (PoW). The colloquial term for PoW is "mining," which creates a misunderstanding about the primary purpose of consensus. Ethash is the Ethereum PoW algorithm. It uses an evolution of the Dagger–Hashimoto algorithm and the general steps is as follows There exists a seed which can be computed for each block by scanning through the block headers up until that point. From the seed, one can compute a 16 MB pseudorandom cache. Light clients store the cache. From the cache, we can generate a 1 GB dataset, with the property that each item in the dataset depends on only a small number of items from the cache. Full clients and miners store the dataset. Mining involves grabbing random slices of the dataset and hashing them together. Verification can be done with low memory by using the cache to regenerate the specific pieces of the dataset that you need, so you only need to store the cache. The large dataset is updated once every 30000 blocks, so the vast majority of a miner's effort will be reading the dataset, not making changes to it.
  • 19. The Ethereum network is designed to produce a block every 12 seconds. This is substantially faster than the 10 minute interval imposed by Bitcoin. The GHOST protocol (Greedy Heaviest Observed Subtree) was introduced in 2013 as a way of combating the way that fast block time blockchains suffer from a high number of stale blocks. A block must specify its parents and its number of Uncles. An Uncle included in a block must be a direct child of the new block and less than seven blocks below it in terms of height It cannot be the direct ancestor of the block being formed. An Uncle must have a valid block header. An Uncle must be different from all other Uncles in previous blocks and the block being formed. For every Uncle included in the block the miner gets an additional 3.125% and the miner of of the Uncle receives 93.75% of a standard block reward.
  • 20. Image Courtesy - https://ethereum.stackexchange.com/questions/268/ethereum-block-architecture/6413#6413
  • 21. Programming on Ethereum - Smart Contracts The term smart contract has been used over the years to describe a wide variety of different things. In the 1990s, cryptographer Nick Szabo coined the term and defined it as “a set of promises, specified in digital form, including protocols within which the parties perform on the other promises.” In the context of Ethereum, the term is actually a bit of a misnomer, given that Ethereum smart contracts are neither smart nor legal contracts. Smart contracts are typically written in a high-level language, such as Solidity. But in order to run, they must be compiled to the low-level bytecode that runs in the EVM.
  • 22. Once compiled, they are deployed on the Ethereum platform using a special contract creation transaction, which is identified as such by being sent to the special contract creation address, namely 0x0 Each contract is identified by an Ethereum address, which is derived from the contract creation transaction as a function of the originating account and nonce. Contracts do not have private keys. All smart contracts in Ethereum are executed, ultimately, because of a transaction initiated from an externally owned account. A contract can call other contracts but the first contract in such a chain of execution will always have been called by a transaction from an EOA. Transactions are atomic. Transactions execute in their entirety, with any changes recorded only if all execution terminates successfully.A failed transaction is still recorded as having been attempted, and the ether spent on gas for the execution is deducted from the originating account, but it otherwise has no other effects on contract or account state.
  • 23. The Ethereum JSON-RPC Interface Ethereum clients offer an application programming interface using JSON-RPC. JSON-RPC is a stateless, light-weight remote procedure call (RPC) protocol. Primarily this specification defines several data structures and the rules around their processing. Usually, the RPC interface is offered as an HTTP service on port 8545. For security reasons it is restricted, by default, to only accept connections from localhost (the IP address of your own computer, which is 127.0.0.1). To talk to an ethereum node from inside a JavaScript application use the web3.js library, which gives a convenient interface for the RPC methods.
  • 24. Writing simple contracts with Remix and Ropsten Remix is an online Solidity IDE - https://remix.ethereum.org It can be used in conjunction with Metamask - https://metamask.io/ to deploy simple contracts to various Ethereum networks. We shall be setting up Metamask and connecting to the Ropsten Test net. We shall then get some “test” Ether and do some transactions. Finally, we will use Remix to develop, compile and deploy a simple contract to Ropsten
  • 25. The Truffle Development Toolchain The Truffle Suite consists of the following tools - Truffle - Development environment, testing framework and asset pipeline with an interactive console for compiling, deploying and testing smart contracts Ganache is a personal blockchain for Ethereum development you can use to deploy your contracts and run tests (CLI version was formerly called Test-RPC) Drizzle is a collection of front end libraries that make writing dapp front ends easier and more predictable. https://www.truffleframework.com/docs You can install it from Node : npm install -g truffle
  • 26. “And.. That’s All Folks !” Acknowledgements Mastering Ethereum, by Andreas M. Antonopoulos, Gavin Wood  - https://ethereumbook.info/ Ethereum Wiki - https://github.com/ethereum/wiki/wiki Truffle Framework - https://www.truffleframework.com/docs Solidity Documentation - https://solidity.readthedocs.io/en/ develop/index.html I am Nikhil - Email : nikhilkrishna@gmail.com Twitter: https://twitter.com/technikhil Core Member BIG - https://t.me/bigorg