Findel: Secure Derivative Contracts for Tikhomirov Ethereum - - PowerPoint PPT Presentation

findel secure derivative contracts for
SMART_READER_LITE
LIVE PREVIEW

Findel: Secure Derivative Contracts for Tikhomirov Ethereum - - PowerPoint PPT Presentation

Findel: Ethereum Derivatives Biryukov, Khovratovich, Findel: Secure Derivative Contracts for Tikhomirov Ethereum Introduction Financial Languages Composable Contracts Ethereum Alex Biryukov Dmitry Khovratovich Our Contribution Sergei


slide-1
SLIDE 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

slide-2
SLIDE 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

slide-3
SLIDE 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

slide-4
SLIDE 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

slide-5
SLIDE 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

slide-6
SLIDE 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 $))

slide-7
SLIDE 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!

slide-8
SLIDE 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

slide-9
SLIDE 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

slide-10
SLIDE 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

slide-11
SLIDE 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

slide-12
SLIDE 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

slide-13
SLIDE 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

  • bservable value (think exchange rate)
slide-14
SLIDE 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

  • bservable value (think exchange rate)

◮ Give(c) – swap parties

slide-15
SLIDE 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

slide-16
SLIDE 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

slide-17
SLIDE 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)

slide-18
SLIDE 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

slide-19
SLIDE 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)))

slide-20
SLIDE 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))

slide-21
SLIDE 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)

slide-22
SLIDE 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

slide-23
SLIDE 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

slide-24
SLIDE 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

slide-25
SLIDE 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

1As of Jan 2017 at $10 / ether

slide-26
SLIDE 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

slide-27
SLIDE 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