Slide 1

Slide 1 text

Ethereum “The World Computer” Libby Kent 1 @viskobatz

Slide 2

Slide 2 text

Overview • Bitcoin: poof of work based blockchain • Ethereum: blockchain + general purpose PL + arbitrary state • EVM • DApps (smart contracts) 2 @viskobatz

Slide 3

Slide 3 text

Bitcoin (2009) 1. “Decentralized peer-to-peer online currency that maintains a value without any backing, intrinsic value or central issuer.” 2. “Proof of work based blockchain for public agreement on the order of TXs. “first-to-file” bitcoin the first credible solution.” 3 @viskobatz

Slide 4

Slide 4 text

Ledger Keeping Track of State Scruffy 15 Simon 10 Z^2 9 Drun 8 Lydia 8 Tom 8 Brian 10 4 @viskobatz

Slide 5

Slide 5 text

Single Leader -> Followers Centralized Scruffy 15 Simon 10 Z^2 9 Drun 8 Lydia 8 Tom 8 Brian 10 (Z^2, 1) --> Scruffy (Drn, 1) --> Scruffy 5 @viskobatz

Slide 6

Slide 6 text

Ledger (1) (2) (3) Current State (0) Start State Scruffy 10 Simon 10 Z^2 10 Drun 10 Lydia 10 Tom 10 Brian 10 (Z^2, 1) --> Scruffy (Simon, 1) --> Scruffy (Tom, 1) --> Scruffy Scruffy 14 Simon 10 Z^2 9 Drun 8 Lydia 9 Tom 8 Brian 10 6 (Drn, 1) --> Scruffy @viskobatz

Slide 7

Slide 7 text

Ledger (1) (2) (3) Current State (4) (0) Start State Scruffy 10 Simon 10 Z^2 10 Drun 10 Lydia 10 Tom 10 Brian 10 (Z^2, 1) --> Scruffy (Simon, 1) --> Scruffy (Tom, 1) --> Scruffy (Lyd, 1) --> Scruffy Scruffy 15 Simon 10 Z^2 9 Drun 8 Lydia 8 Tom 8 Brian 10 7 (Drn, 1) --> Scruffy @viskobatz

Slide 8

Slide 8 text

Decentralized All Peers Can Commit (Z^2, 1) --> Scruffy (Drun, 1) --> Scruffy (Lyd, 1) --> Simon (Drun, 1) --> Z^2 (Z^2, 1) --> Tom (Simon, 1) --> Scruffy (Lyd, 1) --> Scruffy (Tom, 1) --> Scruffy 8

Slide 9

Slide 9 text

Decentralized Ledger Single Shared Truth Current State (1) (Z^2, 1) --> Scruffy Genesis State Scruffy 10 Simon 10 Z^2 10 Drun 10 Lyd 10 Tom 10 Brian 10 Scruffy 12 Simon 10 Z^2 9 Drun 9 Lydia 10 Tom 10 Brian 10 (Drun, 1) --> Scruffy 9 (0) @viskobatz

Slide 10

Slide 10 text

Current State (1) (Z^2, 1) --> Scruffy Genesis State Scruffy 10 Simon 10 Z^2 10 Drun 10 Lyd 10 Tom 10 Brian 10 Scruffy 12 Simon 11 Z^2 9 Drun 9 Lydia 9 Tom 10 Brian 10 (Drun, 1) --> Scruffy 10 (2) (Lyd, 1) --> Simon (0) @viskobatz

Slide 11

Slide 11 text

Current State (1) (Z^2, 1) --> Scruffy Genesis State Scruffy 10 Simon 10 Z^2 10 Drun 10 Lyd 10 Tom 10 Brian 10 Scruffy 13 Simon 10 Z^2 9 Drun 9 Lydia 9 Tom 11 Brian 10 (Drun, 1) --> Scruffy 11 (2) (Lyd, 1) --> Simon (3) (Drun, 1) --> Z^2 (Z^2, 1) --> Tom (Simon, 1) --> Scruffy (0) @viskobatz

Slide 12

Slide 12 text

Current State (1) (Z^2, 1) --> Scruffy Genesis State Scruffy 10 Simon 10 Z^2 10 Drun 10 Lyd 10 Tom 10 Brian 10 (Drun, 1) --> Scruffy 12 (2) (Lyd, 1) --> Simon (3) (Drun, 1) --> Z^2 (Z^2, 1) --> Tom (Simon, 1) --> Scruffy (4) (Tom, 1) --> Scruffy (0) Scruffy 14 Simon 10 Z^2 9 Drun 9 Lydia 9 Tom 10 Brian 10 @viskobatz

