Designing blockchain-based applications a case study for imported product traceability

https://doi.org/10.1016/j.future.2018.10.010Get rights and content

Abstract

Blockchain technology enables decentralization as new forms of distributed software architectures, where components can reach agreements on the shared system states without trusting on a central integration point. Since blockchain is an emerging technology which is still at an early stage of development, there is limited experience on applying blockchain to real-world software applications. We applied blockchain application design approaches proposed in software architecture community in a real-world project called originChain, which is a blockchain-based traceability system that restructures the current system by replacing the central database with blockchain. In this paper, we share our experience of building originChain. By using blockchain and designing towards security, originChain provides transparent tamper-proof traceability data with high availability and enables automated regulatory-compliance checking and adaptation in product traceability scenarios. We also demonstrate both qualitative and quantitative analysis of the software architecture of originChain. Based on our experience and analysis, we found that the structural design of smart contracts has large impact on the quality of the system.

Introduction

Blockchain technology provides a distributed shared data store and a computational infrastructure. As a data structure, blockchain only allows inserting data without updating or deleting any existing data on the blockchain to prevent tampering and revision. Blockchain enables decentralization as new forms of distributed software architectures [1], where components can reach agreements on the historical shared states for decentralized and transactional data sharing across a large network of participants without relying on a central integration point.

Many banks are involved in trials of the blockchain technology, including through the global R3 consortium1 which is applying blockchain to trade finance and cross-border payments. Financial transactions are the first, but not the only use case being investigated for blockchain. A blockchain implements a distributed ledger, which can verify and store any kind of transactions for general purpose [2]. Many startups, enterprises, and governments [3], [4] are currently exploring blockchain applications in areas as diverse as supply chain, electronic health records, voting, energy supply, ownership management, identity management, and protecting critical civil infrastructure. Blockchain has some unique properties, including immutability, non-repudiation, data integrity, transparency, and equal rights, as well as limitations, for example, privacy and scalability. However, there is a lack of a systematic and holistic view on applying blockchain to design applications for general purposes. To better leverage the unique properties of blockchain, an architectural formalism of blockchain-based applications is needed.

Previous work [1] from software architecture community has characterized blockchain from a software architecture perspective as a software connector [5], providing a shared infrastructure to store data and execute programs (known as smart contracts). However, due to the properties and limitations of blockchain, the technology does not fit all the use cases. First, blockchain has limited storage capability since it contains a full history of all the transactions across all participants of the blockchain network. Second, blockchain applications might have sensitive data, but the information on blockchain is designed to be accessible to all the participants. Third, since all the smart contracts can be called by all the blockchain participants by default, a permission-less function might be triggered by unauthorized users accidentally, which becomes a vulnerability of blockchain-based applications.

Our motivation of this work is to apply the software design approaches for blockchain-based applications [1], [6] into a real world project, originChain, and illustrate how originChain is designed and implemented to fulfill the requirements. We share our experience of building originChain, which restructures a traceability company’s current system by replacing the central database with blockchain. The contribution of this work is the system design of originChain in terms of a set of design decisions we made during implementing the system, and the rationale for our decisions. originChain uses blockchain as a software component in a system, which interacts with other components and databases within the system. By using blockchain and a set of design decisions towards adaptability, originChain provides transparent tamper-proof traceability data with high availability, and enables automated regulatory-compliance checking and adaptation in product traceability scenarios. We have briefly discussed the architecture of orginChain and some lessons learned in [7], this paper presents a more comprehensive architecture of originChain with more detailed design and lessons learned. We also demonstrate qualitative analysis that shows the structural design of smart contract can affect the adaptability of the system, and quantitative analysis that shows writing on blockchain is longer than central database while reading from blockchain is efficient.

The remainder of the paper is organized as follows. Section 2 introduces background of blockchain and blockchain-based applications and related work about design with blockchain. Section 3 discusses the suitability of using blockchain in the context of product traceability. The originChain system is presented in Section 4. Section 5 analyses the architecture of originChain. Section 6 summarizes the lessons learned from this study. Section 7 concludes the paper and outlines the future work.

Section snippets

Blockchain and smart contract

Blockchains that provide a public ledger to store cryptographically-signed financial transactions, are regarded as the first generation of blockchain, like Bitcoin [8]. Such blockchains have very limited capability to support programmable transactions and only allow tiny pieces of data being embedded in the transactions to serve other purposes, for example, representing digital assets or physical assets The second generation of blockchains provide a general-purpose programmable infrastructure,

Product traceability and traceability system

