Upgrade to Pro — share decks privately, control downloads, hide ads and more …

區塊鏈內部培訓

changwu
September 19, 2016

 區塊鏈內部培訓

培訓投影片

changwu

September 19, 2016
Tweet

More Decks by changwu

Other Decks in Technology

Transcript

  1. •  ౵ॶ৽ࠎԤ –  ඔሳࠊл –  бหлླྀၰაჰ৘ •  ౵ॶ৽ࣉࢨ –  ౵ॶ৽ࢺക

    –  ౵ॶ৽ႋႨ –  ܱ࡯ა็ᅞ •  ҧ৽a೺׈ຩਫ਼aᇆିކჿaႅ඲Ќ޹ •  ၛ෾٘षؿ –  ၛ෾٘ࠎЧࢺക –  ձࡹҩ൫৽षؿ۽ऎ –  %"QQQSPHSBNNJOH •  ౵ॶ৽࠯ඌ࿐༝ሧჷ 2 ᅋေ
  2. бหлఏჷ •  ୍ᄅ –  4BUPTIJ/BLBNPUPčᇏЧՒĎิԛਔбหлഡ࠹Ϣ௃඀ •  ୍ –  ԚՑ܄Ῐս઒ – 

    षჷбหлग़޼؊ೈࡱ –  ၛ бหлؑߐ၂۱஼೓ •  ୍ –  Ῐ൓ੀྛ –  IUUQTCJUDPJOPSH 3
  3. SHA-2562 (“abc” + “1”) = 158c09e82d88955d8a051934d12f74a53ea205743778165d1140a8903686e1ac SHA-2562 (“abc” + “2”)

    = c72b0720d3302d76cd7b6b3f3dcb554d05f14fee8567cdda3ee8b7ff51e02015 . . . SHA-2562 (“abc” + “19”) = 005eL2ff3e871185b95bf7c8628e212d15a7d08c42235a381e06caa55856a0c 1P8ഡ࠹ᅽ࿐ •  ࢳี঒଴đဒᆣಸၞđטᆜ଴؇ 24 Hash(TXs+nonce) < number 00000000000000005b95bf7c8628e212d15a7d08c42235a381e06caa55856a0c
  4. SHA-2562 (“abc” + “1”) = 158c09e82d88955d8a051934d12f74a53ea205743778165d1140a8903686e1ac SHA-2562 (“abc” + “2”)

    = c72b0720d3302d76cd7b6b3f3dcb554d05f14fee8567cdda3ee8b7ff51e02015 . . . SHA-2562 (“abc” + “19”) = 005eL2ff3e871185b95bf7c8628e212d15a7d08c42235a381e06caa55856a0c 1P8ഡ࠹ᅽ࿐ •  ࢳี঒଴đဒᆣಸၞđטᆜ଴؇ 25 ෘ৯ᄀ఼֥ದᄀႵࠏ߶ႚႵཿᅫЧ֥ಃ৯ ֌҂սіᅧ໤ෘ৯љದࣼીࠏ߶đᆺ൞ۀੱ֮
  5. бหл৥ൎ 29 •   ᄅರ   CJUDPJOPSHთ଀ᇿҨ ᄅರ 

     Ϣ௃඀ؿі ᄅರ   ᄝ4PVSDF'PSHFOFUᇿҨ#JUDPJOཛଢ •   ᄅರ   Էൗ౵ॶࡹ৫ ᄅರ   #JUDPJOW ᄅರ   ֻ၂г#JUDPJOࢌၞ
  6. 33 ݢ઼઼ ৙ূ 0.319 BTC Fees 0.001 BTC 0.32 BTC

    1AnLpMkAmf7jy2BNkP3oYw1phzhNuLws7M (0.32 BTC) 1GJYiog3ato17SSTFCCdkZ44H6LdkW9j1V (0.319 BTC) Tx Fee: 0.001 BTC ࣉྛбหлࢌၞ Bitcoin Unconfirmed Transachon (ໃಒಪࢌၞ) !!!Իฃ੢๚ਠ౮
  7. 35 #JUDPJO.FNQPPM ଽթӽ  ঀ۽ •  ෆࠢໃಒಪࢌၞ •  ঀ۽յЇࢌၞࢳ۽ቔਈᆣૼ 1P8

     –  ಒಪࢌၞކم •  ద଀ᆞಒ •  BNPVOU<JOQVU>BNPVOU<PVUQVU> –  յЇ൭࿃ٮ֥ۚࢌၞ –  ࠹ෘ)BTI CMPDL]59T]OPODF 
  8. ຋ঀ 36 Block 1 ... Block 2 ... Block 3

    ... Block 4 ... ᅳ֞౵ॶ ঀ۽ ঀ۽ ঀ۽ ঀ۽ ঀ۽ ঀ۽ Hash( Block 3 | TXs | 0x00000A3D..) ࢂৣ#5$ ౵ॶ෮Ⴕࢌၞ൭࿃ٮ ౵ॶ
  9. 37 ݢ઼઼ ৙ূ 0.319 BTC Fees 0.001 BTC 0.32 BTC

    1AnLpMkAmf7jy2BNkP3oYw1phzhNuLws7M (0.32 BTC) 1GJYiog3ato17SSTFCCdkZ44H6LdkW9j1V (0.319 BTC) Tx Fee: 0.001 BTC ࢌၞປӮ Transachon confirmed (ࢌၞಒಪ) Իฃਠ౮ Block 4 ... Block 5 ... Block 6 ... Block 7 ... Block 8 ... Block 9 ... Ցಒಪ
  10. ౵ॶ৽ #MPDLDIBJO  38 Block 4 ... Block 5 ...

    Block 6 ... Block 7 ... Block 8 ... Block 9 ... NFBO_ٳᇒ ѻ඾ٳ҃  Block N ... lll ঒ₒ؇ %JGGJDVMUZ  ౵ॶۚ؇ #MPDLIFJHIU  ౵ॶധ؇ #MPDLEFQUI  ౵ॶᄀധіൕᇗྍյᄯ၂่౵ॶ৽଴؇ᄀۚ ྯ 2016 ӻ豽賉տ᧣碉Ӟ稞ᵙଶ(~2珏)
  11. ቋӉ৽مᄵ -POHFTUDIBJOSVMF  41 ೘۱ঀ۽๝ൈ຋֞ކم౵ॶ ࠿࿃຋ ၛቋӉ֥৽ູᇶ࠿࿃຋ ܛظ౵ॶ 0SQIBOCMPDL 

    0SQIBOCMPDLၹູঀ۽๝ൈ຋֞ކم౵ॶطᄯӮٳҭđၹቋӉ৽مᄵФఙႨ֥౵ॶ 4UBMFCMPDLᄝ๝۱౵ॶۚ؇đӮۿᅳ֥֞ކم౵ॶđ֌Фљದఽ༵၂҄
  12. бหл •  #JUDPJO׈ሰࠊл –  #JUDPJO"1FFSUP1FFS&MFDUSPOJD$BTI4ZTUFN •  ႇ໓#JUDPJO •  ࠊлژݼႇ໓෪ཿູ#5$ࠇ9# • 

    ২#5$۱бหл •  ૄۯඹ୍߶טᆜ၂Ցࢂৣࠊлඔਈ –  ଢభ֥бหлሹඔ5PUBM#JUDPJOT •  #JUDPJO༢๤ླྀק •  CJUDPJOࠊлֆ໊ 42
  13. бหл֥ֆ໊ •  #5$бหл •  #5$D#5$ٳбหл #JUDFOU  •  #5$N#5$ݸбหл NCJU

    NJMMJCJU CJUNJMM  •  #5$Ȱ#5$ັбหл VCJU NJDSPCJU  •  4BUPTIJ бหл֥ቋཬ૫ح •  4BUPTIJ#5$ 43
  14. ຋ঀ •  ຋ঀࡼրಒಪ֥ࢌၞሧਘ٢֞౵ॶᇏ ಆ౯ᅫЧ  –  $MJFOU౼ԛ౵ॶ৽ቋᗥ၂۱౵ॶଽಸ ࠹ෘIBTIᆴ –  Ֆଽթӽ

    ࡼໃ࠺੣ᄝ౵ॶᇏ֥ࢌၞ ᇯгဒᆣ ѩ٢ೆ֥֞౵ॶ –  ಩ၩ҉၂۱OPODF –  ίෘ)BTI CMPDL]59T]OPODF  –  ೂݔݗ༐ᆴ֥భࠫ۱ඔऎႵ৵࿃O֥ іൕࢳथ଴ีᅳ֞ྍ֥ކم౵ॶ –  ࡼᅳ֥֞ྍ౵ॶၛࠣᅳ֥֞OPODFܼѬԛಀ ಞః෰ࢫׄିܔဒᆣ –  ࠆ֤ࢂৣ 44
  15. "OBDDPVOUCBTFEMFEHFS OPU#JUDPJO  Create 25 coins and credit to AliceASSERTED

    BY MINERS Transfer 17 coins from Alice to BobSIGNED(Alice) Transfer 8 coins from Bob to CarolSIGNED(Bob) Transfer 5 coins from Carol to AliceSIGNED(Carol) SIMPLIFICATION: only one transaction per block hme Transfer 15 coins from Alice to DavidSIGNED(Alice) might need to scan backwards unhl genesis! is this valid?
  16. "USBOTBDUJPOCBTFEMFEHFS #JUDPJO  Inputs: Ø Outputs: 25.0→Alice Inputs: 1[0] Outputs:

    17.0→Bob, 8.0→Alice SIGNED(Alice) SIMPLIFICATION: only one transaction per block hme is this valid? finite scan to check for validity Inputs: 2[0] Outputs: 8.0→Carol, 9.0→Bob SIGNED(Bob) Inputs: 2[1] Outputs: 6.0→David, 2.0→Alice SIGNED(Alice) we implement this with hash pointers change address 1 2 3 4
  17. "USBOTBDUJPOCBTFEMFEHFS #JUDPJO  Inputs: Ø Outputs: 25.0→Alice Inputs: 1[0] Outputs:

    17.0→Bob, 8.0→Alice SIGNED(Alice) SIMPLIFICATION: only one transaction per block hme is this valid? finite scan to check for validity Inputs: 2[0] Outputs: 8.0→Carol, 9.0→Bob SIGNED(Bob) Inputs: 2[1] Outputs: 6.0→David, 2.0→Alice SIGNED(Alice) we implement this with hash pointers 1 2 3 4
  18. .FSHJOHWBMVF Inputs: ... Outputs: 17.0→Bob, 8.0→Alice SIGNED(Alice) SIMPLIFICATION: only one

    transaction per block hme Inputs: 1[1] Outputs: 6.0→Carol, 2.0→Bob SIGNED(Carol) Inputs: 1[0], 2[1] Outputs: 19.0→Bob SIGNED(Bob) .. . .. . 1 2 3
  19. +PJOUQBZNFOUT Inputs: ... Outputs: 17.0→Bob, 8.0→Alice SIGNED(Alice) SIMPLIFICATION: only one

    transaction per block hme Inputs: 1[1] Outputs: 6.0→Carol, 2.0→Bob SIGNED(Carol) Inputs: 2[0], 2[1] Outputs: 8.0→David SIGNED(Carol), SIGNED(Bob) .. . .. . two signatures! 1 2 3
  20. ܄ᄂაֹᆶ 52 •  ܄ᄂ൞܄ᄂ ܄ᄂֹᆶ  •  ֹᆶ൞ֹᆶ •  ֹᆶႮ܄ᄂ෮๷֝

    –  4)" –  3*1&.%IBTI –  #BTFщ઒ –  11,)"EESFTT •  1BZT5P1VC,FZ)BTI 11,)  P2PKH Address ఫЇֹᆶ
  21. 53 ݢ઼઼ ৙ূ 0.319 BTC Fees 0.001 BTC 0.32 BTC

    1AnLpMkAmf7jy2BNkP3oYw1phzhNuLws7M (0.32 BTC) 1GJYiog3ato17SSTFCCdkZ44H6LdkW9j1V (0.319 BTC) Tx Fee: 0.001 BTC ࣉྛбหлࢌၞ Bitcoin Unconfirmed Transachon (ໃಒಪࢌၞ) !!!Իฃ੢๚ਠ౮
  22. 54 { "hash":"7c4025...", "ver":1, "vin_sz":1, "vout_sz":1, "lock_hme":0, "size":224, "in":[{ "prev_out":{

    "hash":"2007ae...", "n":0 }, "scriptSig":"304502... 042b2d..." }], "out":[{ "value":"0.31900000", "scriptPubKey":"OP_DUP OP_HASH160 a7db6f OP_EQUALVERIFY OP_CHECKSIG" }] } NFUBEBUB *OQVU T  PVUQVU T  •  ࢌၞ*% ੀඣݼ  •  ϱЧ •  *OQVUඔਈ •  PVUQVUඔਈ •  ౵ॶ෭קൈࡗ •  ࢌၞնཬ h@ps://blockchain.info/rawtx/7c402505be883276b833d57168a048cfdf306a926484c0b58930f53d89d036f9 ࢌၞ۬ൔ
  23. 55 { "hash":"7c4025...", "ver":1, "vin_sz":1, "vout_sz":1, "lock_hme":0, "size":224, "in":[{ "prev_out":{

    "hash":"2007ae...", "n":0 }, "scriptSig":"304502... 042b2d..." }], "out":[{ "value":"0.31900000", "scriptPubKey":"OP_DUP OP_HASH160 a7db6f OP_EQUALVERIFY OP_CHECKSIG" }] } NFUBEBUB *OQVU T  PVUQVU T  h@ps://blockchain.info/rawtx/7c402505be883276b833d57168a048cfdf306a926484c0b58930f53d89d036f9 •  ᆭభ֥ࢌၞJE QPJOUFS  •  ֻࠫ۱PVQVU •  ద଀scriptSig: <sig> <pubKey> ࢌၞ۬ൔ
  24. 56 { "hash":"7c4025...", "ver":1, "vin_sz":1, "vout_sz":1, "lock_hme":0, "size":224, "in":[{ "prev_out":{

    "hash":"2007ae...", "n":0 }, "scriptSig":"304502... 042b2d..." }], "out":[{ "value":"0.31900000", "scriptPubKey":"OP_DUP OP_HASH160 a7db6f OP_EQUALVERIFY OP_CHECKSIG" }] } NFUBEBUB *OQVU T  PVUQVU T  h@ps://blockchain.info/rawtx/7c402505be883276b833d57168a048cfdf306a926484c0b58930f53d89d036f9 •  ⊨ԛࣁỡ •  CJUDPJOTDSJQU ࢌၞ۬ൔ
  25. 57 { "hash":"7c4025...", "ver":1, "vin_sz":1, "vout_sz":1, "lock_hme":0, "size":224, "in":[{ "prev_out":{

    "hash":"2007ae...", "n":0 }, "scriptSig":"304502... 042b2d..." }], "out":[{ "value":"0.31900000", "scriptPubKey":"OP_DUP OP_HASH160 a7db6f OP_EQUALVERIFY OP_CHECKSIG" }] } NFUBEBUB *OQVU T  PVUQVU T  h@ps://blockchain.info/rawtx/7c402505be883276b833d57168a048cfdf306a926484c0b58930f53d89d036f9 ࢌၞဒᆣ
  26. 59 scriptSig: <sig> <pubKey> scriptPubKey: OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG

    <sig> a7db6ff121871c65a8924b8e40f160d385515ad7 ࢌၞဒᆣ <pubKey>
  27. 60 scriptSig: <sig> <pubKey> scriptPubKey: OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG

    <sig> a7db6ff121871c65a8924b8e40f160d385515ad7 ࢌၞဒᆣ <pubKey> <pubKey>
  28. 61 scriptSig: <sig> <pubKey> scriptPubKey: OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG

    <sig> a7db6ff121871c65a8924b8e40f160d385515ad7 ࢌၞဒᆣ <pubKey> <pubKeyHash>
  29. 62 scriptSig: <sig> <pubKey> scriptPubKey: OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG

    <sig> a7db6ff121871c65a8924b8e40f160d385515ad7 ࢌၞဒᆣ <pubKey> <pubKeyHash> <pubKeyHash>
  30. 63 scriptSig: <sig> <pubKey> scriptPubKey: OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG

    <sig> a7db6ff121871c65a8924b8e40f160d385515ad7 ࢌၞဒᆣ <pubKey>
  31. 67

  32. ࢫׄো྘ 69 ఫЇ ঀ۽ ປᆜ ౵ॶ৽ ਫ਼Ⴎ ࢫׄ ປᆜ ౵ॶ৽

    ਫ਼Ⴎ ࢫׄ ঀ۽ ປᆜ ౵ॶ৽ ਫ਼Ⴎ ࢫׄ ఫЇ ਫ਼Ⴎ ࢫׄ #JUDPJO$PSF GVMMOPEF  ౵ॶ৽ࢫׄ ׿৫ঀ۽ ౞ఫЇ 417 
  33. 70

  34. бหлള෿ಁ •  ঀӽ •  ࢌၞ෮ •  පਫ਼ •  5PSେ଀ຩ઎ • 

    ఫЇ •  ඲ᄂЌ޹ •  #*1 •  ࢌၞ෮ാ౑
  35. бหлႅႬ •  ࢌၞಒಪત •  ႅҟӮЧ •  ಯթᄝ೐ׄ •  ֹ༯߄ࢌၞ ޑ൧

     •  лࡎѯ׮ •  ൧ӆࢤ൳؇ •  ঔԉྟ •  ଽ҆Ԋ๬ •  ᇯ҄ᇏྏ߄ •  مੰܿٓ •  ҂ॖ୉
  36. 81

  37. 82

  38. 87

  39. 91

  40. ౵ॶ৽࿹࣮ •  ܋്ࠏᇅ –  1P8 1SPPGPG8PSL  –  1P4 1SPPGPG4UBLF

     –  %1P4 %FMFHBUF1SPPGPG4UBLF  •  ᇆିކჿ –  5VSJOHDPNQMFUFTDSJQUJOHMBOHVBHFT –  /PO5VSJOHDPNQMFUFTDSJQUJOHMBOHVBHFT •  νಆࠣႅ඲ •  ঔԉིࠣۚି 514  •  ࣜ࠶Ⴚၹ Ѱᒲં  93
  41. ൉᷹൞ᇆିކჿ •  Ⴎս઒ᆰࢤ॥ᇅඔሳሧӁࠇြༀੀӱ –  ս઒ؓކჿऎႵཌྷ๝৘ࢳ –  ҂ၹކჿ؟Ց۷םطႵ෮ࠁཪ –  ؓຓ҆ඔऌुم၂ᇁ Ⴒࡎࠇܢࡎ֩

      •  ᇆି҂൞ᆷದ۽ᇆି  •  ᇆିކჿ ଢభ ҂൞مੰކჿ  •  ս઒ࣇᆳྛگᄖ֥ܿᄵބ่ࡱđ҂ऎႵ࿐༝ି৯ –  ׈ะ –  ሱ׮൲ࠊࠏ 97 ๭টሱIUUQTCJUTPOCMPDLTOFU
  42. აሱ׮ᆦڱၿྛႵޅ҂๝ •  ಀᇏྏ߄ –  ၿྛીႵधؓ॥ᇅಃ •  ս઒ –  ๝ဢ׻Ⴕս઒đ֌ᆺႵԮ๤ၿྛႵ॥ᇅބؓᅫ֥ି৯đ໭مՖຓི҆ဒ • 

    ๩ૼ؇ –  Ⴊׄğ০ၭܱ༢ᆀ ҕაٚ дՎ๩ૼॖ࡮ –  ಌׄğކჿླေႵႅ඲Ќ޹ •  ֐ྟ –  ॖग़ᇅ۲ൔކჿ 98
  43. 100 Ping sends money to Pong. 1.  Deploy Pong .

    2.  Deploy Ping, giving it the address of Pong 3.  Call Ping.touchPong() using a <pongaddress>.send() 4.  do something ᆺႵކჿؿఏᆀҌିཧ߮ ၛֹᆶя്ކჿࢌ޺ؓའ ۷ྍކჿሑ෿ ࠎЧކჿൕ২
  44. ཬࢲ •  ڱॻٚؿఏPG֥؟ద଀ކჿđթೆ੻ۚᧄᆦڱࣁحרࣁ –  "MJDFğ໭مᄝO-PDL5JNF CMPDLT భ౼߭רࣁ –  #PCğᆺေద଀ࠧॖ൬ॻ • 

    ᄝචٚ๝ၩᗥđԮෂᆃг؟ద଀ކჿ֞౵ॶ৽ ৽ഈ  •  ಒಪᗥđචٚॖࣉྛ؟г৽༯ࢌၞ ৽༯  •  ቋᗥᄜࡼࢲෘᗥ֥ࢌၞཿ߭౵ॶ৽ ৽ഈ  112
  45. •  ࡌഡ#PCေᆦڱ۳"MJDF#5$ –  ࢌၞ߭֞ჰ൓ሑ෿ğ"MJDF #5$ #PC #5$  •  Ⴕਆࡱ൙౦ေቓ

    –  චٚ๝ൈదඇ၂ٺྍ֥ӵ୶ࢌၞđࢌߐྍ֥)BTI –  චٚࢌߐᆭభдՎႚႵ֥4FDSFUT ۷ྍ๙֡ 6QEBUFUIF$IBOOFM  123
  46. •  ഈ၂۱ࢌၞ"MJDF #5$ #PC #5$  •  ೂݔ#PCᄝࢲෘൈđෂԛݖಀؓ෰Ⴕ০֥ࢌၞ •  ߭མᆭభđජܼѬđජсྶ֩5JNF-PDLT

    •  ࡆഈ۷ྍ๙ֻ֥֡ؽ҄đචٚ޺ཌྷࢌߐഈՑࢌၞ֥4FDSFUT •  ೂݔ#PCܼѬؓ෰Ⴕ০֥ࣸࢌၞđ෰ေ֩ր۱౵ॶ •  ؓᧄ"MJDFটඪđ ٝᆸ#PCෂԛ֥ࣸࢌၞ 124
  47. •  ༵భđ"MJDFބ#PCࡹ৫ਔචཟ๙֡ •  ೂݔ"MJDFམᆦڱ#5$۳$BSPM ֻ೘ᆀ  •  ॖၛ֥ቔم   "MJDFა$BSPMᄜࡹ၂่චཟ๙֡

    ࡹ৫๙֡ေӮЧ    ࠇ൞đೂݔ#PCა$BSPMᆭࡗၘࣜႵ๙֡ਔ ପ᷹"MJDFà#PCà$BSPM •  ؓ"MJDFط࿽đෲ֥ၐ੮ •  ஃ#PCીϜఫ۳$BSPM •  ஃ$BSPMڎಪෲ൬֞ఫ ຩ઎ 127
  48. •  ཨԢ"MJDF֥ၐ੮ –  ಒಪ#PCࡼఫ۳$BSPMᗥđҌࡼఫ۳#PC –  ᆩ߶$BSPMđ#PC߶ሇࢌఫ۳ෲ •  "MJDFေ౰$BSPMӁള၂۱4FDSFUđࡼ)BTI TFDSFU ֥ࢲݔ۳

    "MJDFĠѩۡᆩ$BSPMđᆺႵ#PCࡼఫ۳ෲᗥđҌିࡼᆃ۱TFDSFU ۳#PC •  ๝ൈđ"MJDFϜᆃ۱IBTIᆴ۳#PCđᆺႵ#PCఫ۳$BSPMᗥđҌ ିଦ֞TFDSFUđᆭᗥࢌ۳"MJDFಒಪᗥđ"MJDFҌ۳$BSPMఫ Carol 128
  49. 129

  50. ሹࢲ •  ໭ླ෮Ⴕࢌၞ׻࠺ᄝ৽ഈ ႅ඲ࢠࡄ  •  ؓ๙֡ᇏ֥චٚႅ඲ྟҵ ๝၂ֹᆶ  • 

    ๙֡ࡹ৫сྶթೆרࣁ ఫႵ؍ൈࡗФ෭  •  ࢠഒ൭࿃ٮႵրဒᆣ –  ᅳ֞၂่ਫ਼Ⴎđࢠഒ൭࿃ٮđࢠഒIPQ –  'MBSF"O"QQSPBDIUP3PVUJOHJO-JHIUOJOH/FUXPSL Ϣ௃ℼ  133
  51. ႅ඲ •  ;FSPLOPXMFEHFQSPPGT •  4.1$ 4FDVSFNVMUJQBSUZDPNQVUBUJPO  •  .JYJOH ࠁл

     –  $PJO4IVGGMF ၘൌགྷ  –  $PJO+PJO –  %BSLDPJO 134
  52. 8IBUJT&UIFSFVN  •  Vitalik Buterin wrote “Bitcoin was designed to

    be a SMTP. It’s a protocol that is very good at one parhcular task. It is good for transferring money, but it was not designed as a foundahonal layer for any kind of protocols to be built on top.”
  53. 8IBUJT&UIFSFVN  •  Vitalik Buterin wrote The need for a

    technology that was more expansive, and that replicated the funchonality of Turing- complete programming languages in a way that would be so powerful as to describe any blockchain applicahon.
  54. 7JTJPO •  An a@empt to apply learnings from Bitcoin’s decentralized,

    global cryptographic network to challenges beyond value exchange. – Currency issuance – Decentralized autonomous organizahons – Smart contracts – Smart property
  55. ,FZ.JMFTUPOF   •  JANUARY 2014 – Ethereum inventor Vitalik

    Buterin announces the project at The North American Bitcoin Conference. •  JULY 2014 – The Ethereum Foundahon begins selling ether tokens in a 42-day public sale. In total, it sells 60,102,216 ETH for 31,591 BTC, worth $18,439,086 at that hme. •  JULY 2015 – Ethereum launches Fronher, a command-line version of the pla€orm for developer teshng.
  56. ,FZ.JMFTUPOF   •  AUGUST 2015 – Kraken becomes the

    first major digital currency exchange to list ethers for sale. Major exchanges including Coinbase and Gemini follow suit. •  JANUARY 2016 – Eleven major banks – Barclays, BMO Financial Group, Credit Suisse, Commonwealth Bank of Australia, HSBC, Nahxis, Royal Bank of Scotland, TD Bank, UBS, UniCredit and Wells Fargo – announce a trial of a permissioned version of the pla€orm. •  JANUARY 2016 – The first ethereum startups begin to raise funding for projects as diverse as a decentralized stock market and developer tool suites.
  57. ,FZ.JMFTUPOF   •  MARCH 2016 – Ethereum releases Homestead,

    the first “produchon-ready” version of its blockchain pla€orm. •  MARCH 2016 – The total value of all ethers on the ethereum network passes $1bn. •  MAY 2016 – The DAO becomes the largest decentralized autonomous organizahon, collechng more than $160m worth of ethers to be invested in other projects. •  JUNE 2016 – The DAO collapses a•er an unknown a@acker exploits a flaw in the project’s code. The event forces ethere- um’s development community to consider protocol-level code changes to rescue customer funds.
  58. $PNQPOFOUT •  A cryptographic token •  An address system • 

    A network of validators (miners) •  A consensus algorithm •  A blockchain ledger •  The Ethereum Virtual Machine •  A set of programing languages •  Complex economic structures.
  59. -JOHVJTUJDT4DSJQUJOH •  Bitcoin has a rudimentary scriphng language •  Ethereum

    aims to be “Turing-complete.” –  If a system has unlimited resources, memory, computahonal power and storage, then infinite “loops” can be executed.
  60. 5SBOTBDUJPOT •  Two types of accounts: 1.  Externally owned accounts

    (EOAs) •  Defined as the basic form of account, EOAs interact with and generate updates on the Ethereum blockchain. 2.  Contracts •  Contracts programmahcally execute when they receive instruchons in the form of a transachon from an EOA. •  Ethereum does not use transachon inputs or outputs, which deviates from the unspent transachon outputs (UTXO) model bitcoin popularized.
  61. 5IF&UIFSFVN#MPDLDIBJO   •  Block Size –  In Bitcoin, blocks

    are limited in size to 1 MB. –  Ethereum has no such limit on the size of its blocks. •  A mechanism (Gas) which makes contracts more and more expensive to execute the larger they are in size. •  Blockchain Size –  Ethereum blockchain: 17 GB (~9 months) –  Bitcoin blockchain: 69 GB (~8 years)
  62. 5IF&UIFSFVN#MPDLDIBJO   •  Block Times – Bitcoin’s blockchain adds new

    blocks roughly every 10 minutes, – Ethereum has set its target on 12-second block hmes, though current block hmes are closer to 14 seconds.
  63. $POTFOTVT"MHPSJUIN   •  To solve a long-standing computer science

    problem known as Byzanhne Fault Tolerance. •  Bitcoin solves this problem through creahng a chain of proof of work. •  Ethereum uses a similar PoW protocol known as Ethash. (SHA-3) –  Resistant to the high-powered mining chips –  Light client implementahons
  64. $POTFOTVT"MHPSJUIN   •  TransacLon Validators – In 2009, the first

    bitcoin users were able to run mining so•ware on home computers, using CPU power. – Ethereum mining was set up so that it could only be conducted with graphics processing units (GPUs).
  65. 5IF&UIFSFVN7JSUVBM.BDIJOF •  The Ethereum protocol is designed to do far

    more than process peer-to-peer transachons. It is designed to execute complex code. –  Need to interpret instruchons –  Smart contracts are facilitated and enforced through EVMs, which implement and execute instruchons wri@en in any of a variety of languages via a bytecode.
  66. 5IF&UIFSFVN7JSUVBM.BDIJOF •  Solidity – Ethereum would be incomplete without a nahve

    programing language – and that language is Solidity. – It(solc) compiles instruchons into bytecode so that they can then be read by the network.
  67. 4VQQPSUJOH5FDIOPMPHJFT •  Whisper –  A communicahons protocol and tool set

    that allows applicahons built on the Ethereum protocol to talk to each other. •  Swarm –  SwarmHash or Swarm is a peer-to-peer file sharing system designed to efficiently store and retrieve data needed for use in Ethereum applicahons and contracts.
  68. 4VQQPSUJOH5FDIOPMPHJFT •  Oracles –  For smart contracts to execute properly,

    they need to know how to ascertain the accuracy of given inputs to those “if-then statements”. –  A need for a construct that communicates outside realihes to smart contracts. In Ethereum, these are called ‘oracles’. •  Mist –  A usable front- end technology with which users explore the applicahons and offerings that uhlize Ethereum.
  69. 4VQQMZ 5SBEJOH"WBJMBCJMJUZ •  ETH is a unit of account and

    store of value on Ethereum –  BTC on Bitcoin –  not meant to serve as an alternahve currency –  Posihoned as a system resource that powers the creahons of those seeking to use the pla€orm –  ether: “Digital oil”; bitcoin: “Digital gold” Bitcoin’s value is derived from the security of the network and its scarcity; ether has value because it is needed to execute scripts and contracts on the Ethereum network
  70. 4VQQMZ 5SBEJOH"WBJMBCJMJUZ •  InflaLon Rate –  The Ethereum network includes

    a mechanism for releasing new ethers into the system over hme. (Introduce 18m ethers per year through mining) •  Gas –  Gas, a thro@ling mechanism that determines, in real hme, how much ether each contract costs. –  Ether served as a way to enable access to Ethereum. Gas is an economic structure used to limit access. 1: wei 1012: szabo 1015: finney 1018: ether
  71. (BT •  Ⴈটޙਈࢌၞ USBOTBDUJPO ࠇކჿ DPOUSBDU ᄝ&UIFSFVNഈФ ᆳྛ֥۽ቔਈđࠧ؟ഒ۱ᆷ਷ࠇ؟ഒ۱׮ቔ෮ླေݻٮ֥ֆ໊ĠႮᧄ ૄ၂۱Ҡቔ׻߶ཨݻଖུඔਈ֥HBTđᄀگᄖ֥Ҡቔླေཨݻࢠ؟֥ ࠹ෘሧჷđՖط෮ླ֥HBT္ᄀۚ

    •  طᆭ෮ၛေഡ࠹HBTᆃ۱ࠏᇅମ൞ၹູ၂۱TNBSUDPOUSBDUᄝ۳ ჍJOQVUᆭᗥ߶SVO؟ࣲҌ߶๔ᆸࠇᆀമᇀ߶҂߶๔ᆸ׻൞໭م൙ ༵ყҩ֥đ෮ၛေ౰൐Ⴈᆀሱ࠭ഡק჻ၩ޽؟ഒHBTᄝSVOᆃ۱ DPOUSBDUഈ૫ 159
  72. (BTᄎቔ •  2HBTᄝࢌၞ֥ളଁᇛ௹ᇏđᄸ᷹ᄎቔĤ"۴ऌϢ௃඀   ࡟Ұࢌၞ൞ڎ۬ൔᆞಒčద଀Ď   ࠹ෘ൭࿃ٮğ45"35("4 ("413*$&   Ԛ൓߄("445"35("4đૄCZUFࡨ၂۱("4

      ሇ၍ؿෂٚࢌၞࡎᆴ۳൬൳ٚ   ೂݔᅫ޼൞ఔჿᅫ޼đᄵᆳྛఔჿDPEFᆰ֞ປӮࠇݻ࣐("4   ೂݔؿෂٚఫ҂ܔࠇ("4എ࣐ğ߭گ෮Ⴕః෰ሑ෿đ֌ঀ۽౼ሼ෮Ⴕ൭࿃ٮ   ೂݔᄝ("4എ࣐భᆳྛӮۿđْߎ؟ᘧ֥൭࿃ٮđഎו֥൭࿃ٮ۳ঀ۽ 163
  73. /PEF%JTUSJCVUJPO •  As of mid-2016, – Ethereum had 5,384 nodes – Bitcoin

    network had 5,757 nodes •  The majority of nodes are hosted in the US and Germany.
  74. 1MBUGPSN'VODUJPOTBOE6TF$BTFT •  Smart Contracts – Consider an elevator management system, thinking

    of the elevators as running a “smart contrachng system” on a “private blockchain” – Blockchains don’t guarantee that all entries will be true
  75. 1MBUGPSN'VODUJPOTBOE6TF$BTFT •  DAOs – the idea of large numbers of contracts

    working in unison •  Distributed Autonomous Agents (DAAs) •  Distributed Autonomous Organizahons (DAOs)
  76. 1MBUGPSN'VODUJPOTBOE6TF$BTFT •  Dapps –  The larger purpose of the Ethereum

    network is to serve as a pla€orm for the creahon of distributed applicahons. •  Dapps can be comprised of single DAO or even a series of DAOs that work together to create an applicahon. •  Current Dapps categories: –  Smart contract services, uhlihes & analyhcs –  Gambling and games –  Informahon validahon & oracle services –  Registry and corporate governance.
  77. 4VNNBSZ •  Smart contracts –  Versions of the technology that

    are single-purpose and ephemeral, so they are created for a specific task and can disappear at the end. A financial contract is a good example here. •  Autonomous agents –  More long-term focused smart contracts, Vitalik envisions a series of contracts forming an internal AI that can be charged with decision-making.
  78. 4VNNBSZ •  DAOs –  Described as a long-term contract between

    many people, DAOs are closer to historical business structures, allowing users to join, exercise vohng power and even eventually exit such collaborahons. DAOs are designed to hold onto assets and use a kind of vohng system to manage their distribuhon. –  There can be many different types of DAOs. The more basic ones live enhrely on the blockchain, but more advanced ones might have some of their data stored on other decentralized networks or across a number of servers.
  79. 4DSJQUJOH •  Solidity is a brand-new concept in computer programing,

    and script-based systems remain largely untested. •  Further, the language’s compiler is buggy, and there aren’t repositories and public libraries yet. •  "Formal Verificahon of Smart Contracts" by Ethereum's Dr. Chrishan Reitwiessner
  80. 5IF1SJDFPG(BTJTIJHI •  It cost $250,000 to process 1 GB of

    ethereum transachon data in May. •  At that hme, the contract would cost 640,000,000,000 gas, or about 17,500 ETH, at $14 per ETH.
  81. 5VSJOH$PNQMFUFOFTT •  Ethereum is purportedly “Turing-complete”, but in reality, the

    system is limited by memory, computahon power, storage on the network and economic costs. •  The more complex the instruchon set, the more messages that have to be passed back and forth within the system, the more delegates and code calls required by the contract, the higher the cost. The gas system ensures this.
  82. 1SPPGPG4UBLF5SBOTJUJPO •  PoW is a powerful consensus algorithm because it

    allows the system to prove that work was actually done to mine a block. •  PoS validahon on the other hand, doesn’t use a mining process. Holders of the network’s tokens own stakes in the network based on percentage of ownership, and vote to validate and include blocks in the blockchain.
  83. $BTQFS •  A new consensus algorithm, which replaces miners with

    validators. •  Goals: –  A focus on CPU power rather than GPU power, making the network more egalitarian –  Be@er support for lightweight clients –  The capacity for more transachons per second –  The possibility of even faster block hmes. •  Introducing Casper “the Friendly Ghost”
  84. 4UBUF$IBOOFMT •  A method of conduchng transachons that could occur

    o of the main blockchain. – Requires some system that would lock the blockchain state by form of contract.
  85. 4IBSEJOH •  Leverages the insights of tradihonal database sharding, wherein

    porhons of the full database are held on separate servers as a way to spread out the load and improve performance. •  Scalability improvement. •  The idea of 'sharding' is to split the space of possible accounts (contracts are accounts too) into subspaces, for example, based on first digits of their numerical addresses. •  Talk by Vitalik
  86. %FWFMPQNFOU5JNFMJOF •  FronLer –  30th July, 2015 –  First version

    of Ethereum as a beta release, aiming at developers who wanted to experiment with the project’s tools. –  Offers basic command-line capabilihes, and provided users the ability to mine ether and upload and execute contracts.
  87. %FWFMPQNFOU5JNFMJOF •  Homestead –  14th March, 2016 –  first “produchon

    version” –  Features a command-line interface, but was framed as the first commercial iterahon of the technology. Homestead was automahcally introduced at block number 1,150,000 on the Ethereum blockchain. –  Requires the Ethereum community to undergo the hard fork
  88. %FWFMPQNFOU5JNFMJOF •  Metropolis –  The next major release of Ethereum

    –  The fully-featured version of the product, aimed at non- technical users, and will be the first offocial non-beta version. –  Include the first fully funchonal version of the Mist browser and provide a graphical user interface atop the client. –  This version is expected to bring fundamental back-end improvements and upgrades to Solidity. –  Metropolis will represent Ethereum version 1.0.
  89. %FWFMPQNFOU5JNFMJOF •  Serenity – Ethereum 2.0 – Switch to PoS consensus – Introduce

    scaling soluhons including ‘sharding’ and ‘state channels’
  90. ࠏఖ஥ᇂ node1 node2 •  Ҡቔ༢๤6CVOUV •  $16චނ •  ଽթ(# • 

    ႗஍(# •  (FUIWFSTJPOTUBCMFGFEG •  (P7FSTJPOHP
  91. { "nonce": "0x0000000000000042", "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000", "difficulty": "0x400", "alloc": {}, "coinbase":

    "0x0000000000000000000000000000000000000000", "hmestamp": "0x0", "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "extraData": "Custem 21vianet Ethereum Genesis Block", "gasLimit": "0xffffffff" } ҄ᇧ၂ğ(FOFTJTGJMF ຋ঀ଴؇ $ touch genesis.json
  92. { "nonce": "0x0000000000000042", "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000", "difficulty": "0x4000", "alloc": { "1a8f075fea1f2180dfet41e34f3922e59b201cdfa":

    { "balance": "20000000000000000000" } }, "coinbase": "0x0000000000000000000000000000000000000000", "hmestamp": "0x00", "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "extraData": "Custem Ethereum Genesis Block", "gasLimit": "0xffffffff" } ყ༵ٳ஥ᅫ޼ᘧح
  93. ҄ᇧؽğԚ൓஥ᇂ $ geth --datadir "/Users/user/eth-private/data/node1“ init "/Users/user/eth-private/data/ genesis.json“ I0907 15:50:37.690379

    ethdb/database.go:82] Alloted 16MB cache and 16 file handles to /Users/user/eth-private/data/node1/chaindata I0907 15:50:37.706056 cmd/geth/main.go:299] successfully wrote genesis block and/or chain rule set: 6e92f8b23bcdfdf34dc813cfaf1d84b71beac80530506b5d63a2df10fe23a660 •  JOJUԷൗ౵ॶഡק֖ਫ਼ࣥ •  EBUBEJS౵ॶඔऌթ٢ਫ਼ࣥ HFOFTJT൞ၛభࣸϱҕඔၘ҂ᄜ൐Ⴈ
  94. ҄ᇧ೘ğᄝOPEFࡹ৫⃒Ї $ geth --datadir "/Users/user/eth-private/data/node1" account new Your new account

    is locked with a password. Please give a password. Do not forget this password. Passphrase: Repeat passphrase: Address: {905646685a1c4015fdc03cad92c892264f7c3f73}
  95. ҄ᇧඹğᄎྛHFUI $ geth --idenhty "node1" --datadir "/Users/user/eth-private/data/node1" --rpc --rpcport "8080"

    --rpccorsdomain "*" --port "30303" --nodiscover --rpcapi "db,eth,net,web3" -- networkid 42 console idenhty ႨႿѓൕଢభຩ઎଀ሳ port ຩ઎ࡓ๐؊१ rpc ఓ׮rpc ๙ྐ rpcapi ഡᇂᄍྸ৵ࢤ֥SQD֥ग़޼؊đ၂ϮູEC FUI OFU XFC networkid ഡᇂ֒భ౵ॶ৽֥ຩ઎*%đႨႿ౵ٳ҂๝֥ຩ઎đ൞၂۱ඔሳ console ఓ׮ଁ਷ྛଆൔđॖၛᄝ(FUIᇏᆳྛଁ਷
  96. ҄ᇧ໴ğԚ൓஥ᇂOPEF $ geth --datadir "/Users/user/eth-private/data/node2“ init "/Users/user/eth-private/data/ genesis.json“ I0907 15:50:37.690379

    ethdb/database.go:82] Alloted 16MB cache and 16 file handles to /Users/user/eth-private/data/node1/chaindata I0907 15:50:37.706056 cmd/geth/main.go:299] successfully wrote genesis block and/or chain rule set: 6e92f8b23bcdfdf34dc813cfaf1d84b71beac80530506b5d63a2df10fe23a660 •  JOJUԷൗ౵ॶഡק֖ਫ਼ࣥ •  EBUBEJS౵ॶඔऌթ٢ਫ਼ࣥ HFOFTJT൞ၛభࣸϱҕඔၘ҂ᄜ൐Ⴈ
  97. ҄ᇧੂğᄝOPEFࡹ৫⃒Ї $ geth --datadir "/Users/user/eth-private/data/node2" account new Your new account

    is locked with a password. Please give a password. Do not forget this password. Passphrase: Repeat passphrase: Address: {760ee68af37a1c52cd5b1255f4f53ef44a9244f8}
  98. ҄ᇧ௾ğᄎྛHFUI OPEF  $ geth --idenhty "node2" --datadir "/Users/user/eth-private/data/node2" --rpc

    --rpcport "8081" --rpccorsdomain "*" --port "30304" --nodiscover --rpcapi "db,eth,net,web3" -- networkid 42 console idenhty ႨႿѓൕଢభຩ઎଀ሳ port ຩ઎ࡓ๐؊१ rpc ఓ׮rpc ๙ྐ rpcapi ഡᇂᄍྸ৵ࢤ֥SQD֥ग़޼؊đ၂ϮູEC FUI OFU XFC networkid ഡᇂ֒భ౵ॶ৽֥ຩ઎*%đႨႿ౵ٳ҂๝֥ຩ઎đ൞၂۱ඔሳ console ఓ׮ଁ਷ྛଆൔđॖၛᄝ(FUIᇏᆳྛଁ਷
  99. Ұु৵ࢤࢫׄ 206 (node 1) > admin.peers [{ caps: ["eth/62", "eth/63"],

    id: "c7660b6126ecda43502248bb09fec4a0L6d778ea36f6e0704L8b96eee63225936c8c97ba7f05a2a463dad31fa49f809ae997c59795d5da 8ee1137156df0905", name: "Geth/v1.4.11-stable-fed692f6/darwin/go1.6.3/node2", network: { localAddress: "[::1]:62206", remoteAddress: "[::1]:30304" }, protocols: { eth: { difficulty: 4496000, head: "0x424395802a1c8afc2015865baf1eca8ca85a9498886f800f47108a9299bf3337", version: 63 } } }] >
  100. &YQMPSFS 210 $ git clone h@ps://github.com/etherparty/explorer $ npm start $

    geth --idenhty "node1" --datadir "/Users/user/eth-private/data/node1" --rpc -- rpccorsdomain "h@p://127.0.0.1:8000" --port "30303" --nodiscover --rpcapi "db,eth,net,web3" --networkid 42 console $ open h@p://localhost:8000
  101. 3&45GVM"1* •  FUIKTPOSQD –  IUUQTHJUIVCDPN$POTFO4ZTFUIKTPOSQD  •  'MBTL3&45GVM 214 $

    curl h@p://127.0.0.1:5000/getVersion { "web3_clientVersion": "Geth/v1.4.11-stable-fed692f6/darwin/go1.6.3/node1" }
  102. &UIFSFVN%FW   ձࡹ&UIFSFVN඲Ⴕ৽   ᄎྛਆ۱OPEFಞдՎ޺৵   ඃ༑HFUI+BWB4DSJQU$POTPMF   ࡹ৫ః෰ᅫݼ ࡹ৫ࢌၞ

    ܴҳCMPDL   ᄎྛ඲Ⴕ৽֥NJOFS   31$QSPUPDPM൐ႨაԱࢤ   &UIFSFVN#MPDLFYQMPSFS   4NBSU$POUSBDUPO&UIFSFVN   .JTU   4PMJEJUZ   %"QQQSPHSBNNJOH   ࡼ  ЇӮEPDLFSJNBHF ႨBOTJCMFটఓ׮&UIFSFVNࠏಕ  ປӮሱ׮߄҃ඇ 218
  103. 219