introduction to · ethereum is an open blockchain platform that lets anyone build and use...
TRANSCRIPT
![Page 1: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/1.jpg)
![Page 2: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/2.jpg)
INTRODUCTION TO ETHEREUM ECOSYSTEM
& SMART CONTRACTS
NPD Meet @ Divum Corporate Services Pvt Ltd.
Jitendra Kumar.Balla & Vaideeswaran sethuraman
![Page 3: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/3.jpg)
AGENDA
1. What is a Blockchain?
2. Ethereum 3. Ethereum SMART Contracts
![Page 4: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/4.jpg)
CENTRALIZED
Issues:
Single point failure
Scaling
Inefficiency
All activities are managed by one person/Organization
![Page 5: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/5.jpg)
DECENTRALIZEDSolves:
Single point failure
Scaling
Inefficiency
Security and Transparency
Transaction time
![Page 6: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/6.jpg)
INTRODUCTION TO BLOCKCHAIN
![Page 7: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/7.jpg)
BLOCKCHAINA blockchain allows for trustless transactions between multiple parties. Or, more importantly, it allows transactions without trust of a third party intermediary!
Decentralized system for an exchange a value/asserts
○ Distributed ledger
○ Immutability
○ Consensus
○ Security
![Page 8: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/8.jpg)
LET’S START WITH A TRANSACTION THAT OCCURS BETWEEN ACCOUNTS
Transaction #200
Account A Account BE.g. Send 2 tokens
An example transaction could be:
Account A will send 1 tokens to Account B
![Page 9: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/9.jpg)
A LEDGER IS A LIST OF TRANSACTIONS (GROUPED INTO BLOCKS)
LEDGERBlock #100 Last Block: #99 (H) Timestamp: TM,
Transaction #399
Transaction #400
Transaction #401
Block #97Block #98
Block #99
Blocks contain an
indeterminate number of
transactions
![Page 10: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/10.jpg)
BLOCKS ARE CHAINED TOGETHER
LEDGERBlock #100 Last Block: #99
Transaction #399
Transaction #400
Block #97 Block #98 Block #99
Blocks are generated on a
time interval(e.g. every 5
minutes)
The ledger is a chain of blocks! Each block is created with a pointer to the previous block creating a blockchain!
![Page 11: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/11.jpg)
LEDGER
Distributed ledger = Distributed database
![Page 12: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/12.jpg)
BLOCKCHAIN
Decentralized system for an exchange a value/asserts
○ Distributed ledger
○ Immutability
○ Consensus
○ Security
![Page 13: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/13.jpg)
BLOCKCHAIN
Decentralized system for an exchange a value/asserts
○ Distributed ledger
○ Immutability
○ Consensus
○ Security
![Page 14: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/14.jpg)
CONSENSUS
Consensus = Protocol by which peers agree on state of ledger
○ Ensure all peers in the network has exactly the same copy of ledger
○ Fraudulent transactions kept out of the ledger
○ Guarantees to record transactions in chronological order
![Page 15: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/15.jpg)
BLOCKCHAIN
Decentralized system for an exchange a value/asserts
○ Distributed ledger
○ Immutability
○ Consensus
○ Security
![Page 16: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/16.jpg)
SECURITY
![Page 17: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/17.jpg)
![Page 18: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/18.jpg)
Wow!!, thats cool stuff
Bitcoin:
- Transfer money- Fast transactions- Less fee- Transparent
![Page 19: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/19.jpg)
Wow!!, thats cool stuff
Bitcoin:
- Transfer money- Fast transactions- Less fee- Transparent
Great Technology:
- Launch my sub currency - ICO (Crowdfunding)- Managing digital assets- Local laws
![Page 20: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/20.jpg)
INTRODUCTION TO ETHEREUM
![Page 21: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/21.jpg)
ETHEREUM
Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology.
Ethereum is world of computers
![Page 22: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/22.jpg)
HOW DOES ETHEREUM WORK?
○ Ethereum’s basic unit is the account
○ State of every account
○ The Ethereum blockchain tracks the state of every account, and all state transitions on the Ethereum blockchain are transfers of value and information between accounts.
![Page 23: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/23.jpg)
ETHEREUM ACCOUNTS:
There are two types of accounts:
○ Externally Owned Accounts (EOAs)
○ Contract Accounts, which are controlled by their contract code and can only be “activated” by an EOA
![Page 24: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/24.jpg)
ETHEREUM ACCOUNTS: Elliptic Curve Digital Signature Algorithm (ECDSA)
![Page 25: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/25.jpg)
ETHEREUM ACCOUNTS:
○ Has an ether balance
○ Can send transactions (ether transfer or trigger contract code), EOA
○ Bytecode
○ Nonce
![Page 26: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/26.jpg)
SMART CONTRACTS
![Page 27: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/27.jpg)
ETHER, EVM, GAS
![Page 28: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/28.jpg)
ETHEREthereum value token is called Ether
Denominations:
Unit Wei Value Wei
wei 1 wei 1
Kwei (babbage) 1e3 wei 1,000
Mwei (lovelace) 1e6 wei 1,000,000
Gwei (shannon) 1e9 wei 1,000,000,000
microether (szabo) 1e12 wei 1,000,000,000,000
milliether (finney) 1e15 wei 1,000,000,000,000,000
ether 1e18 wei 1,000,000,000,000,000,000
![Page 29: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/29.jpg)
ETHER SUPPLY○ 48 days presale (July 2014): $ 60 M
○ 12M created to fund development
○ 5 Eth will created as rewarded for every block
○ 2-3 eths for non winning miners
○ Contract execution user pays Ether’s
![Page 30: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/30.jpg)
ETHEREUM VIRTUAL MACHINE
○ Ethereum is “Turing complete”.
○ EVM will load bytecode and execute instructions
○ Every node will run eth client
![Page 31: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/31.jpg)
GAS○ Gas is the metering unit for use of the World Computer
○ Each operation in the EVM consumes gas
○ totalEstGas = startgas * gasprice
Transactions0x60 0x01 0x60 0x02 0x01
![Page 32: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/32.jpg)
Operation Name Gas Cost Remark
step 1 default amount per execution cycle
stop 0 free
suicide 0 free
sha3 20
sload 20 get from permanent storage
sstore 100 put into permanent storage
balance 20
create 100 contract creation
call 20 initiating a read-only call
memory 1 every additional word when expanding memory
txdata 5 every byte of data or code for a transaction
transaction 500 base fee transaction
contract creation 53000 changed in homestead from 21000
![Page 33: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/33.jpg)
ETHEREUM TRANSACTIONS:
![Page 34: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/34.jpg)
BITCOIN● Transactions based● Block creation ~10mins● Less number of transactions● Require high computation power● Not stopping big miners● Limited transaction based bitcoin
signature(128)● Limited functions● Peers can block list transaction ● SHA2 not so secure● SHA256 is not ASIC resistance
● Account based● Block creation ~12sec● Mining algorithm based on
memory usage (Gas)● Can decouple components● Rich programing language for
contracts (Solidity)● Uses SHA3● Customize protocol based on local
law● EthHash is ASIC resistance
ETHEREUM
![Page 35: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/35.jpg)
INTRODUCTION TO ETHEREUM DAPPS
![Page 36: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/36.jpg)
○ Ethereum Client’s
○ Installation of Geth
○ Geth commands
○ Web3JS Apis
○ Solidity
○ Smart contracts
○ Deploying smart contracts
![Page 37: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/37.jpg)
ETHEREUM CLIENTS
eth pyethapp geth ethereumjs-lib
3rd Party Impl
ethereumj ruby-ethereum ethereumjs-lib parity
![Page 38: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/38.jpg)
SOLIDITY
![Page 39: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/39.jpg)
SOLIDITYSolidity is the most popular programming language used to write smart contracts to run on the Ethereum blockchain.
It is a high level language which when compiled gets converted to EVM bytecode.
This is very similar to the world of Java where there are JVM languages like Scala, Groovy, Clojure, JRuby etc.
![Page 40: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/40.jpg)
SOLIDITY INTEGRATION TOOLS
IDE’s- Remix- IntelliJ IDEA plugin- Visual Studio Extension- Etheratom- Solium- Emacs Solidity- Package for SublimeText — Solidity language syntax
![Page 41: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/41.jpg)
SOLIDITY INTEGRATION TOOLSSolidity Tools
- DappBuild tool, package manager, and deployment assistant
for Solidity.
- Solidity REPL
Instant command-line solidity console.
- solgraph
- Doxity
![Page 42: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/42.jpg)
STRUCTURE OF A CONTRACT- Types
- Operators
- Functions
- Function Modifiers
- Events
- Enum Types
![Page 43: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/43.jpg)
- Types
Booleans
Integers
Address
String
Enums
- Function Types
public, private, internal, external
- Function Modifiers
STRUCTURE OF A CONTRACT
![Page 44: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/44.jpg)
- Types
Booleans
Integers
Address
String
Enums
- Function Types
Public, private, internal
- Function Modifiers
STRUCTURE OF A CONTRACT
![Page 45: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/45.jpg)
TRUFFLE/EMBARK
We have frameworks for web application development such as Ruby on Rails, Python/Django etc, Truffle and Embark are the two most popular frameworks used to develop Dapps.
They abstract away lot of the complexities of compiling and deploying your contract on the blockchain.
![Page 46: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/46.jpg)
LET’S CODE….
![Page 47: INTRODUCTION TO · Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers](https://reader033.vdocuments.us/reader033/viewer/2022050607/5faec3fc5b97b7645e3f89e1/html5/thumbnails/47.jpg)