Two upcoming smart contract languages by IOHK/ Cardano

J
Johannes AhlmannCTO at Claru.io
Smart Contracts On Cardano
An IOHK Presentation In Association With Cork Blockchain Group
Hello
Dr Gerard Moroney BEng Ph.D.
Project Manager| IOHK
gerard.moroney@iohk.io
‹#›
INPUT | OUTPUT
AGENDA
❖ A Primer On Smart Contracts
❖ What Are The Challenges?
❖ Cardano And Smart Contracts
‹#›
INPUT | OUTPUT
A Primer On Smart Contracts
‹#›
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).
‹#›
INPUT | OUTPUT
What Is A Smart
Contract?
Party
1
Party
2
------
------
1
2
Create Transaction
Included In A Block
Blockchain / Ledger
Transaction
Smart Contract
‹#›
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
https://azure.microsoft.com/en-us/solutions/blockchain/
‹#›
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.
‹#›
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.
‹#›
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
‹#›
INPUT | OUTPUT
What Are The Challenges?
‹#›
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”
‹#›
INPUT | OUTPUT
Other Challenges
• Scalability
• Interoperability
• Limitations and flaws in existing languages
• Not considering business vertical needs
• Not fun
‹#›
INPUT | OUTPUT
Cardano & Smart Contracts
‹#›
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
‹#›
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
‹#›
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
‹#›
INPUT | OUTPUT
Design | Co-Ordination
‹#›
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
‹#›
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
‹#›
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)”
‹#›
INPUT | OUTPUT
Language & VM | K-EVM, IELE
• KEVM - Semantics of the Ethereum Virtual Machine (EVM) in K
https://github.com/kframework/evm-semantics
• Run your Solidity contracts just like EVM
• VM completed and available as IOHK testnet at
http://testnet.iohkdev.io/kevm/ Has Faucet, CLI ; web-based IDE
pending
• Will be integrated into Cardano
• Try it out!
Done
‹#›
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 http://testnet.iohkdev.io/kevm/ 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
‹#›
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
‹#›
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
‹#›
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
‹#›
INPUT | OUTPUT
Language & VM | Plutus
+
Full Stack
‹#›
INPUT | OUTPUT
Language & VM | Plutus
Co-ordination
(Off-Chain)
Transaction
(On-Chain)
Two-level (Staged)
Programming Model
Haskell
Plutus Tx
‹#›
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
‹#›
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 ….
‹#›
INPUT | OUTPUT
Language | Marlowe
• Special purpose language
(financial contracts)
• Links core technology
with things we need to
do smart contracts
‹#›
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)
‹#›
INPUT | OUTPUT
Language | Marlowe
• Interaction with outside world
• Recording of commitments,
random observations etc.
• Special considerations for
commitments
‹#›
INPUT | OUTPUT
Language | Marlowe
‹#›
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
‹#›
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
https://input-output-hk.github.io/scdsl/
Meadow: Implementation In Blocky
‹#›
INPUT | OUTPUT
❖ 28TH May 2018 – KEVM testnet https://testnet.iohkdev.io/
❖ 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!)
‹#›
INPUT | OUTPUT
❖ See the code https://github.com/input-output-hk
❖ Telegram https://t.me/cardanodevelopersofficial
❖ Plans at https://cardanoroadmap.com/
❖ YouTube updates at https://goo.gl/CMpfnP
❖ E-mail me gerard.moroney@iohk.io
❖ Try technology https://testnet.iohkdev.io
Want To Know More?
Thank you
IOHK.IO
info@iohk.io
You have been watching an IOHK presentation.
1 of 39

Recommended

Not So Anonymous - Deanonymization of Blockchain Users by
Not So Anonymous - Deanonymization of Blockchain UsersNot So Anonymous - Deanonymization of Blockchain Users
Not So Anonymous - Deanonymization of Blockchain UsersJohannes Ahlmann
517 views20 slides
Not So Anonymous - Deanonymization of Blockchain Users by
Not So Anonymous - Deanonymization of Blockchain UsersNot So Anonymous - Deanonymization of Blockchain Users
Not So Anonymous - Deanonymization of Blockchain UsersJohannes Ahlmann
274 views15 slides
Practical Challenges for Public Blockchains by
Practical Challenges for Public BlockchainsPractical Challenges for Public Blockchains
Practical Challenges for Public BlockchainsJohannes Ahlmann
53 views10 slides
Overview of Blockchain Consensus Mechanisms by
Overview of Blockchain Consensus MechanismsOverview of Blockchain Consensus Mechanisms
Overview of Blockchain Consensus MechanismsJohannes Ahlmann
1.5K views17 slides
Practical Challenges for Public Blockchains by
Practical Challenges for Public BlockchainsPractical Challenges for Public Blockchains
Practical Challenges for Public BlockchainsJohannes Ahlmann
64 views10 slides
Food Traceability using Blockchain by
Food Traceability using BlockchainFood Traceability using Blockchain
Food Traceability using BlockchainJohannes Ahlmann
1.4K views14 slides

