Halborn Logo

// Blog


Daml and Canton: An Introduction


Rob Behnke

April 12th, 2023

The Daml smart contract platform and the Canton ledger interoperability protocol have been chosen by many high-profile players of the financial industry as a distributed ledger solution.

According to the latest announcement, the EquiLend platform’s 1Source initiative will use Daml and Canton. The problem the platform wants to solve is that “currently, counterparties to a securities lending transaction record contract details separately in their respective systems, which often leads to "breaks” downstream in the trade lifecycle” making it necessary to perform “costly and inefficient reconciliation processes”.

The investment bank Goldman Sachs went live with its end-to-end digital asset platform (called GS DAPTM) developed on Daml in January 2023. The benefits of the new platform are “faster matching of buyers and sellers, quicker settlements, increased liquidity, stronger risk management, and expanded investor access to digital assets”.

Broadridge also uses Daml and Canton under the hood of its Distributed Ledger Repo (DLR) solution, launched in 2021, which now transacts $1 trillion a month. The insurtech company Zinnia aims at speeding up policy administration with its Zahara open insurance system of record. 

Digital Asset, creators of Daml and Canton, are involved in the “digital dollar pilot” organized by the New York Federal Reserve and is a partner of several big stock exchanges all over the world.

In this blog post, we’ll explain in broad strokes how the unique features of Daml and Canton make it so useful as a distributed ledger platform. Stay tuned for more technical details in subsequent blog posts.

At the intersection of the legal and the IT world

On one hand, legal relationships underpin every segment of the economy. On the other hand, the growing need for volume, speed and efficiency drive digitalization. It’s just natural that we can see more and more solutions (often called distributed ledger of blockchain) which digitize legal relationships and transactions between economic partners.

It’s not a coincidence that we saw distributed ledger/blockchain solutions emerge first in the financial industry. Legal relationships here are highly standardized in the form of securities and derivatives, the volumes and values are high, and time is of the essence. 

But the development doesn’t stop at the industry boundaries. In more and more industries, we can see that non-financial or even real-world assets are tokenized, “token” also representing a legal relationship, generalizing the concept of securities.

Censorship resistance vs speed

Within the blockchain landscape (by “blockchain” we mean transaction systems no matter if their implementation includes Bitcoin-style blocks and chains) there is a big divide, determining supported use cases and non-functional aspects like energy consumption and throughput.

The splitting criterion is censorship resistance.

Bitcoin, Ethereum and some other blockchains aim to be censorship resistant, meaning no external party can block transactions. In some use cases, this feature can be useful – but it doesn’t come for free. The price users need to pay for censorship resistance is relatively low throughput, high energy consumption, and transaction fees. On top of these burdens, these networks run the risk of a 51% attack (which became a reality for Ethereum Classic).

Daml, together with some other transaction systems typically used by companies and other institutions (like Corda, Hyperledger Fabric, etc.) do not belong in this category. Such systems operate within a contractual and often a regulatory framework, are integrated with other corporate infrastructure elements and IAM systems. Consequently, they don’t need (and indeed don’t want) to be censorship resistant. Which also means that they don’t share the burdens and risks of censorship resistant networks.

So how fast is Daml?

It depends on a lot of factors, because the platform offers various means for optimization and scaling. It’s safe to say that it’s probably slower than a database operating in a centralized setup, and much faster than some systems which are typically used today to process everyday workflows like e.g. money transfer, stock trade settlement or healthcare claims processing, because it can cut off coordination delays which are often much heavier than IT processing times.

Choose your sweet spot of “decentralized”

“Blockchain” is roughly synonymous with “distributed ledger”. The distributed nature of such transaction systems follows from the application domain, because business is inherently distributed – nobody does business, enters into contracts or transacts with themselves. 

“Distributed” in this sense means: spanning trust domains.

Theoretically, the full potential of such inherently distributed transactions systems can be best utilized in a fully decentralized topology. In practice though, there are considerations like costs, trust assumptions and platform limitations which require a broader spectrum of options between the fully decentralized and fully centralized topology. 

The Daml/Canton platform offers users great flexibility in choosing the sweet spot in terms of the degree of decentralization. On one end of the spectrum, the platform can be used in a centralized manner, on top of a SQL database. The other extreme is when trust domains form a network so that every domain chooses different kinds of persistent storage, which can be a SQL database, enterprise Ethereum or Hyperledger Fabric. (To be clear: in the case of using a blockchain as persistent storage, the Daml model cannot interact with the native assets on the underlying blockchain, the Daml data is stored as blobs.)

Financial instruments, rights and obligations

To get a high level picture of what a Daml model can do for you, you can check out the Daml Finance Library. It provides tools to model instruments (the economic terms related to securities and derivatives), holdings of such instruments, settlements transactions and lifecycling.

But the range of viable application domains for Daml models is much broader than financial instruments.

In simple terms, a Daml smart contract model implements the legal architecture of a business model, and the Canton synchronization protocol implements the distributed network which executes the transactions constituting the daily operation of such a business model.

Daml ledgers mimic real-world interactions between parties, governed by contract law. Real-world rights and obligations are direct equivalents in a Daml model: obligations are modeled as contracts, rights as choices on those contracts. (A subtle but important detail of the Daml ledger implementation is that when we speak about “contracts” on the ledger, we use an abstraction. The ledger actually doesn’t store contracts but events. A creation event corresponds to an active contract, as long as a “consuming exercise” event is not committed on the ledger for the same contract id.)

On top of implementing rights and obligations, a Daml application running on a Daml ledger provides atomic transaction handling and need-to-know-basis privacy.

Writing Daml code

So what do Daml developers actually do? 

Using the Daml programming language, you can write code for different purposes:

  • The Daml model, implementing the shared rules of the business model, agreed on by all business partners, running on all participant nodes. It consists of contract templates, data types and functions. This code gets actually deployed on a Daml ledger. The uniformity of the code running on different nodes is guaranteed by the main package id which is a hash of the contents of the Daml model and its dependencies.

  • Daml triggers which are private client applications meant to run in production on behalf of a single ledger party, performing automatic ledger updates.

  • Daml scripts, which are private client applications meant to test or set up a ledger, possibly performing ledger submissions on behalf of different ledger parties within one piece of code.

These are the main use cases and benefits of the Daml/Canton platform. Stay tuned, in subsequent blog posts, we’ll be sharing more technical details and doing deeper dives into Daml.