Smart contracts Definition, applications, and impact November 14 th - - PowerPoint PPT Presentation

smart contracts
SMART_READER_LITE
LIVE PREVIEW

Smart contracts Definition, applications, and impact November 14 th - - PowerPoint PPT Presentation

CONFIDENTIAL Smart contracts Definition, applications, and impact November 14 th Brussels, Finance Watch Workshop 2017 CONFIDENTIAL Distributed Systems: challenges Network of U S E R actors following instructions connections for


slide-1
SLIDE 1

CONFIDENTIAL

Smart contracts

Definition, applications, and impact November 14th Brussels, Finance Watch Workshop 2017

slide-2
SLIDE 2

CONFIDENTIAL

Distributed Systems: challenges

2 Footnotes

  • Network of
  • actors following instructions
  • connections for sending and

receiving messages

  • to collectively offer
  • coherent service to users
  • Nodes may be reliable (following

instructions) or unreliable (nonresponsive, crashing, faulty/lying)

  • Connections may be reliable or

unreliable (failing, arbitrarily slow)

D I S T R I B U T E D S Y S T E M U S E R

slide-3
SLIDE 3

CONFIDENTIAL

Distributed system properties and CAP Theorem

3

  • Consistency: Clients get same response, independent of node accessed
  • Availability: All clients get a response eventually (fast enough)
  • Partition tolerance: All accessible nodes respond, even when internal communication is

impossible (slow) Consistency, Availability and Partition tolerance Theorem:

  • Assume: All compute nodes reliable; network connections unreliable
  • Cannot simultaneously have
  • Consistency:

Every node gives the same answer.

  • Availability:

Every node gives an answer eventually.

  • Partition tolerance: The system tolerates network partitions.
  • Inherent trade-off:
  • More consistency, less availability or less partition tolerance
  • More availability, less consistency or less partition tolerance
  • More partition tolerance, less consistency or less availability

Footnotes

DRAFT FOR REVIEW

slide-4
SLIDE 4

CONFIDENTIAL

Classification of Blockchain / Distributed Ledger Technology

4

  • Blockchain and distributed ledger technology (DLT) are classified by two

features:

  • Permissioned DLT or permissionless blockchain
  • Public blockchains or private/privacy keeping DLT
  • Public blockchain such as bitcoin or Ethereum have the following features:
  • Every body can participate without any access restrictions
  • Everybody has a full copy of all transactions or program code
  • No data stays private or privacy is kept
  • Cryptographically signed
  • All data is saved in the log append principle, i.e. data is only added but not erased
  • The central mechanism for consistency is organizing it into timestamp blocks
  • The mechanism for trustless verification is the consensus method
  • Footnotes
slide-5
SLIDE 5

CONFIDENTIAL

How does Bitcoin Blockchain work?

5

  • Anybody can run a bitcoin node: No authentication, permionless
  • Each node stores complete blockchain
  • Event: Payment (“A transfers n bitcoins to B”)
  • P2P communication: Gossip — tell all your neighbors about a new block
  • Protocol: No double spending; only owner can transfer
  • Authentication: public key cryptography (digital signature)
  • Consensus: Nakamoto — block giving longest chain is ``the’’ updated blockchain
  • Block validation: Check that block hash is correct and that protocol is obeyed — easy!
  • Block generation: Find nonce such that hash has n leading zeros — hard! Get money for it.

Footnotes

slide-6
SLIDE 6

CONFIDENTIAL

How does Ethereum work?

6

  • Ethereum is public blockchain similar to bitcoin network
  • Ethereum nodes all run a computer (called Ethereum virtual machine (EVM) similar to

the Java virtual machine)

  • Ethereum has programming language called solidity to code “smart contracts” /

programs which describe the business transaction between parties (nodes on the network)

  • Ethereum uses a blockchain to validate, update and execute the code by the same

