Why Model-Driven Engineering Fits the Needs for Blockchain Application Development
Qinghua Lu; Ingo Weber; and Mark Staples, Data61, CSIRO, Sydney, Australia
IEEE Blockchain Technical Briefs, September 2018
Issues in Building Blockchain Applications
Blockchain has attracted a broad range of interests from start-ups, enterprises and governments. A large number of projects have been conducted to explore how to use blockchain to re-architect systems and to build new applications and business models. The application areas for blockchain are diverse, including digital currency, payments, trade finance, asset registry, identity management, and business processes.
However, building blockchain applications is challenging for developers. First, blockchain is a new technology with still limited tooling and documentation, so there can be a steep learning curve for developers. According to a survey by Gartner , 23% of [relevant surveyed] CIOs said that blockchain requires the newest skills for implementation at various application areas, while 18% said that blockchain technique itself is one of the most difficult. Second, the blockchain is by design an immutable record, so it is non-trivial or even infeasible to update the smart contracts . This can impede the way to fix bugs by releasing new versions of smart contracts. Mistakes in smart contracts have led to massive economic loss, such as the DAO exploit .
Model-Driven Engineering (MDE)
Model-driven engineering (MDE) is software engineering methodology using models with various views and levels of abstraction for different purposes during software development. Models with a low level of abstraction can be used to directly generate software production code, while those with a high level of abstraction can provide guidance and even support system analysis before implementation. Depending on the purpose, there can be different concepts captured in models, from static structures (e.g., data models, system structure) to dynamic activities (e.g., activity sequences).
Specifically, MDE for code generation can be further classified into different types:
- Once-off code generation: Once the code is derived from the model, the subsequent evolution of the code is independent of the model.
- Repetitive code generation: The code is re-generated from the subsequent changes of the model over time.
- One-way model-to-code code generation: The code is updated if changes are made to the model, but not vice versa.
- Round-trip code generation: If the generated code is updated, the changes can be propagated back to the model level. This is an often desirable but rarely achieved vison for MDE.
MDE Development of Blockchain Applications
In the context of blockchain-based applications, MDE is of particular importance for the following reasons. First, MDE development tools can implement best practices and generate well-tested code, thereby reducing the occurrence of vulnerable code which may easily be attacked. Second, models can avoid lock-in to specific blockchain technologies since they can be platform-agnostic, and model-driven development tools can be applied at multiple blockchain platforms. Third, models are easier to understand than code, thus to improve development productivity. It is easier to check the correctness of a model and model-driven tools can ensure that the deployed code has not been modified after its generation from the model. Fourth, it can facilitate communication with domain experts who can inspect the model to understand how their ideas are represented in the system.
Asset management is considered to be the “first killer application" of blockchain. Building registries on blockchain can provide increased confidence in data integrity, availability, transparency and immutability. In addition, if we use the blockchain as a unified infrastructure, multiple registries can more easily interact with each other. Furthermore, business processes that manage non-fungible assets (e.g., transferring car/grain/land titles) are a promising domain for applying blockchain technology. Unlike fungible assets like cryptocurrency (e.g., Bitcoin, Ether) and tokens for fungible assets (i.e., the most common type of “coin” managed on blockchain networks like Ethereum), non-fungible assets can be highly individualised, which can introduce inefficiencies and uncertainty, leading to counterparty risks. Management of non-fungible assets traditionally relies on a centralised trusted authority, which can cause other trust issues.
Therefore, we adopt MDE to facilitate the development of blockchain applications in the space of business processes and asset registries, which can also be applied to other blockchain applications. We designed and implemented an MDE tool, named Lorikeet , which can automatically generate smart contracts from business process models and/or registry data schema.
Figure 1. Architecture of Lorikeet.
Fig. 1 illustrates the architecture of Lorikeet, which consists of a Business Process Model and Notation (BPMN) and registry modeller, a smart contract generator and a blockchain trigger. The BPMN and registry modeller is presented as a web application for users to build the business processes and registry models. Business processes are modelled in the BPMN 2.0, while registries are modelled as XML schema. The smart contract generator consists of the BPMN translator and the registry generator. The BPMN translator can automatically create smart contracts in Solidity from BPMN models while the registry generator can produce smart contract based on the registry models. The blockchain trigger communicates with a blockchain node, and handles the compilation, deployment as well as interaction with smart contracts.
Figure 2. Graphical Interface of Lorikeet.
Fig. 2 shows the graphical interface for business processes in Lorikeet. Once the user makes changes to the BPMN model on the left-hand side and saves, these are translated to the corresponding Solidity smart contract code which is displayed on the right-hand side. The registry modeller graphical interface is similar to the business process modeller UI, but on the left-hand side, the specification of the registry is done through an interactive form.
Lorikeet is a well-tested development tool that is used for producing blockchain smart contracts in both industry and academia. We have used Lorikeet in collaborations with academics internationally (including from Carnegie Melon University (CMU), the University of Tartu, Estonia, and University of Economics Vienna, Austria) and in student projects. Furthermore, Lorikeet is in commercial use by Data61, and has been applied in numerous industry projects.
 G. P. Release. Gartner survey reveals the scarcity of current blockchain deployments, May 2018. Accessed: 13 July 2018. [Online]. Available: https://www.gartner.com/newsroom/id/3873790.
 D. Siegel. Understanding the dao attack, 2016. Accessed: 13 July 2018. [Online]. Available: http://www.coindesk.com/understanding-dao-hackjournalists
 A. Tran, Q. Lu, I. Weber. Lorikeet: A Model-Driven Engineering Tool for Blockchain-Based Business Process Execution and Asset Management. In BPM’18 Demo Track, 2018.
