You are on page 1of 19

Introduction to

Day 1

Hemachandra M S
Associate Tech Specialist
BCBU | Tech Mahindra
Copyright © 2021 Tech Mahindra. All rights reserved.
Digital Asset Modelling Language
“Build full-stack, distributed applications for DLT, Blockchain,or databases in days”

Copyright © 2021 Tech Mahindra. All rights reserved.


Today's Agenda
Introduction to DAML

 What is DAML?
 Why DAML?

 Application Architecture
 Development Tools
 Template, Transactions, Contract, Ledger

 Asset Ownership Transfer - Coding

Copyright © 2021 Tech Mahindra. All rights reserved.


What is DAML?
Digital Asset Modeling Language (DAML) is a purpose-built open source programming
language and software framework for the rapid development (10x faster) of portable,
future-proof, and easy to read and write applications using smart contracts.

Runtime and DAML Ledger integrations allow you to write your app once and easily run it
on any infrastructure that meets your needs, be it DLT/blockchain, cloud-native, or
traditional technology.

DAML is a functional language and was designed for distributed business workflows. It
helps a developer to focus more on programming business processes by cutting down
the amount of time the developer would spend on dealing with encryption and blockchain.

Copyright © 2021 Tech Mahindra. All rights reserved.


Why Daml?
Silos exist between and within enterprises

 Every enterprise relies on multi-party workflows to manage processes.


 Different parties use different technologies, databases and applications.
 There is no common data model and standards.
 This results in different and costly manual work.
 Critical processes end up with breaks, and risk is increased.

Copyright © 2021 Tech Mahindra. All rights reserved.


Why Daml?
All current major blockchain and distributed ledger technology (DLT) platforms fall short in these areas

 Programming these systems is difficult and error-prone.


 There is insufficient support for integrating blockchain applications into full solutions.
 Even to start developing an application, one needs to commit to a single deployment target, resulting in
applications that are then tied to that target.

 Heavy trade-offs between privacy, security, and consistency are required. These trade-offs are often
implicit and are not clear to the developer who needs to make them.

 Interoperability relies on standardizing on a single blockchain or distributed ledger technology or requires


careful planning and application development.

Find more of why DAML here: https://daml.com/why-daml

Copyright © 2021 Tech Mahindra. All rights reserved.


Why DAML
Features of DAML

Storage Abstraction Authorization Checks

 The runtime abstracts away the persistence  Ensures proper authorization for all
layer so DAML programs can be written in a actions given on a contract.
storage-agnostic way.

Accountability Tracking No Double Spends

 Signatures from all designated signatories on  A contract that has been archived by a
a contract are required to create agreements. previous transaction cannot be used again.

Atomic Transaction

 The ability to effect a set of


changes atomically such that either all
changes happen or nothing happens in case
of a conflict or error.

Copyright © 2021 Tech Mahindra. All rights reserved.


How to write our app once and easily run it
on any infrastructure? What is the underlying
application architecture?

Copyright © 2021 Tech Mahindra. All rights reserved.


Application Architecture
Bigger picture

Copyright © 2021 Tech Mahindra. All rights reserved.


Application Architecture
Recommended design of a full-stack Daml application
Your Application

Copyright © 2021 Tech Mahindra. All rights reserved.


What are the available tools for development
in DAML?

Copyright © 2021 Tech Mahindra. All rights reserved.


Development Tools
Daml Assistant (daml --help) Daml Studio (daml studio)

 daml is a command-line tool that create, initialize,  Daml Studio is an integrated development
compile, build daml projects, launch other tools like environment (IDE) for Daml. It is an extension on top
daml studio, sandbox, navigator, extractor, http json of Visual Studio Code (VS Code), a cross-platform,
API and run codegen which are related to SDK. open-source editor providing a rich code editing
experience.

Daml Sandbox (daml start / daml sandbox) Navigator  (daml start / daml navigator)

 The Sandbox for short, is a simple ledger  Front-end that you can use to connect to any Daml
implementation that enables rapid application Ledger and inspect and modify the ledger. You can
prototyping by simulating a Daml Ledger. Uses in- use it during Daml development to explore the flow
memory storage by default. and implications of the Daml models.

DAML script(daml script) DAML REPL

 Used for testing DAML models. Provides an API  Allows you to test and manipulate a ledger
with simplicity of scenarios and all benefits while interactively.
running against the actual ledger.

