Dalhousie Blockchain Lab Logo

Dalhousie Blockchain Lab

Smart Contract as a Service – SCaaS

Investigators: Drs. C. Liu & P. Bodorik, Dalhousie University, and Dr. D. Jutla, Saint Mary's University

SCaaS – Research in Publications

Publications are organized around research topics and themes. Below each research topic, relevant publications are listed and main contributions are described. For detailed references and downloads, please see the People & Pubs page.


Transforming FSMs to Smart Contracts with Sidechain Processing

The first paper presents a methodology for transforming computation represented using an FSM into a smart contract. Furthermore, a method is presented for analyzing the smart contract to find patterns suitable for computation on a sidechain. The paper describes how to package the pattern as a separate smart contract deployed on a cheaper sidechain, and provides the necessary interaction protocol between the main and the sidechain.

The second paper elaborates on the tool to provide automated transformation of the FSM model into smart contract methods. For the Ethereum blockchain, a method is provided to estimate the cost of (i) executing the pattern on the mainchain and (ii) on a sidechain, including the overhead cost due to interaction between chains. If the sidechain cost (including overhead) is cheaper, the pattern is deployed on the sidechain.

However, FSMs are limited in their expressiveness to support trade and goods/services applications, and hence other Model Driven Engineering (MDE) approaches need to be explored. We use Business Process Model Notation (BPMN) modeling to express the blockchain application requirements and then transform the BPMN model to smart contracts. Unlike other approaches that transform a BPMN model directly into smart contract methods, we use an interpretive approach based on multi-modal modeling, in which time is represented using Discrete Event (DE) modeling while functionality is represented using Hierarchical State Machines (HSMs) — i.e., DE-HSM modeling, described next.


Using Multi-modal Modeling to Transform a BPMN Model to Smart Contracts

A blockchain application, expressed using a Business Process Model Notation (BPMN) model, is transformed into a multi-modal model — more specifically a DE-HSM model — in which time is represented using Discrete Event (DE) modeling while functionality is represented using Hierarchical State Machines (HSMs).

The DE-HSM model is transformed into the methods of smart contract(s). The smart contract contains a data structure representing the DE-HSM model that is independent of the blockchain infrastructure. It also includes one main method that, given input from an actor, checks the current state of computation and determines the state transition while also producing outputs associated with the transition. The transition output and the new state represent the synchronization activities. However, if the transition indicates that a particular BPMN task element is to be executed, a method associated with that task element is executed.

We present a method and a tool to transform a BPMN model to a DE-HSM model, and then to smart contracts, automatically. The business logic for each actor is represented as a script contained within a BPMN-task element created either by a developer or by a BA using a graphical DMN modeling tool. Consequently:


Supporting Collaborative Multi-step Transactions

A blockchain transaction is a result of updates performed by an execution of a smart contract method. However, once a smart contract method is invoked, it runs to completion, and hence it is a single-step transaction that is insufficient to support long-term collaborative activities executed by several actors.

Our approach enables a BA to define a multi-step (long-term) transaction as an execution of several methods, wherein the transformation tool automatically provides a transaction mechanism to enforce the ACID transactional properties of Atomicity, Consistency, Isolation, and Durability — defined analogously to DB systems.

Furthermore, we also support nesting of multi-step (long-term) transactions with sub-transaction semantics defined as for DB systems.

Sub-transactions can be packaged as separate smart contracts deployable on different blockchains, each one with its own transaction mechanism. This is exploited in providing privacy, in that information used for processing of a sub-transaction is only accessible to actors participating in that activity.


Recent Research – SCaaS: Usability, Software Lifecycle Support, and Compliance

Our recent research has been addressing usability issues that hamper adoption. We show that (i) SCaaS can be used not only by a large company with IT support, but also by an SME; (ii) the SCaaS approach supports the Software Lifecycle — smart contracts can be upgraded and repaired; and (iii) SCaaS can be used to support compliance requirements.

SCaaS for Large Companies and SMEs

SCaaS – Support for the Software Lifecycle

A smart contract is software, and it has been shown that software needs to be upgradable to stay relevant. We also address the issue of repairing partially executed smart contracts that cannot complete execution due to conditions in the external environment.

Support for Compliance and Reporting Requirements

Smart contracts deal with trade activities that need to comply with various regulations and reporting requirements. Trade activities may be subject to (i) Regulatory compliance (GDPR, SOX, HIPAA); (ii) Internal/Corporate Policy Compliance; (iii) Standards Compliance (PCI DSS); (iv) Contractual Compliance; (v) Environmental Compliance; (vi) Health and Safety Compliance; (vii) Data and Cybersecurity Compliance; and (viii) Financial Compliance. We are investigating how upgradability and repair of smart contracts in our SCaaS approach can be exploited to support regulatory requirements. A publication describing our progress on this topic is currently in preparation.