introduction to blockchain - lecture 3: from bitcoin to ...bitcoin blockchain: a revision a...

Post on 29-May-2020

3 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Introduction to BlockchainLecture 3: From Bitcoin to Ethereum

Ras Dwivedi

Indian Institute of Technology Kanpur

May 22, 2018

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 1 / 32

Outline

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 2 / 32

Bitcoin Blockchain: A Revision

A Decentralized Ledger

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 3 / 32

Transactions

Figure: CaptionRas Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 4 / 32

Block

NonceHash of last block

Transaction 1

Transaction 2

Transaction 3

Transaction ....

Text

Figure: Caption

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 5 / 32

Proof of work

Figure: Caption

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 6 / 32

Mining rewards

Figure: Caption

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 7 / 32

Longest chain

Figure: Blockchain

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 8 / 32

Bitcoin: Advantages

Secure:transparencyno counterpart riskdecentralizedPrivacylow transaction cost

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 9 / 32

Bitcoing is Awesome! But...

Block creation time is very high 10 mins/block

Block confirmation time is very high 60 mins/blockcan only do one function: Cryptocurrencyuses too much of energy: by 2020 electricity equivalent to entireDenmarkEnters...

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 10 / 32

Bitcoing is Awesome! But...

Block creation time is very high 10 mins/blockBlock confirmation time is very high 60 mins/block

can only do one function: Cryptocurrencyuses too much of energy: by 2020 electricity equivalent to entireDenmarkEnters...

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 10 / 32

Bitcoing is Awesome! But...

Block creation time is very high 10 mins/blockBlock confirmation time is very high 60 mins/blockcan only do one function: Cryptocurrency

uses too much of energy: by 2020 electricity equivalent to entireDenmarkEnters...

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 10 / 32

Bitcoing is Awesome! But...

Block creation time is very high 10 mins/blockBlock confirmation time is very high 60 mins/blockcan only do one function: Cryptocurrencyuses too much of energy: by 2020 electricity equivalent to entireDenmarkEnters...

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 10 / 32

Introducing Ethereum

A planetary scale computer build on blockchain technologypermision-lessTuring complete language

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 11 / 32

Introducing Ethereum

A planetary scale computer build on blockchain technologypermision-lessTuring complete language

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 11 / 32

Turing Machine

Figure: Caption

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 12 / 32

Introducing Ethereum

A planetary scale computer build on blockchain technologypermision-lessTuring complete language

Begins the era of Decentralized app : Program that can run withoutfailure, without any downtime, censorship, fraud or third party inference

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 13 / 32

Introducing Ethereum

A planetary scale computer build on blockchain technologypermision-lessTuring complete languageBegins the era of Decentralized app

: Program that can run withoutfailure, without any downtime, censorship, fraud or third party inference

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 13 / 32

Introducing Ethereum

A planetary scale computer build on blockchain technologypermision-lessTuring complete languageBegins the era of Decentralized app : Program that can run withoutfailure, without any downtime, censorship, fraud or third party inference

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 13 / 32

EVM: Ethereum Virtual Machine

Ethereum Blockchain isBlockchain with built in programming languagedecentralizedmassive database, where the current state of every account isstored EVM handles internal state and computationComputationis paid in Ether, per computation stepeach account object have:Its own internal statehave 32 byte key/value called storageCan call or send messages to other node

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 14 / 32

Bitcoin vs Ethereum

EthereumBitcoin

Figure: Bitcoin Vs EthereumRas Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 15 / 32

Basics of Ethereum

Ether: the underlying cryptocurrency of EthereumGas: Gas is a basic unit of computationSmart contract:

Pre-written logic (code)

stored and replicated on blockchainself executing by running the codecan update blockchaincan do transfer of assets,run code to make payment

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 16 / 32

Basics of Ethereum

Ether: the underlying cryptocurrency of EthereumGas: Gas is a basic unit of computationSmart contract:

Pre-written logic (code)stored and replicated on blockchain

self executing by running the codecan update blockchaincan do transfer of assets,run code to make payment

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 16 / 32

Basics of Ethereum

Ether: the underlying cryptocurrency of EthereumGas: Gas is a basic unit of computationSmart contract:

Pre-written logic (code)stored and replicated on blockchainself executing by running the code

can update blockchaincan do transfer of assets,run code to make payment

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 16 / 32

Basics of Ethereum

Ether: the underlying cryptocurrency of EthereumGas: Gas is a basic unit of computationSmart contract:

Pre-written logic (code)stored and replicated on blockchainself executing by running the codecan update blockchaincan do transfer of assets,run code to make payment

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 16 / 32

Account types

Externally Owned AccountsContract Accounts

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 17 / 32

Externally owned Accounts

Has ether Balance

Can send transactions (Ether transfer or trigger Contract code)Is controlled by private keyshas no associated code

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 18 / 32

Externally owned Accounts

Has ether BalanceCan send transactions

(Ether transfer or trigger Contract code)Is controlled by private keyshas no associated code

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 18 / 32

Externally owned Accounts

Has ether BalanceCan send transactions (Ether transfer or trigger Contract code)Is controlled by private keyshas no associated code

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 18 / 32

Contract Accounts

Has associated Ether balanceHas associated codecode execution is triggered by transaction or messages received fromother accountscan execute code of arbitrary complexity (Turing Completeness) andmanipulate data in blockchain

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 19 / 32

Transaction

Contains:receipt of the messagesignatureValue: amount of wei to be transferred from sender to recipientoption data field: which contains message to be send to recipientStartgas value:representing the maximum number of computationalsteps the transaction execution is allowed to take

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 20 / 32

Message

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 21 / 32

Mist

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 22 / 32

Mist: Introduction

Mist Ethereum wallet is a Desktop hybrid application which is bothEthereum node and client. Aim: to install mist and run a Faucet account

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 23 / 32

Discover MistDownload, install and start mist. You should see the following

Figure: Mist

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 24 / 32

Mistsynchronization to the main net would take a lot of the time, so youshould switch to the testnet

Figure: Testnet

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 25 / 32

Mist

Figure: CaptionRas Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 26 / 32

MistAnd then you’ll see Mist syncing with test net

Figure: TestnetRas Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 27 / 32

MistLets click on launch application

Figure: Caption

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 28 / 32

MistCreate new account

Figure: Caption

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 29 / 32

Mist

Figure: Caption

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 30 / 32

Mist

Figure: Caption

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 31 / 32

Bibliography

Ras Dwivedi (Indian Institute of Technology Kanpur) Introduction to Blockchain May 22, 2018 32 / 32

top related