Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Two upcoming smart contract languages by IOHK/ Cardano

Overview of upcoming Cardano languages Plutus and Marlowe for Smart Contract Development.

Related Books

Free with a 30 day trial from Scribd

See all
  • Be the first to comment

  • Be the first to like this

Two upcoming smart contract languages by IOHK/ Cardano

  1. 1. Smart Contracts On Cardano An IOHK Presentation In Association With Cork Blockchain Group
  2. 2. Hello Dr Gerard Moroney BEng Ph.D. Project Manager| IOHK
  3. 3. ‹#› INPUT | OUTPUT AGENDA ❖ A Primer On Smart Contracts ❖ What Are The Challenges? ❖ Cardano And Smart Contracts
  4. 4. ‹#› INPUT | OUTPUT A Primer On Smart Contracts
  5. 5. ‹#› INPUT | OUTPUT What Is A Smart Contract? • Computer programs that execute predefined actions when certain conditions within the system are met. • Provide the language of transactions that allow the ledger state to be modified. • Can facilitate the exchange and transfer of anything of value (e.g. shares, money, content, property).
  6. 6. ‹#› INPUT | OUTPUT What Is A Smart Contract? Party 1 Party 2 ------ ------ 1 2 Create Transaction Included In A Block Blockchain / Ledger Transaction Smart Contract
  7. 7. ‹#› INPUT | OUTPUT • A developing part of a nascent technology with high projected growth potential. • In addition to smart contracts between individuals, enterprise smart contracts are expected to grow • Many current blockchain-as-a-service (BaaS) platformas allow enterprises to create a variety of smart contract applications e.g. Azure Supply Chain Track & Trace
  8. 8. ‹#› INPUT | OUTPUT • Particularly beneficial for certain industries, especially those involving sensitive information or needing to follow regulation like Know Your Customer (KYC) • Smart contracts are designed and implemented within blockchains, and therefore they inherit some of the blockchain’s properties e.g. immutability, being distributed.
  9. 9. ‹#› INPUT | OUTPUT Increase Reduce • Reliability - No single entity is in control of data or money. • Trust - Business agreements are automatically executed and enforced • Fraud - Stored in blockchain & outcome is validated by everyone in that network. • Costs - Eliminating intermediaries removes additional fees • Deal Directly - Remove the need for intermediaries and allow for transparent, direct relationships with customers. • Record keeping - All contract transactions are stored in the blockchain and can be accessed with the complete audit trail.
  10. 10. ‹#› INPUT | OUTPUT A Practical Example A smart contract can perform crowdfunding actions – sharing projects, setting goals, and collecting donations; but without a third party. If funding goal not met funds reimbursed automatically
  11. 11. ‹#› INPUT | OUTPUT What Are The Challenges?
  12. 12. ‹#› INPUT | OUTPUT • One of the major concerns regarding smart contracts is security. • Poor coding and mistakes have led to several instances of multi- millionaire dollar losses • University of Pennsylvania study of 50 ICOs concluded “stark absence of any real established procedures of vetting smart contracts.” • NUS & UCL “analysed 3,759 smart contracts and determined that roughly 3.4 percent–a stunning figure when applied across an entire enterprise–were vulnerable to manipulation by bad actors to permanently lock funds, force random leaks, or kill them altogether”
  13. 13. ‹#› INPUT | OUTPUT Other Challenges • Scalability • Interoperability • Limitations and flaws in existing languages • Not considering business vertical needs • Not fun
  14. 14. ‹#› INPUT | OUTPUT Cardano & Smart Contracts
  15. 15. ‹#› INPUT | OUTPUT o Single Blockchain Cardano Settlement Layer (SL) o One sidechain implementation o UTxO-style accounting each end o Multiple Native Assets (not just ADA) o Restricted Plutus Core o Basic bitcoin style validator/redeemer style blockchain/script interaction o Multiple Blockchain Cardano Computational Layer (CL) o Hybrid leger also need account style accounting (for interaction with EVM style programs) o Multiple Assets o Managed like ADA in UTxO or hybrid (UTxO/Accounts) o Can be created on SL & costs will be covered by fees o ERC20 token can be backed by a native asset Design | Overview
  16. 16. ‹#› INPUT | OUTPUT Design | Schematic Settlement Layer Computational Layer UTXO Multi-Assets Plutus Core UTXO Multi-Assets Plutus Core UTxO/Accounts Hybrid Ledger Multi-Assets K-EVM UTxO/Accounts Hybrid Ledger Multi-Assets IELE • Existing platform no multi-assets or Core? • Code in Haskell • Sidechains UTxO <> UTxO transformation Sidechain
  17. 17. ‹#› INPUT | OUTPUT Architecture | SL & CLVirtual Machine Main Design Features Target K-EVM ❖ Using hybrid UTxO/accounts ledger ❖ Only ADA; no other labelled native currencies for EVM compatibility; ❖ Running K-EVM ❖ EVM style blockchain/script interaction Legacy EVM scripts and languages IELE ❖ Using hybrid UTxO/accounts ledger; ❖ With multiple labelled assets, not just Ada ❖ Running IELE ❖ IELE extensions to work with native currencies ❖ EVM style blockchain/script interaction Legacy EVM languages and extensions, and Plutus Plutus / Marlowe ❖ Using UTxO ledger ❖ Extended UTxO-style blockchain/script interaction ❖ With multiple native currencies, not just ADA; ❖ With Plutus core, full gas model Plutus and Marlowe All CL’s running the main Cardano SL Haskell code & sidechain implementation (sidechain-side) Design | Virtual Machines
  18. 18. ‹#› INPUT | OUTPUT Design | Co-Ordination
  19. 19. ‹#› INPUT | OUTPUT Language & VM | K-EVM, IELE Hackers have huge incentives to exploit flaws in smart contracts and underlying infrastructure (financial gain, irreversible) What can we do about the execution environment to increase security? Everything must be rigorously designed • Nodes: provably correct VMs or interpreters • Smart Contracts: use well-designed programming languages, with provably correct compilers or interpreters • Verification: Smart contracts provably correct with regards specifications
  20. 20. ‹#› INPUT | OUTPUT Language & VM | K-EVM, IELE Deductive program verifierParser Interpreter Compiler (semantic) Debugger Symbolic execution Model checker Formal Language Definition (Syntax and Semantics) … Ideal Language Framework Offering to address this by Grigore Rosu and Runtime Verification Inc. was the K- framework
  21. 21. ‹#› INPUT | OUTPUT Language & VM | K-EVM, IELE “Deliver IELE Virtual Machine (VM) for CL and associated translators to allow users to define smart contracts in high level languages (all using K-framework)”
  22. 22. ‹#› INPUT | OUTPUT Language & VM | K-EVM, IELE • KEVM - Semantics of the Ethereum Virtual Machine (EVM) in K • Run your Solidity contracts just like EVM • VM completed and available as IOHK testnet at Has Faucet, CLI ; web-based IDE pending • Will be integrated into Cardano • Try it out! Done
  23. 23. ‹#› INPUT | OUTPUT Language & VM | K-EVM, IELE • Provides better performance and is register-based. More accurate gas cost predictions, as well as lower gas cost for contracts. • Designed & implemented using formal methods & semantics • Run your Solidity contracts just like EVM (some will fail intentionally!) • Available as testnet with web-based IDE • Translators for Plutus under development; more planned. What language would you like? • Try it out & let us know your feedback! Done
  24. 24. ‹#› INPUT | OUTPUT Language & VM | K-EVM, IELE • IDE Plugins For IELE and additional training materials (community- driven) • Semantics Based Compilation (SBC) • Surface Languages • Performance Improvement • Expanded Tools For Provability
  25. 25. ‹#› INPUT | OUTPUT Language & VM | Plutus “Programming model for smart contracts & decentralised apps” 1. Convenience For App Developers (Full Stack) 2. Superior Safety & Security 3. Integrates With Cardano UTxO Ledger
  26. 26. ‹#› INPUT | OUTPUT Language & VM | Plutus Safe & Secure • Functional Programming (Clean Semantics) • Plutus Core: Foundation for code safety & security Integration With Cardano • Bring scripting power of account-based model to UTxO • Elegant, Simple Full Stack • Template Haskell
  27. 27. ‹#› INPUT | OUTPUT Language & VM | Plutus + Full Stack
  28. 28. ‹#› INPUT | OUTPUT Language & VM | Plutus Co-ordination (Off-Chain) Transaction (On-Chain) Two-level (Staged) Programming Model Haskell Plutus Tx
  29. 29. ‹#› INPUT | OUTPUT Language & VM | Plutus Co-ordination (Off-Chain) Transaction (On-Chain) Haskell Plutus Tx Javascript (Wallet) Plutus Core (Cardano) GHCJS Plutus Compiler Template Haskell
  30. 30. ‹#› INPUT | OUTPUT Language & VM | Plutus An Example Payment into a crowd funding campaign until a payment deadline • If funding goal reached, campaign owner can collect funds • If funding goal not reached, refunds can be obtained by contributors • If campaign owner does not collect by collection deadline, contributors can also obtain refunds Smart contracts for non-developers! We expect to be able to generate many of these scripts with Marlowe ….
  31. 31. ‹#› INPUT | OUTPUT Language | Marlowe • Special purpose language (financial contracts) • Links core technology with things we need to do smart contracts
  32. 32. ‹#› INPUT | OUTPUT Language | Marlowe • Special purpose language (financial contracts) • DSL (Domain Specific Language) as a Haskell data type • Observations and Questions • Deliverables Include: • Financial Domain Specific Language (DSL) on the blockchain • Tools to support the DSL, e.g. simulation, verification (Meadow)
  33. 33. ‹#› INPUT | OUTPUT Language | Marlowe • Interaction with outside world • Recording of commitments, random observations etc. • Special considerations for commitments
  34. 34. ‹#› INPUT | OUTPUT Language | Marlowe
  35. 35. ‹#› INPUT | OUTPUT Language | Marlowe CommitCash com1 alice ada100 10 200 (CommitCash com2 bob ada20 20 200 (When (PersonChoseSomething choice1 alice) 100 (Both (RedeemCC com1 Null) (RedeemCC com2 Null)) (Pay pay1 bob alice ada20 200 (Both (RedeemCC com1 Null) (RedeemCC com2 Null)))) (RedeemCC com1 Null)) Null
  36. 36. ‹#› INPUT | OUTPUT Language | Marlowe • In-browser implementation: Haskell Semantics, compiled to Javascript • Two forms of interaction: 1. Choose from arbitrary actions 2. Choose applicable actions (smart interface) • Embedded editor for Marlowe / Haskell scripts • Adapted open source project Meadow: Implementation In Blocky
  37. 37. ‹#› INPUT | OUTPUT ❖ 28TH May 2018 – KEVM testnet ❖ 30TH July 2018 – IELE testnet (same location) ❖ 13-14 September 2018 – Upbit Developer Conference 2018 ❖ 11 December 2018 - PlutusFest ❖ Plutus, Marlowe & other testnets to follow in 2018/2019 …. Important Dates (So Far!)
  38. 38. ‹#› INPUT | OUTPUT ❖ See the code ❖ Telegram ❖ Plans at ❖ YouTube updates at ❖ E-mail me ❖ Try technology Want To Know More?
  39. 39. Thank you IOHK.IO You have been watching an IOHK presentation.