Appendix D. DAML for Corda
As discussed in Chapter 1, the current DLT market is reminiscent of database technologies where vendor lock-in can occur. This is a concern to corporate executives who want the freedom to move from one DLT to another if necessary with the lowest switching costs possible. DAML, a technology created by Digital Asset, works to do for DLTs what the JVM has done for programming languages that were coupled to operating systems, decoupling code dependency on the underlying platform and making it portable where you write code once and run it anywhere.
An interesting new way to write applications for Corda networks comes with the recent launch of DAML for Corda: Digital Asset’s implementation of their DAML smart contract language for Corda Enterprise and Corda Open Source.
What Is DAML?
DAML is a purpose-built, open source programming language for modeling business logic in distributed applications. Developers can write code in DAML, deploy it on any of a number of platforms (in addition to Corda, it’s available on VMware blockchain, PostgreSQL, Hyperledger Fabric, Sawtooth, and Besu, and Amazon QLDB), and redeploy it to another platform without changing a line.
The following shows some simple DAML. This is an example implementation of a funding workflow:
template Funding with treasury: Party owner: Party amount: Decimal currency: Currency wireLimit: Decimal purpose: FundingPurpose where signatory treasury ensure amount >= 0.00 && wireLimit >= 0.00 controller ...
Get Mastering Corda now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.