More Related Content

Recently uploaded

Setting Up Your First CloudStack Environment with Beginners Challenges - MD R... by
Setting Up Your First CloudStack Environment with Beginners Challenges - MD R...Setting Up Your First CloudStack Environment with Beginners Challenges - MD R...
Setting Up Your First CloudStack Environment with Beginners Challenges - MD R...ShapeBlue
54 views15 slides
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue by
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlueWhat’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlueShapeBlue
131 views23 slides
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava... by
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...ShapeBlue
48 views17 slides
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive by
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveAutomating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveNetwork Automation Forum
46 views35 slides
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ... by
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...ShapeBlue
65 views28 slides
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda... by
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...ShapeBlue
63 views13 slides

Recently uploaded(20)

Setting Up Your First CloudStack Environment with Beginners Challenges - MD R... by ShapeBlue
Setting Up Your First CloudStack Environment with Beginners Challenges - MD R...Setting Up Your First CloudStack Environment with Beginners Challenges - MD R...
Setting Up Your First CloudStack Environment with Beginners Challenges - MD R...
ShapeBlue54 views
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue by ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlueWhat’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
ShapeBlue131 views
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava... by ShapeBlue
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...
ShapeBlue48 views
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive by Network Automation Forum
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveAutomating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ... by ShapeBlue
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...
ShapeBlue65 views
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda... by ShapeBlue
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
ShapeBlue63 views
DRBD Deep Dive - Philipp Reisner - LINBIT by ShapeBlue
DRBD Deep Dive - Philipp Reisner - LINBITDRBD Deep Dive - Philipp Reisner - LINBIT
DRBD Deep Dive - Philipp Reisner - LINBIT
ShapeBlue62 views
Why and How CloudStack at weSystems - Stephan Bienek - weSystems by ShapeBlue
Why and How CloudStack at weSystems - Stephan Bienek - weSystemsWhy and How CloudStack at weSystems - Stephan Bienek - weSystems
Why and How CloudStack at weSystems - Stephan Bienek - weSystems
ShapeBlue111 views
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ... by ShapeBlue
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...
ShapeBlue77 views
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P... by ShapeBlue
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...
ShapeBlue82 views
Data Integrity for Banking and Financial Services by Precisely
Data Integrity for Banking and Financial ServicesData Integrity for Banking and Financial Services
Data Integrity for Banking and Financial Services
Precisely56 views
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue by ShapeBlue
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlueVNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue
ShapeBlue85 views
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De... by Moses Kemibaro
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...
Moses Kemibaro29 views
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue by ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
ShapeBlue50 views
State of the Union - Rohit Yadav - Apache CloudStack by ShapeBlue
State of the Union - Rohit Yadav - Apache CloudStackState of the Union - Rohit Yadav - Apache CloudStack
State of the Union - Rohit Yadav - Apache CloudStack
ShapeBlue145 views
Business Analyst Series 2023 - Week 4 Session 7 by DianaGray10
Business Analyst Series 2023 -  Week 4 Session 7Business Analyst Series 2023 -  Week 4 Session 7
Business Analyst Series 2023 - Week 4 Session 7
DianaGray1080 views
HTTP headers that make your website go faster - devs.gent November 2023 by Thijs Feryn
HTTP headers that make your website go faster - devs.gent November 2023HTTP headers that make your website go faster - devs.gent November 2023
HTTP headers that make your website go faster - devs.gent November 2023
Thijs Feryn28 views

Featured

Getting into the tech field. what next by
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
6K views22 slides
Google's Just Not That Into You: Understanding Core Updates & Search Intent by
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
6.5K views99 slides
How to have difficult conversations by
How to have difficult conversations How to have difficult conversations
How to have difficult conversations Rajiv Jayarajah, MAppComm, ACC
5.2K views19 slides
Introduction to Data Science by
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data ScienceChristy Abraham Joy
82.4K views51 slides
Time Management & Productivity - Best Practices by
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
169.7K views42 slides
The six step guide to practical project management by
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
36.6K views27 slides

Featured(20)