mechanism as in blockchain:

  • Every node has the same distributed ledger, i.e. has full history of all transactions (of

code)

  • A consensus protocol validates the tranactions
  • A mining mechanism incl. currencies incentives the nodes to perform the validations
  • Smart contracts “consume” ethers/gas the ledgers internal currencies
  • Ethereum is basically a distributed computer with public distributed ledger

Footnotes

DRAFT FOR REVIEW

slide-7
SLIDE 7

CONFIDENTIAL

How does a DLT like Fabric or Corda work?

7

  • Recording and managing the evolution of agreements and between two or more identifiable parties in

a way that is grounded in existing legal constructs and compatible with existing and emerging regulation

  • Choreographing workflow between firms without a central controller
  • Supporting consensus between firms at the level of individual deals, not a global system
  • Supporting the inclusion of regulatory and supervisory observer nodes
  • Validating transactions solely between parties to the transaction.
  • Supporting a variety of consensus mechanisms.
  • Restricting access to the data within an agreement to only those explicitly entitled or logically

privileged to it.

  • There is no blockchain!
  • Corda and Fabric both possess an turing complete programming language
  • Corda has a (reduced) Java virtual machine to execute the Kotlin code of corda
  • Both are released as open source under Hyperledger (Linux foundation chapter)
  • Both are developed by commercial companies (Fabric= IBM, Corda=R3CEV)
  • Needs some trust in the network participants.
  • Small networks (few nodes, 1-2 notaries) are very similar to databases with no double spend

Footnotes

DRAFT FOR REVIEW

slide-8
SLIDE 8

CONFIDENTIAL

DLT like Corda/Fabric

8 Footnotes

DRAFT FOR REVIEW

JVM Code Syncroni sation rules Local SQL data base JVM Code Syncroni sation rules Local SQL data base JVM Code Syncroni sation rules Local SQL data base JVM Code Syncroni sation rules Local SQL data base JVM Code Syncroni sation rules Local SQL data base

Notary Node 4 Node 2 Node 3 Node 1 Contract 1 Contract 1 Contract 1 Contract 1 Contract 2 Contract 2 Contract 2 Contract 2 Contract 3 Contract 3 Contract 3 Contract 3 Contract 4 Contract 4 Contract 4 Contract 4

slide-9
SLIDE 9

CONFIDENTIAL

Smart contracts are neither!

9

  • Smart contract = “self-executing” contract
  • The notion on smart contract is generally understood as self-execution contract or

automation of contract execution

  • The terms was already coined by Nick Szabo in 1994
  • No proper definition exists and this term is mostly used for code in Ethereum or DLTs
  • Smart contract = program:
  • Has the data included and the execution logic
  • Implicit contract plus coded joint strategy for executing it
  • No separation of protocol (specification) and execution
  • Receives messages (responds to events)
  • Sends messages (generates events)
  • Cannot be stopped (!)
  • Popular blockchain/DLT systems written general purpose programming (turning complete)

such as Java and derivatives

  • All issues and risk of normal computer networks exists

Footnotes

slide-10
SLIDE 10

CONFIDENTIAL

Smart contracts are executed on virtual machines which brings in great risk

10

  • Blockchains (BC) such as Ethereum and some DLTs are virtual computers

which run virtual machine

  • There huge programming language risk due the vulnerability of the Virtual

Machines (EVM/JVM)

  • Exception handling (deliberate crashing)
  • Default methods (multi sig exploit)
  • Reentrancy (TheDao hack)
  • Programs are written in Turing complete programming languages:
  • Expressive
  • Unpredictable even with full access to the source code (Rice, 1953)
  • Cannot be formally verified
  • Time-stamp dependence: Who controls the clock?

Footnotes

slide-11
SLIDE 11

CONFIDENTIAL

What Contract (protocols)

11

  • A good contract model is a protocol which specifies obligatory,

permissible or prohibited actions/events by parties

  • Passive protocol of sequence of events which represents the actions of parties
  • An event is digital representation of real world action, transaction, etc.
  • Protocol is state machine which reacts to events changes its states
  • The change of the state, i.e. is a permitted or obligatory action actively performed by an

