Ricardian contracts

Ricardian contracts were initially proposed in the paper, Financial Cryptography in 7 Layers, by Ian Grigg in late 1990s. These contracts were used initially in a bond trading and payment system called Ricardo. The fundamental idea is to write a document that is understandable and acceptable by both a court of law and computer software. Ricardian contracts address the challenge of issuance of value over the internet. It identifies the issuer and captures all the terms and clauses of the contract in a document to make it acceptable as a legally binding contract.

A Ricardian contract is a document that has several of the following properties:

  • A contract offered by an issuer to holders
  • A valuable right held by holders and managed by the issuer
  • Easily readable by people (like a contract on paper)
  • Readable by programs (parsable, like a database)
  • Digitally signed
  • Carries the keys and server information
  • Allied with a unique and secure identifier
The preceding information is based on the original definition by Ian Grigg at http://iang.org/papers/ricardian_contract.html.

In practice, the contracts are implemented by producing a single document that contains the terms of the contract in legal prose and the required machine-readable tags. This document is digitally signed by the issuer using their private key. This document is then hashed using a message digest function to produce a hash by which the document can be identified. This hash is then further used and signed by parties during the performance of the contract to link each transaction, with the identifier hash thus serving as an evidence of intent. This is depicted in the next diagram, usually called a bowtie model.

The diagram shows number of elements:

  • The World of Law on the left-hand side from where the document originates. This document is a written contract in legal prose with some machine-readable tags.
  • This document is then hashed.
  • The resultant message digest is used as an identifier throughout the World of Accountancy, shown on the right-hand side of the diagram.

The World of Accountancy element represents any accounting, trading, and information systems that are being used in the business to perform various business operations. The idea behind this flow is that the message digest generated by hashing the document is first used in a so-called genesis transaction, or first transaction, and then used in every transaction as an identifier throughout the operational execution of the contract.

This way, a secure link is created between the original written contract and every transaction in the World of Accounting:

Ricardian contracts, bowtie diagram

A Ricardian contract is different from a smart contract in the sense that a smart contract does not include any contractual document and is focused purely on the execution of the contract. A Ricardian contract, on the other hand, is more concerned with the semantic richness and production of a document that contains contractual legal prose. The semantics of a contract can be divided into two types: operational semantics and denotational semantics.

The first type defines the actual execution, correctness, and safety of the contract, and the latter is concerned with the real-world meaning of the full contract. Some researchers have differentiated between smart contract code and smart legal contracts where a smart contract is only concerned with the execution of the contract. The second type encompasses both the denotational and operational semantics of a legal agreement. It perhaps makes sense to categorize smart contracts based on the difference between semantics, but it is better to consider smart contracts as a standalone entity that is capable of encoding legal prose and code (business logic) in it.

In Bitcoin, a straightforward implementation of basic smart contracts (conditional logic) can be observed, which is entirely oriented towards the execution and performance of the contract, whereas a Ricardian contract is more geared towards producing a document that is understandable by humans with some parts that a computer program can understand. This can be viewed as legal semantics versus operational performance (semantics versus performance) as shown in the following diagram. The diagram shows that Ricardian contracts are more semantically-rich, whereas smart contracts are more performance-rich. This concept was initially proposed by Ian Grigg in his paper, On the intersection of Ricardian and smart contracts.

Diagram explaining performance versus semantics are orthogonal issues as described by Ian Grigg; slightly modified to show examples of different types of contracts on both axis

A smart contract is made up to have both of these elements (performance and semantics) embedded together, which completes an ideal model of a smart contract.

A Ricardian contract can be represented as a tuple of three objects, namely Prose, parameters, and code. Prose represents the legal contract in natural language; code represents the program that is a computer-understandable representation of legal prose; and parameters join the appropriate parts of the legal contract to the equivalent code.

Ricardian contracts have been implemented in many systems, such as CommonAccord, OpenBazaar, OpenAssets, and Askemos.