Dr. Qinghua Lu is a senior research scientist at CSIRO, Australia. Before she joined CSIRO, she was an associate professor at China University of Petroleum. She formerly worked as a researcher at NICTA (National ICT Australia). She received her PhD from University of New South Wales in 2013. Her research interest includes architecture design of blockchain applications, blockchain as a service, model-driven development of blockchain applications, reliability of cloud computing, and service engineering. She has published more than 70 peer-reviewed academic papers in international journals and conferences. She is an IEEE member and serves on the Program Committees of a number of international conferences in blockchain, cloud computing, big data and software engineering community.
Dr. Ingo Weber is a Principal Research Scientist and Team Leader of the Architecture & Analytics Platforms (AAP) team at Data61, CSIRO in Sydney, Australia. In addition, he is a Conjoint Associate Professor at UNSW Australia and an Adjunct Associate Professor at Swinburne University. He has published over 80 refereed papers and two books. His research interests include Blockchain, Systems Operations and DevOps, Business Process Management, Cloud Computing, and Artificial Intelligence / AI Planning. Ingo served as a reviewer for many prestigious journals, including various IEEE and ACM Transactions, and as PC member for WWW, BPM, ICSOC, AAAI, ICAPS, IJCAI, and many other conferences and workshops.
Mark Staples holds a Bachelor of Information Technology (1992) and a Bachelor of Science in Computer Science and Cognitive science (1992) from the University of Queensland, and a Ph.D. in Computer Science (1998) from the University of Cambridge. He is a Senior Principal Research Scientist at Data61 (CSIRO) in Sydney, Australia, and is a Conjoint Associate Professor in the School of Computer Science and Engineering at UNSW. He has previously held roles in industry in software engineering and systems engineering management, in domains ranging from SCADA systems, electronic payments, and implantable active medical devices. His research is on software architecture, blockchain technologies, software engineering, and philosophy of engineering. He is on the Standards Australia committee IT-041 and ISO committee TC307 for standardisation of blockchain and distributed ledger technology.
Dr. Jiang Xiao is currently an associate professor in School of Computer Science and Technology at Huazhong University of Science and Technology (HUST), Wuhan, China. She received the BSc degree from HUST in 2009 and the PhD degree from Hong Kong University of Science and Technology (HKUST) in 2014. She has been engaged in research on wireless indoor localization, smart sensing, big data analysis, and distributed computing. Jiang has directed and participated in many research and development projects and grants from funding agencies such as National Natural Science Foundation of China (NSFC), Hong Kong Research Grant Council (RGC), Hong Kong Innovation and Technology Commission (ITC), and industries like Huawei, Tencent and Intel, and been invited by NSFC in reviewing research projects. Her awards include CCF-Intel Young Faculty Research Program 2017, and Best Paper Awards from IEEE ICPADS/GLOBECOM.
Subscribe to the IEEE Blockchain Technical Briefs
Join our Blockchain Technical Community and receive our Technical Briefs by email.
Article Contributions Welcomed
If you wish to have an article considered for publication, please contact the Managing Editor at
Read the top five most popular IEEE Blockchain Technical Briefs articles of 2018.
Read more (PDF, 731 KB)
IEEE Blockchain Technical Briefs Editorial Board
Chonggang Wang, Editor-in-Chief
Olivia Choudhury, Managing Editor