Slide 13

Slide 13 text

(5) Current State (1) (Z^2, 1) --> Scruffy Genesis State Scruffy 10 Simon 10 Z^2 10 Drun 10 Lyd 10 Tom 10 Brian 10 (Drun, 1) --> Scruffy 13 (2) (Lyd, 1) --> Simon (3) (Drun, 1) --> Z^2 (Z^2, 1) --> Tom (Simon, 1) --> Scruffy (4) (Tom, 1) --> Scruffy (Lyd, 1) --> Scruffy (0) Scruffy 15 Simon 10 Z^2 9 Drun 9 Lydia 8 Tom 10 Brian 10 @viskobatz

Slide 14

Slide 14 text

Proof of Work • Mechanism through which peers gain the right to participate in the systems. Miner 14 @viskobatz

Slide 15

Slide 15 text

Proof of Work Properties 1. Hard to find solution. 2. Easy to verify. 15 @viskobatz

Slide 16

Slide 16 text

Review Cryptographic Hash Function SHA-256(N-e size input) SHA-256 00110101… (256 bits) 16 @viskobatz

Slide 17

Slide 17 text

Proof of Work / Mining In Blockchain (Bitcoin) 0 1 PrevBlockHeaderHash + nonce (242k) SHA-256 0000001…(256) target six 0s Repeatedly generate a nonce 2 17 @viskobatz

Slide 18

Slide 18 text

Found The Nonce 3 nonce (242k) 0 1 2 18 @viskobatz

Slide 19

Slide 19 text

PoW + Longest Chain 0 1 2 2 19 @viskobatz

Slide 20

Slide 20 text

PoW + Longest Chain 0 1 2 2 3 3 20 @viskobatz

Slide 21

Slide 21 text

PoW + Longest Chain 0 1 2 3 3 21 @viskobatz

Slide 22

Slide 22 text

PoW + Longest Chain 0 1 2 3 3 22 @viskobatz

Slide 23

Slide 23 text

Bitcoin Peers Closed World • state = copy who owns which Bitcoins (UTXO) • tree of new transactions • network / protocol rules: blocksize: 1MB blocktime: ~10 min consensus mechanism: proof of work 23 @viskobatz

Slide 24

Slide 24 text

Bitcoin Accounts • Public private key pair. • Public key reference to the account (UTXO). • Externally owned by a secret key, digital signature to transfer value. 24 @viskobatz

Slide 25

Slide 25 text

Bitcoin as a State Transition System • State (S): Shared ledger of who owns which bitcoins. UTXO (value, owner). • State Transition: Recording transfer of values. ‘$X from A to B’ (S, TX) -> (S’) 25 @viskobatz

Slide 26

Slide 26 text

Bitcoin Script • Bitcoin Script (stack based language). • Opcodes: OP_SHA256, OP_VERIFY. • Bitcoin Script Not Turing Complete (no loops). • Verify a digital signature. 26 @viskobatz

Slide 27

Slide 27 text

Alternative Apps On Top of Bitcoin Blockchain • Namecoin 27 @viskobatz

Slide 28

Slide 28 text

Alternative Apps On Top of Bitcoin Blockchain • Namecoin • Colored Coins > 1384: Litecoin (2011) Namecoin (2011) Auroracoin (2014) Zcash (2016) 28 @viskobatz

Slide 29

Slide 29 text

Alternative Apps On Top of Bitcoin Blockchain • Namecoin • Colored Coins • Metacoins 29 @viskobatz

Slide 30

Slide 30 text

2 Approaches 1. Building an independent network. 2. Building a protocol on top of Bitcoin. 30 @viskobatz

Slide 31

Slide 31 text

Bitcoin Blockchain + General Purpose PL + Arbitrary State 31 @viskobatz

Slide 32

Slide 32 text

Ether • Main crypto fuel. • Used to pay transactions fees. 32 @viskobatz

Slide 33

Slide 33 text

Ethereum 2 Types of Accounts • External accounts • Internal (contract) accounts 33 @viskobatz

Slide 34

Slide 34 text

External Accounts (like Bitcoin account) • Externally owned by a secret key. • Send message by creating and signing a TX. 34 @viskobatz

Slide 35

Slide 35 text

