Do more with Aline

Smart legal contracts

How do legal contracts and "smart contracts" behave well together? A solid data model and a smart-contract bridge are key.


Aline Engineering


February 11, 2020



hat is a "smart legal contract" and how do legal contracts interact, if at all, with distributed ledgers? Some take the view that Ricardian contracts are the correct paradigm to reason about the interplay between software and legal contracts.

A Ricardian contract places the defining elements of a legal agreement in a format that can be expressed and executed in software.

There is an allure to having a contract that is both readable by attorneys and executable by software. But, it is practically very difficult to build software that parses natural legal language and code as part of the same document. At least in the short term, it is far more likely that quasi-Ricardian contracts or another model arises to connect legal contracts to smart contracts.

So, the real question becomes how do we connect natural language prose to a smart contract or series of smart contracts that takes some automated action based on the legal contract? At Aline, we believe changing the document model underlying legal documents can have a significant effect on integrating legal contracts with smart contracts. Aline's web-native editor for legal contracts uses a data-rich document model that is human-readable and can be parsed and manipulated using any programming language, including smart-contract languages.

An example of the document model underlying Aline's editor.

By changing the document model and embedding data within the model itself, we can transform our legal contracts into documents that can be processed by software, including smart-contracts, and used in interesting applications that require data typically locked in natural language prose.

A peer-to-peer network for smart legal contracts

With a data-rich document model underpinning legal contracts, there are many interesting applications leveraging distributed-ledger technology that can be built. In fact, many smart-contract use cases currently being explored, at base, rely heavily on legal contracts. Use cases in finance, supply chain, and global trade all currently run on "dumb" legal contracts.

The first step to building a meaningful smart-contract application using legal contracts is getting verified data from a legal contract on the ledger. As anyone who has built a smart-contract application knows, garbage data in equals garbage out. 🗑️

To ensure data fidelity and consistency, Aline's engineering team has prototyped a peer-to-peer network for signing legal contracts that have a data-rich document model underpinning each contract. We have chosen to build the prototype using DAML, an open-source programming language for writing distributed applications quickly, concisely, and correctly. Using the provable correctness of DAML, we were able to build a prototype that allows any DAML Party - a primitive data type in DAML that uniquely represents a user in a DAML network - to receive a proposed legal contract, go through a defined DAML workflow, and execute the legal contract using that Party's cryptographic keys. The legal agreement is then persisted as a SignedContract (see lines 181-187) representing the final, signed legal contact. But, in this case, the signedAgreement (line 183) has a JSON-like data structure rich with information and data pertaining to the legal contract.

Any of the DAML Parties involved in the legal contract workflow can then utilize the SignedContract on line 181 - or just certain data within the JSON-like data structure - in other DAML smart contracts to perform interesting and in some cases automated actions. For instance, if the legal contract pertained to an insurance policy, the claims administrator could utilize other DAML contracts to receive and process insurance claims in a more automated manner using data tied directly to the underlying insurance policy, whose execution and information is recorded on the ledger.

A DAML program for peer-to-peer execution of legal contracts.

We have presented a prototype that provides a strong primitive for building further applications using any data within the legal contract itself, all of which are made possible by recording a data-rich document model - the JSONValue - within the distributed ledger itself for use in a myriad of smart contracts. A peer-to-peer legal network as envisioned could have businesses and individuals with their own unique cryptographic keys for signing data-rich legal documents that, when executed, would be recorded on a distributed ledger. The ledger would record the authoritative legal document for all parties and allow any of the parties to a contract to compose even further DAML workflows using data from the executed legal document.

Why we used DAML

Aline chose to use DAML for this use case for a number of reasons:

  1. We became productive in DAML using the DAML SDK quickly. DAML is intuitive to use, and abstracts away important but critical elements when building smart-contract applications. For instance, DAML's strong authorization abstractions are powerful to build off of. Using signatories, observers, and choices, it is effectively impossible for any Party in a DAML network to enter into a smart-contract without that Party's authorization. As a benefit, this closely tracks the legal world as well.
  2. DAML abstracts the ledger underlying a DAML program so the application developer can focus on business logic without having to pick, up front, the underlying distributed ledger.
  3. DAML is a very readable programming language, meaning even attorneys can understand the syntax and effect of a DAML program.
  4. The privacy features of DAML are critical for an application involving sensitive data, such as legal contracts. Using DAML, you can simply write your smart-contracts using Parties and Observers and data on the ledger is only disclosed to the correct Parties and Observers, by default.

As Aline continues to build out the prototype, we will continue to use DAML and explore some of its more powerful features.

About Aline

Aline is a technology company based in New York, New York building next-generation contract software. Aline's web-native editor makes composing contract templates, clauses, and workflows simple for legal teams, allowing all stakeholders in the contract process to collaborate, in a data-rich way, like never before. Learn more about Aline on its homepage.

More Posts

You Might Also Like

How Aline Protects Your Data
At Aline, we’re committed to safeguarding your most sensitive information. Learn how we do it inside.

Read more

Dec 30, 2021
Brent Farese
Company News
What is digital contracting?
Technology is changing everything, including how we sign contracts.

Read more

Nov 1, 2021
Brent Farese
Digital contracts made easy
Fix your manual contracting process by going digital with Aline Workflows

Read more

Aug 23, 2021
Brent Farese
Company News
Introducing Aline
Introducing Aline, a digital contracting platform for organizations to drastically improve their legal contract process.

Read more

Feb 11, 2020
Brent Farese

Want to learn more about Aline Workflows? Drop us a line and we'll get back to you.

Learn more