Getting into the tech field. what next by Tessa Mero
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero6K views
Google's Just Not That Into You: Understanding Core Updates & Search Intent by Lily Ray
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray6.5K views
Time Management & Productivity - Best Practices by Vit Horky
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky169.7K views
The six step guide to practical project management by MindGenius
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius36.6K views
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright... by RachelPearson36
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson3612.7K views
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present... by Applitools
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools55.5K views
12 Ways to Increase Your Influence at Work by GetSmarter
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter401.7K views
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G... by DevGAMM Conference
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
DevGAMM Conference3.6K views
Barbie - Brand Strategy Presentation by Erica Santiago
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
Erica Santiago25.1K views
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well by Saba Software
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Saba Software25.2K views
Introduction to C Programming Language by Simplilearn
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
Simplilearn8.4K views
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr... by Palo Alto Software
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...
Palo Alto Software88.4K views
9 Tips for a Work-free Vacation by Weekdone.com
9 Tips for a Work-free Vacation9 Tips for a Work-free Vacation
9 Tips for a Work-free Vacation
Weekdone.com7.2K views
How to Map Your Future by SlideShop.com
How to Map Your FutureHow to Map Your Future
How to Map Your Future
SlideShop.com275.1K views
Beyond Pride: Making Digital Marketing & SEO Authentically LGBTQ+ Inclusive -... by AccuraCast
Beyond Pride: Making Digital Marketing & SEO Authentically LGBTQ+ Inclusive -...Beyond Pride: Making Digital Marketing & SEO Authentically LGBTQ+ Inclusive -...
Beyond Pride: Making Digital Marketing & SEO Authentically LGBTQ+ Inclusive -...
AccuraCast3.4K views

Two upcoming smart contract languages by IOHK/ Cardano

  • 1. Smart Contracts On Cardano An IOHK Presentation In Association With Cork Blockchain Group
  • 2. Hello Dr Gerard Moroney BEng Ph.D. Project Manager| IOHK gerard.moroney@iohk.io
  • 3. ‹#› INPUT | OUTPUT AGENDA ❖ A Primer On Smart Contracts ❖ What Are The Challenges? ❖ Cardano And Smart Contracts
  • 4. ‹#› INPUT | OUTPUT A Primer On Smart Contracts
  • 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. ‹#› 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. ‹#› 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 https://azure.microsoft.com/en-us/solutions/blockchain/
  • 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. ‹#› 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. ‹#› 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. ‹#› INPUT | OUTPUT What Are The Challenges?
  • 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. ‹#› INPUT | OUTPUT Other Challenges • Scalability • Interoperability • Limitations and flaws in existing languages • Not considering business vertical needs • Not fun
  • 14. ‹#› INPUT | OUTPUT Cardano & Smart Contracts
  • 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. ‹#› 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. ‹#› 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. ‹#› INPUT | OUTPUT Design | Co-Ordination
  • 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. ‹#› 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. ‹#› 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. ‹#› INPUT | OUTPUT Language & VM | K-EVM, IELE • KEVM - Semantics of the Ethereum Virtual Machine (EVM) in K https://github.com/kframework/evm-semantics • Run your Solidity contracts just like EVM • VM completed and available as IOHK testnet at http://testnet.iohkdev.io/kevm/ Has Faucet, CLI ; web-based IDE pending • Will be integrated into Cardano • Try it out! Done
  • 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 http://testnet.iohkdev.io/kevm/ 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. ‹#› 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. ‹#› 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. ‹#› 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. ‹#› INPUT | OUTPUT Language & VM | Plutus + Full Stack
  • 28. ‹#› INPUT | OUTPUT Language & VM | Plutus Co-ordination (Off-Chain) Transaction (On-Chain) Two-level (Staged) Programming Model Haskell Plutus Tx
  • 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. ‹#› 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. ‹#› INPUT | OUTPUT Language | Marlowe • Special purpose language (financial contracts) • Links core technology with things we need to do smart contracts
  • 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. ‹#› INPUT | OUTPUT Language | Marlowe • Interaction with outside world • Recording of commitments, random observations etc. • Special considerations for commitments
  • 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. ‹#› 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 https://input-output-hk.github.io/scdsl/ Meadow: Implementation In Blocky
  • 37. ‹#› INPUT | OUTPUT ❖ 28TH May 2018 – KEVM testnet https://testnet.iohkdev.io/ ❖ 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. ‹#› INPUT | OUTPUT ❖ See the code https://github.com/input-output-hk ❖ Telegram https://t.me/cardanodevelopersofficial ❖ Plans at https://cardanoroadmap.com/ ❖ YouTube updates at https://goo.gl/CMpfnP ❖ E-mail me gerard.moroney@iohk.io ❖ Try technology https://testnet.iohkdev.io Want To Know More?
  • 39. Thank you IOHK.IO info@iohk.io You have been watching an IOHK presentation.