party, i.e. contract execution

  • Bitcoin protocol:
  • Only owner may transfer amount
  • Transfer amount must be less than owner’s balance
  • No double spending (= bitcoin is a linear resource)
  • Bitcoin has only one fixed contract

Footnotes

slide-12
SLIDE 12

CONFIDENTIAL

Making digital contracts and protocols work (and more similar to bitcoin system)

12

  • Contract specification language (CSL):
  • Passive protocol of finite set of objects and language combinators
  • Protocol react to events. Events need to executed/assigned by the agents
  • No combination of contract specification (who does what) and contract execution
  • Events are linked in a one-to-one relationship to contracts (linearity and monotonicity)
  • The language is domain specific language,restricted and not a Turing complete language
  • Usage of deontic modalities (logic) and logic: Full logic system
  • Formal verification, i.e. proof if two different contract specification codes are identical or not
  • Usage of software robots to generate the code to run on DLT/BC
  • The code written in the CSL/DSL is automatically transformed to “computer code”
  • Each language combinator can be proven to work and the entire code can be proven to work
  • Very similar to model based design used for critical systems, e.g. aerospace industry

Footnotes

slide-13
SLIDE 13

CONFIDENTIAL

Contracts are modeled as trees of possible future states that react to events being logged on the ledger

13

DRAFT FOR REVIEW Example of a delivery vs. payment contract Payment vs. delivery Payment Delivery Received in time Received late Correctly received Incorrectly received

Success if:

  • Amount: 100
  • Path: Alice to Bob

Received in time Received late Correctly received Incorrectly received

Success if:

  • Object: Bike
  • Path: Bob to Alice

Success if:

  • Due date: < 31.10.17

Success if:

  • Due date: < 30.11.17

To be determined To be determined Fail Fail Success To be determined To be determined Payment event:

  • Amount: 100
  • Path: Alice to Bob
  • Due date: 15.10.17

Note that a contract template combined with a GUI is nothing else than a software application and that our technology therefore provides business logic and backend to build such applications

slide-14
SLIDE 14

CONFIDENTIAL

Right view on contracts as passive protocols which specify the agreement and automate the code generation

Distributed ledger technology Contract specification language Formal deontic protocol Mathematical & data model

Scripted contract templates Modeled smart contract

Automated execution Business contract

Distributed system Asymmetric cryptography Passive state models Digital objects Events Reporting language Strategy execution language Templates

14

slide-15
SLIDE 15

CONFIDENTIAL

15

Protocol to use a car

Paper Contract

Contract which regulates the maintenance The ownership contract which regulates the permissions and

  • bligations of the ownership such as

selling the car or the right ro use the car The license to use the car, transferred from to owner to car holder

Concrete Example of mobility contracts

slide-16
SLIDE 16

CONFIDENTIAL

Relationship between smart/digital contracts and legal contracts

16 Footnotes

DLT & Blockchain Smart contracts Program code Traditional legal contracts

a deterministic computer program deployed on a blockchain. where transformation is suitable, recommended only for execution. can have legal meaning doesn’t necessarilly have to. not every judgement is suitable for transformation to code. Possibly legally binding agreements and/or their execution

slide-17
SLIDE 17

CONFIDENTIAL

Operational vs Denotational Semantics and Smart Contracts

17 Footnotes

Typically in a smart contract are the operational semantics, the denotational semantics need to be added in some form. Blame assignment for failures to adhere to operational part

  • f the agreement
  • Operational semantics:
  • perational agreement, who

delivers what and what is there in return, when will there be paid etc. etc. etc.

  • Denotational semantics: the

terms of any agreement, under what law, which court will a dispute be settled if one occurs, general terms and conditions etc etc. Legal Contract Smart contract

slide-18
SLIDE 18

CONFIDENTIAL

Today contracts are managed across various systems: Very aspect of contract is digitalized in different database

