Smart Contract Engineering Using Natural Language

Blockchain-based smart contracts were developed as a means of enforcing agreements without a prior assumption of trust. They eliminate the need for hard signatures, Docusign, and courts to enforce the terms of an agreement. However, the technology still has a long way to go. It is difficult to write correct contracts that are robust when operating an environment where public blockchains are at odds with one another.

The question then becomes whether domain-specific contract programming can produce the desired results that we have come to expect from smart contracts. Furthermore, can natural language get worked into smart contract algorithms to support the expression and systematic testing?  The  design, implementation, and evaluation of ERC-20, or Ethereum-based smart contracts is a good place to start.

A smart contract can be language based, using the state machine model of execution. This means that the design and evaluation of ERC-20 smart contracts can be grounded in a series of case studies to determine its efficacy. There are lots of application scenarios and design patterns to consider in practice when producing smart contracts. First, smart contracts must be translated into two targets:

  • a formal specification expressed through natural language
  • an implementation expressed through code

ERC-20 smart contracts are written in Solidity. This is an object-oriented programming language used by Ethereum and a number of other blockchains. So the question becomes, can natural language be translated into Solidity code?

Furthermore, if the code is not precise, then must the old frameworks of courtrooms and natural language continue to play a role? Here’s another thought: code is typically meant to be objective, with objective outcomes based on a set of rules. Yet, through machine learning, perhaps there is a subjective element that can be layered onto smart contracts, where the code interprets the rules when anomalies present themselves.

The future of smart contracts is bright, and we will see more of them come to fruition in the coming year. Some will do well, and some will fail. But this is the iterative process of innovation, and it is the next step in the natural evolution of contractual frameworks for doing business. In the meantime, courtrooms will continue to be backed up, partly due to the large number of cases and partly due to COVID’s effect on the courts. People will continue to have different interpretations of the natural language agreements they enter into, until these problems can be resolved through code.