- Advanced Blockchain Development
- Imran Bashir Narayan Prusty
- 653字
- 2021-06-24 14:04:48
Smart contract templates
Smart contracts can be implemented for any industry where required, but most current use cases are related to the financial industry. This is due to the fact that blockchain found many use cases in the Finance industry first and sparked great research interest in the financial industry long before other industries. Recent work in smart contract space specific to the financial industry has proposed the idea of smart contract templates. The idea is to build standard templates that provide a framework to support legal agreements for financial instruments.
This idea was proposed by Clack et al. in their paper published in 2016, named Smart Contract Templates: Foundations, design landscape and research directions. The paper also proposed that domain-specific languages should be built to support design and implementation of smart contract templates. A language named CLACK, a common language for augmented contract knowledge has been proposed, and research has begun to develop the language. This language is intended to be very rich and provide a large variety of functions ranging from supporting legal prose to the ability to be executed on multiple platforms and cryptographic functions.
Recent work to develop smart contract templates that support legally enforceable smart contracts have been carried out by Clack et al. This proposal has been discussed in their research paper Smart Contract Templates: essential requirements and design options. The main aim of this paper is to investigate how legal prose can be linked with code using a markup language. It also covers that how smart legal agreements can be created, formatted, executed, and serialized for storage and transmission. This is an ongoing work and an open area for further research and development.
Contracts in the finance industry is not a new concept, and various domain-specific language DSLs are already in use in the financial industry to provide specific language for a specific domain. For example, there are DSLs available that support development of insurance products, represent energy derivatives, or are being used to build trading strategies.
It is also important to understand the concept of domain-specific languages as this type of languages can be developed to program smart contracts. These languages are developed with limited expressiveness for a particular application or area of interest. Domain-specific languages (DSLs) are different from general-purpose programming languages (GPLs). DSLs have a small set of features that are sufficient and optimized for the domain they are intended to be used in and, unlike GPLs, are usually not used to build general purpose large application programs.
Based on the design philosophy of DSLs it can be envisaged that such languages will be developed specifically to write smart contracts. Some work has already been done, and Solidity is one such language that has been introduced with Ethereum blockchain to write smart contracts. Vyper is another language that has been recently introduced for Ethereum smart contact development.
This idea of domain-specific languages for smart contract programming can be further extended to a graphical domain-specific language, a smart contract modeling platform where a domain expert (not a programmer, for example, a front desk dealer) can use a graphical user interface and a canvas to define and draw the semantics and performance of a financial contract. Once the flow has been drawn and completed, it can be emulated first to test and then be deployed from the same system to the target platform, which can be a blockchain. This is also not a new concept, and a similar approach is used in the Tibco StreamBase product, which is a Java-based system used for building event-driven, high-frequency trading systems.
It is proposed that research should also be conducted in the area of developing high-level DSLs that can be used to program a smart contract in a user-friendly graphical user interface, thus allowing a non-programmer domain expert (for example, a lawyer) to design smart contracts.