Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Making Contracts Smart, Secure and Functional with DAML and Scala

Making Contracts Smart, Secure and Functional with DAML and Scala

Shannon

May 30, 2019
Tweet

More Decks by Shannon

Other Decks in Technology

Transcript

  1. DIGITALASSET.COM © 2019 DIGITAL ASSET HOLDINGS, LLC
    1
    Smart Contracts with DAML
    Using DAML to manage workflows driven from Scala

    View full-size slide

  2. DIGITALASSET.COM © 2019 DIGITAL ASSET HOLDINGS, LLC
    2
    1. Contracts
    2. DAML
    3. Scala
    4. Questions
    Agenda

    View full-size slide

  3. DIGITALASSET.COM © 2019 DIGITAL ASSET HOLDINGS, LLC
    3
    Story

    View full-size slide

  4. DIGITALASSET.COM © 2019 DIGITAL ASSET HOLDINGS, LLC
    4
    ● 8+ years functional programming (mostly in financial services)
    ● Interested in expressivity and correctness
    ● Currently work as developer advocate for DAML
    ● Digital Asset
    ○ Technology Company
    ○ Background in Blockchain and Financial services
    ○ Recently Open Sourced DAML
    Background

    View full-size slide

  5. DIGITALASSET.COM © 2019 DIGITAL ASSET HOLDINGS, LLC
    5
    Contracts
    A contract is a legally-binding agreement which recognises and governs the rights and
    duties of the parties to the agreement. A contract is legally enforceable because it meets the
    requirements and approval of the law. An agreement typically involves the exchange of
    goods, services, money, or promises of any of those. In the event of breach of
    contract, the law awards the injured party access to legal remedies such as damages and
    cancellation.[2]
    In the Anglo-American common law, formation of a contract generally requires an offer,
    acceptance, consideration, and a mutual intent to be bound. Each party must
    have capacity to enter the contract.[3] Although most oral contracts are binding, some types of
    contracts may require formalities such as being in writing or by deed.[4]
    In the civil law tradition, contract law is a branch of the law of obligations.[5]

    View full-size slide

  6. DIGITALASSET.COM © 2019 DIGITAL ASSET HOLDINGS, LLC
    6
    Examples of contracts
    ● Employment contract
    ● Insurance
    ● Rental agreement
    ● Property Deed
    ● Bonds / Shares / Options / Bets
    And other examples you may not think of:
    ● Protocol execution - TCP/IP (Client/Server)
    ● Purchase
    ● Money

    View full-size slide

  7. DIGITALASSET.COM © 2019 DIGITAL ASSET HOLDINGS, LLC
    7
    Money - (or cash IoU)
    1. The Legal Agreement
    2. The Signature of the
    Counterparty
    3. The Security Token
    4. The Unique Identifier
    5. The Distribution
    Mechanism

    View full-size slide

  8. DIGITALASSET.COM © 2019 DIGITAL ASSET HOLDINGS, LLC
    8
    Example - Money in DAML
    https://webide.daml.com/

    View full-size slide

  9. DIGITALASSET.COM © 2019 DIGITAL ASSET HOLDINGS, LLC
    9
    What to do with your money...

    View full-size slide

  10. DIGITALASSET.COM © 2019 DIGITAL ASSET HOLDINGS, LLC
    10
    Example - Insuring your SunSeeker 155

    View full-size slide

  11. DIGITALASSET.COM © 2019 DIGITAL ASSET HOLDINGS, LLC
    11
    The Ledger API

    View full-size slide

  12. DIGITALASSET.COM © 2019 DIGITAL ASSET HOLDINGS, LLC
    12
    Example - Calling DAML from Scala

    View full-size slide

  13. DIGITALASSET.COM © 2018 DIGITAL ASSET HOLDINGS, LLC
    13
    Develop Demo
    Test Deploy & Collaborate
    The DAML SDK (https://daml.com)

    View full-size slide

  14. DIGITALASSET.COM © 2019 DIGITAL ASSET HOLDINGS, LLC
    14
    Useful links
    ● www.daml.com
    ● https://github.com/digital-asset/daml
    ● https://github.com/digital-asset/ex-cdm-swaps
    ● https://github.com/digital-asset/ex-models
    ● https://github.com/digital-asset/ex-bond-trading
    ● https://damldriven.slack.com/
    Stack overflow seach DAML

    View full-size slide