Contract Accounts • Internally owned – is contract code • Only runs when receives a msg. • Can read / write to internal storage. • Can create other contracts. 35 @viskobatz

Slide 36

Slide 36 text

Ethereum Accounts are the State (S) • 20 Byte address: 0xcc16e3c00dbbe76603fa833ec20a48f786dfe610 • State transition: direct transfer of value and information between accounts. 36 @viskobatz

Slide 37

Slide 37 text

Account ( Nonce, Ether balance, Contract code, Storage (rt)) 37 @viskobatz

Slide 38

Slide 38 text

(Nonce, Ether balance, Contract code, StorageRt) 0xcc16e3c 00dbbe76 613fa833e c20a48f78 6dfe610 38 @viskobatz

Slide 39

Slide 39 text

Interacting with the System • Transactions: come from external accounts. Signed data package that contains a message. • Messages: sent from external accounts and from internal (contract) accounts. 39 @viskobatz

Slide 40

Slide 40 text

Interactions In Ethereum msg Singed(tx) Update Storage Contract DoAThing Contract DoAnotherThing 40 @viskobatz

Slide 41

Slide 41 text

Gas 41 @viskobatz

Slide 42

Slide 42 text

Transaction Need Gas STARTGAS GASPRICE Limit to pay for computation steps (how much gas you are willing to pay) e.g. 2000. Fee to pay miner per computation step, e.g. .001. 2000 * 0.001 = 2 ether Check that the sender has 42 @viskobatz

Slide 43

Slide 43 text

Transaction Initiated From an External Account signature sender amount eth to STARTGAS GASPRICE nonce data 43 @viskobatz

Slide 44

Slide 44 text

Code Execution • Ethereum Virtual Machine (EVM). • Every peer runs the EVM. 44 @viskobatz

Slide 45

Slide 45 text

EVM [block_state] [transaction] [message] [code] [memory] [stack] [pc] [gas] 45 @viskobatz

Slide 46

Slide 46 text

EVM Initialization PC: 0, STACK: [], MEM: [], STORAGE: {} EVM 46 @viskobatz

Slide 47

Slide 47 text

ADD 3 10 13 ADD PC --> 86 85 SLOAD 84 87 10 3 + 47 @viskobatz

Slide 48

Slide 48 text

SSTORE 13 0 SSTORE PC --> 90 89 SWAP1 88 [13,0,0,0,0,..] Contract Storage 48 @viskobatz

Slide 49

Slide 49 text

49 @viskobatz

Slide 50

Slide 50 text

50 @viskobatz

Slide 51

Slide 51 text

51 @viskobatz

Slide 52

Slide 52 text

52 @viskobatz

Slide 53

Slide 53 text

5 53 @viskobatz

Slide 54

Slide 54 text

54 @viskobatz

Slide 55

Slide 55 text

55 @viskobatz

Slide 56

Slide 56 text

56 @viskobatz

Slide 57

Slide 57 text

57 @viskobatz

Slide 58

Slide 58 text

58 @viskobatz

Slide 59

Slide 59 text

59 @viskobatz

Slide 60

Slide 60 text

60 @viskobatz

Slide 61

Slide 61 text

61 @viskobatz

Slide 62

Slide 62 text

DApps Smart Contracts The Internet 62 @viskobatz

Slide 63

Slide 63 text

Financial DApps • Token Systems. • Financial Derivatives. 63 @viskobatz

Slide 64

Slide 64 text

Semi-financial DApps • Stable Value Coins (MKR). • UBI (Universal Basic Income). 64 @viskobatz

Slide 65

Slide 65 text

Non-financial DApps (Governance) • Identity and Reputation Systems. • Decentralized File Store. • Decentralized Autonomous Organizations. 65 @viskobatz

Slide 66

Slide 66 text

Ethereum Peers • state = External (who owns what) + internal (contract) accounts. • state transitions: arbitrary EVM • tree of new transactions • network / protocol rules: blocksize: 1MB -> limited by the gas limit blocktime: ~10 min à ~10-15 secs consensus mechanism: proof of work + GHOST 66 @viskobatz

Slide 67

Slide 67 text

Ethereum • Concept to run arbitrary computations on top of a blockchain. • Easy to create alternative decentralized applications (DApps). • Namecoin a few lines of code. • Easy to create alternative coins. • PWL Token! • Keep Calm and Play on. 67 @viskobatz

Slide 68

Slide 68 text

68