In supply chain, product traceability is the connection of all the processes involved in generating and distributing goods, from raw material to completed products and to consumers in the end. Product suppliers and retailers usually use government-certified independent traceability companies to inspect the products throughout the supply chain. If everything satisfies the requirements and fulfill government standards, the company issues inspection certificates that verify the quality and

Background of originChain

We have an industrial partner, which is an independent third party traceability company. Their traceability system provides information for products imported from overseas to China. The system has been integrated with a large e-commerce company in China and several public service agencies. So far, their traceability services have been used by hundreds of product suppliers and retailers to manage their products, and millions of product consumers to access the traceability information. Each of

Qualitative analysis: adaptability

The structural design of smart contracts affects the upgradability of smart contracts and the adaptability of the whole system. Adaptation scenarios in originChain include adding or removing traceability services from the legal agreement after the legal agreement is signed initially, or dynamic lab binding based on their availability. Such scenarios are supported by smart contracts.

Architectural design of blockchain-based systems

Due to the unique properties of blockchain, there are some blockchain applications specific design considerations, for example, the consideration of on-chain and off-chain, as discussed in the next subsection. On the other hand, because smart contracts are programs running on blockchain, some of the existing architectural design principles might be applicable directly to smart contracts. However, in the case of using a public blockchain, the structural design of the smart contract has large

Conclusion

Design of blockchain-based applications is challenging to developers. In this paper, we share our experience of building orginChain, a blockhain-based product traceability system. We applied the software design approaches we previously proposed into originChain and discussed how originChain is designed using blockchain taking into account the properties and limitations of blockchain. Our analysis shows that the structural design of smart contracts can improve the adaptability of the system, and

Sherry (Xiwei) Xu is a senior research scientist in Architecture & Analytics Platforms (AAP) team at Data61, CSIRO (based in ATP, Sydney). She is also a Conjoint Lecturer at the School of Computer Science and Engineering (CSE) of the University of New South Wales (UNSW). She has a PhD from UNSW. Her main research interest is software architecture. She also does research in the areas of service computing, business process, cloud computing and dependability. She started working on blockchain

References (20)

  • X. Xu, C. Pautasso, L. Zhu, V. Gramoli, A. Ponomarev, A.B. Tran, S. Chen, The blockchain as a software connector, in:...
  • TschorschF. et al.

    Bitcoin and beyond: A technical survey on decentralized digital currencies

    IEEE Commun. Surv. Tutor.

    (2016)
  • Distributed ledger technology: Beyond blockchain, in: Technical Report, 2016. UK Government Chief Scientific...
  • M. Staples, S. Chen, S. Falamaki, A. Ponomarev, P. Rimba, A.B.T.I. Weber, X. Xu, J. Zhu, Risks and opportunities for...
  • N.R. Mehta, N. Medvidovic, S. Phadke, Towards a taxonomy of software connectors, in: ICSE,...
  • S.K. Lo, X. Xu, Y.K. Chiam, Q. Lu, Evaluating suitability of applying blockchain, in: The 22nd International Conference...
  • LuQ. et al.

    Adaptable blockchain-based systems: A case study for product traceability

    IEEE Softw.

    (2017)
  • SwanM.

    Blockchain: Blueprint for a New Economy

    (2015)
  • OmohundroS.

    Cryptocurrencies, smart contracts, and artificial intelligence

    AI Matters

    (2014)
  • WeberI. et al.

    Untrusted business process monitoring and execution using blockchain

There are more references available in the full text version of this article.

Cited by (0)

Sherry (Xiwei) Xu is a senior research scientist in Architecture & Analytics Platforms (AAP) team at Data61, CSIRO (based in ATP, Sydney). She is also a Conjoint Lecturer at the School of Computer Science and Engineering (CSE) of the University of New South Wales (UNSW). She has a PhD from UNSW. Her main research interest is software architecture. She also does research in the areas of service computing, business process, cloud computing and dependability. She started working on blockchain since 2015. She is doing research on blockchain from software architecture perspective, for example, trade-off analysis, decision making and evaluation framework etc.

Dr. Qingghua Lu is s 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. E-mail: [email protected].

Dr/Prof. Liming Zhu is a Research Director at Data61, CSIRO. He is also a conjoint full professor at University of New South Wales (UNSW). He is the chairperson of Standards Australia’s blockchain and distributed ledger committee. His research program has more than 200 people innovating in the area of big data platforms, computational science, blockchain, regulation technology, privacy and cybersecurity. He has published more than 150 academic papers on software architecture, secure systems and data analytics infrastructure.

View full text