What is Ergo?

Ergo is a domain-specific language (DSL) that captures the execution logic of legal contracts.

Ergo is intended to be accessible to both Lawyers and Developers, helping ensure that the executable logic and the corresponding legal prose are always consistent.


Design Principles

Ergo is based on the following principles:

  • Ergo contracts have a class-like structure with clauses akin to methods
  • Ergo can handle types (concepts, transations, etc) defined with the Composer Concerto Modeling Language (so called CML models), as mandated by the Accord Project Template Specification
  • Ergo borrows from strongly-typed functional programming languages: clauses have a well-defined type signature (input and output), they are functions without side effects
  • The compiler guarantees error-free execution for well-typed Ergo programs
  • Clauses and functions are written in an expression language with limited expressiveness (it allows conditional and bounded iteration)
  • Most of the compiler is written in Coq as a stepping stone for formal specification and verification

Language Features

See Ergo in action with some code snippets from real smart legal contracts.

The structure of an Ergo program parallels the structure of the legal text, with contracts containing one or more clauses.





The Ergo language facilitates reuse of existing contract or clause logic


Safe execution

Ergo prevents run-time errors and non-terminating logic



Ergo is consistent with the Accord Project Template Specification


Blockchain neutral

The same contract logic can be executed either on and off chain on a variety of distributed ledger technologies


Formally Specified

The meaning of contracts should be well defined so it can be verified and preserved during execution