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

The reality of Blockchain programming

The reality of Blockchain programming

1eecfce54b4f902784d046328935efd4?s=128

Makoto Inoue

July 09, 2017
Tweet

More Decks by Makoto Inoue

Other Decks in Technology

Transcript

  1. @makoto_inoue @makoto The reality of Blockchain programming

  2. WT* is blockchain?

  3. Distributed Ledger (DLT) Blockchain = Distributed Database that keeps track

    of value Blockchain Crypto
  4. Ethereum = Blockchain + SmartContract

  5. “Hello World” of Smart Contract

  6. ICO (Initial Coin Offering)

  7. Got it, who are you BTW?

  8. London Ethereum “CodeUp”

  9. - Limited space - Huge sign ups - No turn

    ups Meetups - 50% problem Expectation Reality
  10. - Escrow model - Micro payment - Game theory Solution

    - Block Party!!
  11. Demo: https://www.youtube.com/watch?v=yfm1NKsA4j0

  12. TOC - 1. Learn Blockchain programming in 3 steps -

    2. Everything you got is essentially a bounty - 3. Performance tuning for fun and profit
  13. 1. Learn Blockchain programming in 3 steps

  14. Smart Contract language: Solidity

  15. Hop: msg.sender

  16. Step: msg.value

  17. Jump!: address.send()

  18. 2. Everything you’ve got is essentially a bounty Emin Gün

    Sirer
  19. May 2016

  20. HACKED!!!

  21. Smart contract programming requires a different engineering mindset ... similar

    to hardware programming or financial services programming than web or mobile development. https://github.com/ethereum/wiki/wiki/Safety
  22. Is my code okay?

  23. Of course, not

  24. payback()

  25. Send money

  26. To all participants...

  27. Including to a code

  28. The fix

  29. It’s Party time!

  30. Sep 2016

  31. 100%!!!

  32. Feb 2017

  33. 2 no turn ups 70%

  34. 3. Performance tuning for fun and profit

  35. Blockchain = Distributed Database that keeps track of value

  36. Transaction fee = Gas https://www.upload.ee/image/5710187/Screen_Shot_2016-04-07_at_10.20.25.png

  37. The total transactions cost

  38. Ether = 10^18 Wei 1: wei 10^9: gwei 10^12: szabo

    10^15: finney 10^18: ether
  39. June 2017

  40. The rise of Ethereum $400 $10 $13

  41. CodeUp #21

  42. £££££

  43. How Ethereum charges you

  44. Gas limit > gas * gasPrice

  45. Gas Limit Gas Limit > gas * gas price

  46. Gas Price Gas Limit > gas * gas price

  47. Gas Price Gas Limit < gas * gas price 20G

    -> 2G $5 -> $0.5
  48. Writing performance test in JavaScript

  49. Transaction Hash

  50. getTransaction / getTransactionReceipt

  51. gasUsed * gasPrice

  52. Testrpc (in Memory)

  53. gasPrice = 100 gwei

  54. 20Gwei

  55. gasPrice = 20gwei

  56. None
  57. Gas time Calculator 232 sec 2 Gwei

  58. gasPrice = 2gwei

  59. Deployed after 300 blocks (= 75 min)

  60. I am ready

  61. None
  62. 22nd June 2017

  63. Does anyone still remember this?

  64. FORGOTTEN !!!

  65. http://www.coindesk.com/ico-investments-pass-vc-funding-in-blockchain-market-first/

  66. Status.im ICO

  67. Status.im ICO

  68. 60Gwei

  69. None
  70. None
  71. Future Of BlockParty

  72. Apr 2017

  73. > 200 people

  74. 200 people

  75. GasLimit 4m

  76. > 2000 people

  77. 2000 people

  78. Error: VM Exception: out of gas...

  79. Solution

  80. Refactoring with £3.47 saving

  81. Interested in Ethereum ?

  82. The good news $400 $10 $13 $240

  83. https://ethereumfoundation.org/devcon3

  84. https://www.meetup.com/Ethereum-Paris http://www.asseth.fr

  85. http://breaktheblock.simplybusiness.co.uk

  86. @makoto_inoue @makoto Thanks DISCLAIMER: THE CONTENT ON THIS SLIDE IS

    PROVIDED AS GENERAL INFORMATION ONLY AND SHOULD NOT BE TAKEN AS INVESTMENT ADVICE
  87. None
  88. Is my Dapp Okay now?

  89. Not sure

  90. https://github.com/OpenZeppelin/zeppelin-solidity

  91. Bug Bounty as a smart contract

  92. Bounty smart contract

  93. Bounty smart contract

  94. Bounty smart contract

  95. 0x13a86ba15dacbd43f037718b243eb67e1bc9acad 1 ETH ($248)

  96. @makoto_inoue @makoto Thanks DISCLAIMER: THE CONTENT ON THIS SLIDE IS

    PROVIDED AS GENERAL INFORMATION ONLY AND SHOULD NOT BE TAKEN AS INVESTMENT ADVICE
  97. Resources https://ethereum.org/token https://ethereum.github.io/browser-solidity https://github.com/ethereum/yellowpaper http://truffleframework.com https://github.com/ethereum/wiki/wiki/Safety https://github.com/OpenZeppelin/zeppelin-solidity https://etherscan.io http://ethgasstation.info https://github.com/ethereumjs/testrpc