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.

Findel: Secure Derivative Contracts for Ethereum

256 views

Published on

Presented at WTSC (April 2017): http://fc17.ifca.ai/wtsc/

Video: https://youtu.be/D4sa9U2HXMQ
Paper: http://orbilu.uni.lu/handle/10993/30975

Published in: Software
  • Be the first to comment

Findel: Secure Derivative Contracts for Ethereum

  1. 1. Findel: Ethereum Derivatives Biryukov, Khovratovich, Tikhomirov Introduction Financial Languages Composable Contracts Ethereum Our Contribution Findel DSL Examples Gateways Conclusion 1/18 Findel: Secure Derivative Contracts for Ethereum Alex Biryukov Dmitry Khovratovich Sergei Tikhomirov 1st Workshop on Trusted Smart Contracts In Association with Financial Cryptography 17 7 April 2017, Malta
  2. 2. Findel: Ethereum Derivatives Biryukov, Khovratovich, Tikhomirov Introduction Financial Languages Composable Contracts Ethereum Our Contribution Findel DSL Examples Gateways Conclusion 2/18 ... and Smart Contract Developer Adapted from xkcd.com/1428
  3. 3. Findel: Ethereum Derivatives Biryukov, Khovratovich, Tikhomirov Introduction Financial Languages Composable Contracts Ethereum Our Contribution Findel DSL Examples Gateways Conclusion 3/18 Contract Programming is Different ”Move fast and break things”: unacceptable! Real money (property, resources) at stake Side-effects often cause trouble (The DAO) We need a formally verifiable contract language
  4. 4. Findel: Ethereum Derivatives Biryukov, Khovratovich, Tikhomirov Introduction Financial Languages Composable Contracts Ethereum Our Contribution Findel DSL Examples Gateways Conclusion 4/18 A Secure Financial DSL Helps Avoid misinterpretation Standardize templates Prove correctness Facilitate automated processing
  5. 5. Findel: Ethereum Derivatives Biryukov, Khovratovich, Tikhomirov Introduction Financial Languages Composable Contracts Ethereum Our Contribution Findel DSL Examples Gateways Conclusion 5/18 Composable Contracts [Peyton Jones et al. 2003] Ten primitives to compose complex agreements Declarative paradigm Implemented as an embedded DSL in Haskell
  6. 6. Findel: Ethereum Derivatives Biryukov, Khovratovich, Tikhomirov Introduction Financial Languages Composable Contracts Ethereum Our Contribution Findel DSL Examples Gateways Conclusion 5/18 Composable Contracts [Peyton Jones et al. 2003] Ten primitives to compose complex agreements Declarative paradigm Implemented as an embedded DSL in Haskell Example: zero-coupon bond when (at 2018-01-01) (scale (konst 100)) (one $))
  7. 7. Findel: Ethereum Derivatives Biryukov, Khovratovich, Tikhomirov Introduction Financial Languages Composable Contracts Ethereum Our Contribution Findel DSL Examples Gateways Conclusion 6/18 Ethereum Turing-complete virtual machine Key feature: trustless execution Perfect match for financial agreements!
  8. 8. Findel: Ethereum Derivatives Biryukov, Khovratovich, Tikhomirov Introduction Financial Languages Composable Contracts Ethereum Our Contribution Findel DSL Examples Gateways Conclusion 7/18 Ethereum Meets Composable Contracts Map declarative DSL to blockchain execution paradigm Retrieve and validate external data Ensure that execution cost is bearable
  9. 9. Findel: Ethereum Derivatives Biryukov, Khovratovich, Tikhomirov Introduction Financial Languages Composable Contracts Ethereum Our Contribution Findel DSL Examples Gateways Conclusion 8/18 Financial Derivatives Language (Findel) Contract: agreement between issuer and owner Contract description defines rights and obligations Description is a tree of primitives Description and issuer are immutable Ownership may be transferred Smart contract acts as execution environment
  10. 10. Findel: Ethereum Derivatives Biryukov, Khovratovich, Tikhomirov Introduction Financial Languages Composable Contracts Ethereum Our Contribution Findel DSL Examples Gateways Conclusion 9/18 Findel Primitives 1/2 Zero – do nothing
  11. 11. Findel: Ethereum Derivatives Biryukov, Khovratovich, Tikhomirov Introduction Financial Languages Composable Contracts Ethereum Our Contribution Findel DSL Examples Gateways Conclusion 9/18 Findel Primitives 1/2 Zero – do nothing One – transfer 1 unit of currency from issuer to owner
  12. 12. Findel: Ethereum Derivatives Biryukov, Khovratovich, Tikhomirov Introduction Financial Languages Composable Contracts Ethereum Our Contribution Findel DSL Examples Gateways Conclusion 9/18 Findel Primitives 1/2 Zero – do nothing One – transfer 1 unit of currency from issuer to owner Scale(k, c) – multiply all payments by a constant value
  13. 13. Findel: Ethereum Derivatives Biryukov, Khovratovich, Tikhomirov Introduction Financial Languages Composable Contracts Ethereum Our Contribution Findel DSL Examples Gateways Conclusion 9/18 Findel Primitives 1/2 Zero – do nothing One – transfer 1 unit of currency from issuer to owner Scale(k, c) – multiply all payments by a constant value ScaleObs(obs, c) – multiply all payments by an observable value (think exchange rate)
  14. 14. Findel: Ethereum Derivatives Biryukov, Khovratovich, Tikhomirov Introduction Financial Languages Composable Contracts Ethereum Our Contribution Findel DSL Examples Gateways Conclusion 9/18 Findel Primitives 1/2 Zero – do nothing One – transfer 1 unit of currency from issuer to owner Scale(k, c) – multiply all payments by a constant value ScaleObs(obs, c) – multiply all payments by an observable value (think exchange rate) Give(c) – swap parties
  15. 15. Findel: Ethereum Derivatives Biryukov, Khovratovich, Tikhomirov Introduction Financial Languages Composable Contracts Ethereum Our Contribution Findel DSL Examples Gateways Conclusion 10/18 Findel Primitives 2/2 And(c1, c2) – execute both sub-contracts
  16. 16. Findel: Ethereum Derivatives Biryukov, Khovratovich, Tikhomirov Introduction Financial Languages Composable Contracts Ethereum Our Contribution Findel DSL Examples Gateways Conclusion 10/18 Findel Primitives 2/2 And(c1, c2) – execute both sub-contracts Or(c1, c2) – owner chooses which sub-contract to execute
  17. 17. Findel: Ethereum Derivatives Biryukov, Khovratovich, Tikhomirov Introduction Financial Languages Composable Contracts Ethereum Our Contribution Findel DSL Examples Gateways Conclusion 10/18 Findel Primitives 2/2 And(c1, c2) – execute both sub-contracts Or(c1, c2) – owner chooses which sub-contract to execute If (obs, c1, c2) – execute one of sub-contracts (depending on observable)
  18. 18. Findel: Ethereum Derivatives Biryukov, Khovratovich, Tikhomirov Introduction Financial Languages Composable Contracts Ethereum Our Contribution Findel DSL Examples Gateways Conclusion 10/18 Findel Primitives 2/2 And(c1, c2) – execute both sub-contracts Or(c1, c2) – owner chooses which sub-contract to execute If (obs, c1, c2) – execute one of sub-contracts (depending on observable) Timebound(t0, t1, c) – execute c, if within time bounds
  19. 19. Findel: Ethereum Derivatives Biryukov, Khovratovich, Tikhomirov Introduction Financial Languages Composable Contracts Ethereum Our Contribution Findel DSL Examples Gateways Conclusion 11/18 Example 1/3: Currency Exchange And(Give(One(EUR)), ScaleObs(exchAddr, One(USD)))
  20. 20. Findel: Ethereum Derivatives Biryukov, Khovratovich, Tikhomirov Introduction Financial Languages Composable Contracts Ethereum Our Contribution Findel DSL Examples Gateways Conclusion 12/18 Example 2/3: European Option Timebound(t0 − δ, t0 + δ, Or(One(EUR), Zero))
  21. 21. Findel: Ethereum Derivatives Biryukov, Khovratovich, Tikhomirov Introduction Financial Languages Composable Contracts Ethereum Our Contribution Findel DSL Examples Gateways Conclusion 13/18 Example 3/3: Binary Option If (orclAddr, Scale(10, One(USD)), Zero)
  22. 22. Findel: Ethereum Derivatives Biryukov, Khovratovich, Tikhomirov Introduction Financial Languages Composable Contracts Ethereum Our Contribution Findel DSL Examples Gateways Conclusion 14/18 External Data Problem Contracts require external data Ethereum is isolated from broader Internet
  23. 23. Findel: Ethereum Derivatives Biryukov, Khovratovich, Tikhomirov Introduction Financial Languages Composable Contracts Ethereum Our Contribution Findel DSL Examples Gateways Conclusion 14/18 External Data Problem Contracts require external data Ethereum is isolated from broader Internet Our solution: gateways
  24. 24. Findel: Ethereum Derivatives Biryukov, Khovratovich, Tikhomirov Introduction Financial Languages Composable Contracts Ethereum Our Contribution Findel DSL Examples Gateways Conclusion 15/18 Gateways Smart contract pulls and stores external data with timestamp Optional proof of authenticity (e.g., signature under known public key) Findel marketplace queries gateway when needed Parties are responsible for updating gateways
  25. 25. Findel: Ethereum Derivatives Biryukov, Khovratovich, Tikhomirov Introduction Financial Languages Composable Contracts Ethereum Our Contribution Findel DSL Examples Gateways Conclusion 16/18 What Is Done Defined a declarative DSL suited for blockchain Implemented a marketplace smart contract in Solidity Assessed cost of operation (∼ $0.1 per avg operation)1 1 As of Jan 2017 at $10 / ether
  26. 26. Findel: Ethereum Derivatives Biryukov, Khovratovich, Tikhomirov Introduction Financial Languages Composable Contracts Ethereum Our Contribution Findel DSL Examples Gateways Conclusion 17/18 Future Work Enforcement: deal with users defaulting on debt Model balances using ERC20 Token Extend model to support multi-party contracts Look into valuation and verification
  27. 27. Findel: Ethereum Derivatives Biryukov, Khovratovich, Tikhomirov Introduction Financial Languages Composable Contracts Ethereum Our Contribution Findel DSL Examples Gateways Conclusion 18/18 Questions? cryptolux.org @serg tikhomirov sergei.tikhomirov@uni.lu

×