Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.

Ethereum Smart Contracts 101 with Cryptizens.io

210 visualizaciones

Publicado el

Get smarter on Ethereum Smart Contracts with this workshop given by Thomas Vanderstraeten from Cryptizens.io. Feel free to reach out directly to hello@cryptizens.io if you would like to discover more great stuff about Blockchain and Ethereum Smart Contracts!

Publicado en: Tecnología
  • Sé el primero en comentar

  • Sé el primero en recomendar esto

Ethereum Smart Contracts 101 with Cryptizens.io

  1. 1. Get smarter on smart contracts Thomas Vanderstraeten https://cryptizens.io hello@cryptizens.io
  2. 2. Starter quiz: where’s the fake blockchain project? 2© Cryptizens.io
  3. 3. The plan: go through this together A sense of how blockchain can run applications A refresher about blockchain A point of view on smart contracts biz implications A ‘get-your-hands-dirty’ exercise 3© Cryptizens.io
  4. 4. Blockchain refresher: what lies beyond the buzz? A DATABASE OF TRANSACTIONS (= LEDGER) ORGANIZED BY BLOCKS IN A SEQUENTIAL WAY (= CHAIN OF BLOCKS), SECURED SO IT CANNOT BE COUNTERFEITED (= CRYPTO-MINED), AND REPLICATED ACROSS MANY COMPUTERS (= DISTRIBUTED) 4© Cryptizens.io
  5. 5. A database of transactions Transactions DB Alice sends 3 BTC to Bob Bob sends 5 BTC to Jeff Kim sends 1 BTC to Alice 5© Cryptizens.io
  6. 6. Organized by blocks in a sequential way Block N - 2 before Jeff sends 1 BTC to Alice Bob sends 1 BTC to Kim Alice sends 1 BTC to Bob Block N - 1 yesterdayDB Alice sends 3 BTC to Bob Bob sends 5 BTC to Jeff Kim sends 1 BTC to Alice Block N today 6© Cryptizens.io
  7. 7. Secured so it cannot be counterfeited Block N - 2 before Block N - 1 yesterday Block N today Transactions Alice sends 3 BTC to Bob Bob sends 5 BTC to Jeff Kim sends 1 BTC to Alice Transactions Alice sends 3 BTC to Bob Bob sends 6 BTC to Jeff Kim sends 1 BTC to Alice 7© Cryptizens.io
  8. 8. Replicated across many computers Alice’s computer DB Jeff’s computer DB Charles’s computer DB Bob’s computer DB Kim’s computer DB 8© Cryptizens.io
  9. 9. Blockchain’s resulting properties in a nutshell Transparency & auditability Immutability Decentralization Common single source of truth Desintermediation 9© Cryptizens.io
  10. 10. In 2013, this guy created a blockchain to run apps I’ve got a nice t-shirt, but what about something nicer yet? Let’s leverage blockchain’s properties to run applications called smart contracts! Vitalik Buterin, Ethereum blockchain creator 10© Cryptizens.io
  11. 11. What is an app, fundamentally? Data base Server that runs code End-user interface Simple Web application architecture 11© Cryptizens.io
  12. 12. So, how can we use the blockchain to run apps? Transactions Alice sends 1 ETH to CryptoKitties.co DB Start from a simple ‘financial transactions’ blockchain... State of the world Kitty_owner = Alice Kitty_hungry = true Transactions Alice sends 1 ETH to CryptoKitties.co DB ...add general purpose storage to play with variables... State of the world Kitty_owner = Alice Kitty_hungry = true Transactions - Alice sends 1 ETH to CryptoKitties.co - Alice feeds the cat Functions feedCat(cost = 0.5 ETH) buyCat(cost = 1 ETH) VM DBSmart contract ...add functions to modify these variables, and a virtual machine to run these functions... © Cryptizens.io Smart contract State of the world Kitty_owner = Alice Kitty_hungry = true Transactions - Alice sends 1 ETH to CryptoKitties.co - Alice feeds the cat Functions feedCat(cost = 0.5 ETH) buyCat(cost = 1 ETH) VM DB Website interface feed buy WebBlockchain ...add a sexy web front-end to trigger these functions, and you’re done! Decentralized App (Dapp) UI 12
  13. 13. Blockchain properties can thus be leveraged for apps! Transparency & auditability Immutability Decentralization Common single source of truth Desintermediation Everyone sees the application code, so no malicious features can be hidden No one can alter the the code after it has been deployed All participate in the running of the application No single stakeholder owns the app for their single benefit All can agree on a common set of functions and data SMART CONTRACT 13© Cryptizens.io TECHNICAL POINT OF VIEW
  14. 14. And that’s how the term ‘smart contract’ was coined SMART CONTRACT It not only documents the agreement, but also enforces it (code execution) Cannot be changed once it has been signed (deployed on the blockchain) Documents an agreement (implements a series of functions with triggers and effects) Is public and auditable for all stakeholders (distributed on the blockchain) Basically, just a computer program (running on the Ethereum virtual machine) 14© Cryptizens.io BUSINESS POINT OF VIEW
  15. 15. Smart contracts applied to business: a lottery Organizer Participants WITHOUT SMART CONTRACT Payment provider Escrow account Lottery Terms & conditions Company statuses Payments Terms & conditions Winner pick 15© Cryptizens.io We’ve built a complex ecosystem of stakeholders, laws, processes and documents to embed TRUST in interactions, and protect people in case of breaches!
  16. 16. Smart contracts applied to business: a lottery Participants 16© Cryptizens.io SMART CONTRACT Organizer Who cares about trust? Smart contracts technology allows us to interact in a TRUSTLESS way, where technology prevents breaches of agreements! Meow! WITH SMART CONTRACT
  17. 17. A real-life insurance smart contract: AXA Fizzy 17© Cryptizens.io Oops...
  18. 18. My nonprofit smart contract venture: Cryptorun 60 KM around Brussels SMART CONTRACT if ThomasHasRun60Km { sendFundsToBeCode(); } 18© Cryptizens.io
  19. 19. A critical look at smart contracts business use Still hard to connect to the outside world without losing trust Smart contract engineers might become the lawyers of tomorrow Immutability goes against lean development Infancy issues (scalability, reliability) ? But yet, so much potential! 19© Cryptizens.io
  20. 20. Now, let’s get our hands dirty! https://etherlearn.io 20© Cryptizens.io
  21. 21. First thing first: get some free (test) Ether! 21© Cryptizens.io Install Metamask wallet Note your Rinkeby account address Post your address on Google+ Paste the G+ post link in the faucet metamask.io plus.google.com faucet.rinkeby.io 1 2 3 4 => then, restart your browser!
  22. 22. And now, let’s deploy! 22© Cryptizens.io Go on Etherlearn Click on deploy Check Etherscan Interact with it 1 2 3 4 etherlearn.io etherlearn.io rinkeby.etherscan.io etherlearn.io

×