CRM and client data systems ERP, transaction, inventory db Payment systems, messaging systems Product contract

18

  • Complex legacy IT system
  • Frequent and complex

migration activities

  • Modeling of business

requirements (e.g., contract details) within every system

  • Maintenance efforts for

existing systems Text object Text object Text object

slide-19
SLIDE 19

CONFIDENTIAL

Business modeling and realisation language

In the future contracts consist of independent, autonomously interacting programmed objects

19

<Domain> <Process> <Ontology> </> <Actors>

Benefits of smart contracts

  • Require no human monitoring
  • React only to predetermined events
  • Can be controlled real-time

Advantages for our clients

  • Reduced costs, errors, and increased speed
  • Reduction of contractual grey zones
  • Immediate responsiveness to actions and events

Code object Code object Code object Product contract

slide-20
SLIDE 20

CONFIDENTIAL

IT architecture of the future will be more process

  • riented and based on smart protocols

20

System 1 Application 1 Decisions/ Actions Reports/ Analyses Rules/ Logic Communication Application X Decisions/ Actions Reports/ Analyses Rules/ Logic Communication Application N Decisions/ Actions Reports/ Analyses Rules/ Logic Communication System X Partner N Data Data Data Data Data Data Data Data Data Application 1 Application X System 1 Decisions/ Actions Reports/ Analyses System X Decisions/ Actions Reports/ Analyses Business protocols Distributed ledger technology Business process orienta- tion and API reduction Output Input Execution Transaction Record keeping Partner N Smart contract engine Application N Decisions/ Actions Reports/ Analyses

Legend: Focus Deon Digital Note: API stands for application programming interface

Today's IT architecture IT architecture of the future

slide-21
SLIDE 21

CONFIDENTIAL

Core ledger Contract validator Core ledger Chain code validator Core ledger Smart contract validator Corda Fabric Ethereum Hardware Distributed ledgers Corda adapter Fabric adapter Etherium adapter Run-time environment Reporting environment Contract specification language Strategy execution language Reporting language Authentification Authentification Authentification Hardware Embedding

21

Architecture for contract language and operating system which empowers collaborative systems

Application Application Application

Windows iOS Android SDKs

Application

Ledger technologies are hardware of collaborative business Ledger/hardware connectors Software Language Programs Operating System HTTP interface RFID interface Interfaces External Interfaces

slide-22
SLIDE 22

CONFIDENTIAL

Daimler AG and other partners are building an open standard for connected mobility

22 Source: Mercedes-Benz

slide-23
SLIDE 23

CONFIDENTIAL

Daimler Badge

Proof of concept: The Daimler Car Sharing universe - top down view

Car pool Heidi many more... Dan Bob Frank Alice External data management systems Verification & validation of external data (e.g., IoT) IoT approval Mercedes-Benz Rental Rental marketplace – car

  • ffering & booking

Failure Management Market maker by

  • ffering own cars

Manage employee badges Assign car to holders Manage cars Issue, transfer & apply car rights Car

5 6 2 1 4 3

23

slide-24
SLIDE 24

CONFIDENTIAL

Thank you for your attention!

24

slide-25
SLIDE 25

CONFIDENTIAL

  • Dr. Florin Herzog

25

  • MSc in Engineering and Mathematics from ETH Zürich, 2002
  • MSc of Science in Engineering from Georgia Institute of Technology, USA, 2001
  • Dr. sc. in Financial Mathematics from ETH Zurich, 2005
  • Founder, CEO, CTO, Chief Engineer of swissQuant Group AG, Fintech with 100

employees, 2005-2016

  • Lecturer at the ETH Zurich for Mathematics since 2007
  • Voting member of investment committee of Vita Collective Foundation, Switzerland largest

independent pension fund with 12bn assets under management, since 2009

  • Investor and head of data analytics of Acatus GmbH, a Fintech in Securitization Berlin since

2016

  • Founder, President of board of directors, CTO of Deon Digital, a blockchain startup with 30

employees, since 2017

Footnotes