Copyright © 2021 Tech Mahindra. All rights reserved.


Development Tools
Continued…

Daml codegen (daml codegen [java|js|scala]) Daml Profiler*

 You can use the Daml codegen to generate Java,  The Daml Profiler allows you to to profile execution of
Scala, and JavaScript/TypeScript classes your Daml code which can help spot bottlenecks and
representing Daml contract templates. opportunities for optimization. Only available in the Daml Connect
Enterprise Edition.

Copyright © 2021 Tech Mahindra. All rights reserved.


Template, Transactions, Contract, Ledger

 Contract is created from a template, which contains the schema of digital asset and all rules
binding applied to this type of asset.

 It is a transaction causing the change of contracts.

 Contract, representing a specific digital asset in the ledger. Each contract keeps the
necessary detail of the digital asset, and actions that only authorized parties can act upon.
Contract in the ledger is either active or archived.

 Contracts are deployed in the Ledger. Daml Ledger is just a list of commits.

Copyright © 2021 Tech Mahindra. All rights reserved.


Template, Transactions, Contract, Ledger

Transactions

Ledger

Copyright © 2021 Tech Mahindra. All rights reserved.


Asset Ownership Transfer - Coding
 Step1: Alice creates an Asset contract(active) from the template.
 Step2: Alice exercises a choice “Give” that transfers ownership to Bob, which will archive
existing contract and creates a new contract between Alice and Bob.

 Step3: Bob views the digital asset and “Give”s back the asset to Alice, as Bob is now an
owner of that asset. This will create a new active contract and archive the previous contract.

Let’s head to Daml Playground

Copyright © 2021 Tech Mahindra. All rights reserved.


Important Links (15/11/2021)

 1 hour workshop Youtube video:  Daml + PKI


https://www.youtube.com/watch?v=AGxt4yQceXA&t https://
daml.com/blog/engineering/secure-daml-infrastructure-part-
 Chapters 1-7 of the intro to DAML section as pre-reading: 1-pki-and-certificates
https://docs.daml.com/daml/intro/0_Intro.html
 Daml Finance Library:
 Daml online training self paced training: https://github.com/digital-asset/lib-finance
https://daml.talentlms.com/dashboard
 Daml online support:
 Interactive Tutorials: http://discuss.daml.com/
https://daml.com/learn
 YouTube Channel (Please subscribe - Webinars on various
 Daml cheat sheet: use cases)
https://docs.daml.com/cheat-sheet/ https://
www.youtube.com/channel/UCogfiTgCgVubpLQ1i1VmPPg
 DAML App Examples:
https://daml.com/examples  Daml Certificate Catalog:
https://github.com/digital-asset/ex-models Course catalog - Daml Training Platform (talentlms.com)

 Download the Daml SDK:


https://docs.daml.com/

Copyright © 2021 Tech Mahindra. All rights reserved.


Thank you
Visit us at www.techmahindra.com

Disclaimer
Tech Mahindra Limited, herein referred to as TechM provide a wide array of presentations and reports, with the contributions of various professionals. These presentations and
reports are for information purposes and private circulation only and do not constitute an offer to buy or sell any services mentioned therein. They do not purport to be a
complete description of the market conditions or developments referred to in the material. While utmost care has been taken in preparing the above, we claim no responsibility
for their accuracy. We shall not be liable for any direct or indirect losses arising from the use thereof and the viewers are requested to use the information contained herein at
their own risk. These presentations and reports should not be reproduced, re-circulated, published in any media, website or otherwise, in any form or manner, in part or as a
whole, without the express consent in writing of TechM or its subsidiaries. Any unauthorized use, disclosure or public dissemination of information contained herein is prohibited.
Individual situations and local practices and standards may vary, so viewers and others utilizing information contained within a presentation are free to adopt differing standards
and approaches as they see fit. You may not repackage or sell the presentation. Products and names mentioned in materials or presentations are the property of their respective
owners and the mention of them does not constitute an endorsement by TechM. Information contained in a presentation hosted or promoted by TechM is provided “as is” without
warranty of any kind, either expressed or implied, including any warranty of merchantability or fitness for a particular purpose. TechM assumes no liability or responsibility for the
contents of a presentation or the opinions expressed by the presenters. All expressions of opinion are subject to change without notice.

Copyright © 2021 Tech Mahindra. All rights reserved.


Copyright © 2021 Tech Mahindra. All rights reserved.

You might also like