Libby Kent on Ethereum: The World Computer - PWL NYC

Libby Kent on Ethereum: The World Computer - PWL NYC

In 2009 bitcoin emerged as a peer-to-peer value transfer system, and was successfully deployed throughout the world. Four years later (2013), the Ethereum white paper was published by an 18 year old Vitalik Buterin which builds on top of the Bitcoin consensus model to allow for distributed computation and applications to be deployed on a decentralized peer-to-peer network.

This paper discusses introducing a turing complete language that can be run on top of the network, utilizing a modified consensus algorithm (GHOST), strategies for defending against mining centralization, further application of such a system beyond just finance, the introduction of state, as well as a history of bitcoin and and the fundamental concepts of the underlying blockchain.

2e1ac3c401307165d5a7efa5fe07b1fc?s=128

Papers We Love

April 19, 2018
Tweet

Transcript

  1. Ethereum “The World Computer” Libby Kent 1 @viskobatz

  2. Overview • Bitcoin: poof of work based blockchain • Ethereum:

    blockchain + general purpose PL + arbitrary state • EVM • DApps (smart contracts) 2 @viskobatz
  3. 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
  4. Ledger Keeping Track of State Scruffy 15 Simon 10 Z^2

    9 Drun 8 Lydia 8 Tom 8 Brian 10 4 @viskobatz
  5. 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
  6. 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
  7. 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
  8. 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
  9. 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
  10. 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
  11. 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
  12. 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
  13. (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
  14. Proof of Work • Mechanism through which peers gain the

    right to participate in the systems. Miner 14 @viskobatz
  15. Proof of Work Properties 1. Hard to find solution. 2.

    Easy to verify. 15 @viskobatz
  16. Review Cryptographic Hash Function SHA-256(N-e size input) SHA-256 00110101… (256

    bits) 16 @viskobatz
  17. 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
  18. Found The Nonce 3 nonce (242k) 0 1 2 18

    @viskobatz
  19. PoW + Longest Chain 0 1 2 2 19 @viskobatz

  20. PoW + Longest Chain 0 1 2 2 3 3

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

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

    @viskobatz
  23. 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
  24. 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
  25. 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
  26. 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
  27. Alternative Apps On Top of Bitcoin Blockchain • Namecoin 27

    @viskobatz
  28. Alternative Apps On Top of Bitcoin Blockchain • Namecoin •

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

    Colored Coins • Metacoins 29 @viskobatz
  30. 2 Approaches 1. Building an independent network. 2. Building a

    protocol on top of Bitcoin. 30 @viskobatz
  31. Bitcoin Blockchain + General Purpose PL + Arbitrary State 31

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

    fees. 32 @viskobatz
  33. Ethereum 2 Types of Accounts • External accounts • Internal

    (contract) accounts 33 @viskobatz
  34. External Accounts (like Bitcoin account) • Externally owned by a

    secret key. • Send message by creating and signing a TX. 34 @viskobatz
  35. 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
  36. Ethereum Accounts are the State (S) • 20 Byte address:

    0xcc16e3c00dbbe76603fa833ec20a48f786dfe610 • State transition: direct transfer of value and information between accounts. 36 @viskobatz
  37. Account ( Nonce, Ether balance, Contract code, Storage (rt)) 37

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

    6dfe610 38 @viskobatz
  39. 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
  40. Interactions In Ethereum msg Singed(tx) Update Storage Contract DoAThing Contract

    DoAnotherThing 40 @viskobatz
  41. Gas 41 @viskobatz

  42. 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
  43. Transaction Initiated From an External Account signature sender amount eth

    to STARTGAS GASPRICE nonce data 43 @viskobatz
  44. Code Execution • Ethereum Virtual Machine (EVM). • Every peer

    runs the EVM. 44 @viskobatz
  45. EVM [block_state] [transaction] [message] [code] [memory] [stack] [pc] [gas] 45

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

    EVM 46 @viskobatz
  47. ADD 3 10 13 ADD PC --> 86 85 SLOAD

    84 87 10 3 + 47 @viskobatz
  48. SSTORE 13 0 SSTORE PC --> 90 89 SWAP1 88

    [13,0,0,0,0,..] Contract Storage 48 @viskobatz
  49. 49 @viskobatz

  50. 50 @viskobatz

  51. 51 @viskobatz

  52. 52 @viskobatz

  53. 5 53 @viskobatz

  54. 54 @viskobatz

  55. 55 @viskobatz

  56. 56 @viskobatz

  57. 57 @viskobatz

  58. 58 @viskobatz

  59. 59 @viskobatz

  60. 60 @viskobatz

  61. 61 @viskobatz

  62. DApps Smart Contracts The Internet 62 @viskobatz

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

  64. Semi-financial DApps • Stable Value Coins (MKR). • UBI (Universal

    Basic Income). 64 @viskobatz
  65. Non-financial DApps (Governance) • Identity and Reputation Systems. • Decentralized

    File Store. • Decentralized Autonomous Organizations. 65 @viskobatz
  66. 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
  67. 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
  68. 68