Architectural Patterns for Blockchain Systems and Application Design
Abstract
:1. Introduction
- A collection of 12 software architectural patterns to support the design of blockchain system architectures. These patterns are discovered from our study of 400 real-world blockchain applications from different open-source blockchain platforms [17]. These patterns are interconnected, as each describes one aspect of a blockchain architectural design. Collectively, these patterns describe a blockchain architecture from different architectural views: structural, interactional, transactional, and security.
2. Related Work
3. Pattern Identification
3.1. Blockchain Application Selection
3.2. Application Analysis
- 1.
- Smart contract. These are programmable commands that can transfer digital assets between parties in a predictable and transparent way [33]. A smart contract is written in a platform-specific language, such as Solidity for Ethereum. Some platforms allow only users to command pre-built smart contract modules, such as Hyperledger Iroha, whereas others, such as EOS, allow for both pre-built and programmed smart contracts [3].
- 2.
- Token. Tokens are cryptographic assets that may represent cryptocurrencies or real-world objects [34,35]. Tokens are primarily native—protocol—or application tokens. A native token is part of a blockchain platform’s protocol, such as Ether in Ethereum. Application tokens are second-layer tokens that are programmed through smart contracts for specific use cases [3].
- 3.
- Digital wallet. A digital wallet stores and manages digital keys and cryptocurrencies and can be implemented in various forms, such as hardware, paper, desktop, mobile, web, browser-based, smart contract wallets, etc. A digital wallet can be embedded within a blockchain application as a primary service or can be a stand-alone application [3].
- 4.
- Permission management. This component is responsible for authorizing access to other blockchain components, such as joining the network, invoking smart contracts, and reading from or writing to ledgers. A permission component is essential in consortium and private networks to encapsulate transactions and data within the consortia and to maintain data privacy between consortia members themselves, as each member should have access to specific data only [3,34,35].
- 5.
- Incentive mechanism. Primarily, this mechanism applies to public blockchains where peer nodes are incentivized to contribute to the blockchain network, such as mining blocks [34]. The incentive mechanism consists of the system fee and reward components. The system fee is payable by the users of a blockchain application to the system, whereas the reward is payable by the system to the miners [3].
- 6.
- Ledger. The distributed ledgers serve as record keepers for all transactions that occur in the network. They are synchronized between the involved peers [34,35,36,37]. There are mainly two architectures of distributed ledgers: single- and multi-ledger. Moreover, distributed ledgers could be a chain of blocks, a chain of transactions, a Direct Acyclic Graph (DAG) of blocks, or a DAG of transactions [3,38].
- 7.
- Consensus. Consensus mechanisms are used to agree on the validity of transactions between trustless entities in a blockchain network. Different consensus mechanisms have been applied in public and private network settings [39], including computation-based protocols, such as PoW, and voting-based protocols, such as PBFT. Other algorithms, such as PoS and DPoS, attempt to overcome the power-intensiveness limitation of computation-based algorithms in public networks [3]. Consensus mechanisms have a significant impact on the performance of a blockchain network [40].
- 8.
- Peer-to-Peer (P2P) network. A blockchain network is a communication medium that allows participants to communicate in a P2P manner [16,34,35]. There are three main types of blockchain networks: public, private, and consortium. Public blockchains are permissionless networks that offer equal rights to all peers to read from and write to the distributed ledger. Private blockchains encapsulate transactions and data within a single organization. Read and write privileges are managed using a permission management component. An extension of this private setting allows multiple organizations to participate as a consortium [3].
- 9.
- Node. Nodes are the hardware and software representations of users participating in a blockchain network and can be any electronic device with the required technical specifications. Three main types of nodes perform ledger-oriented operations: full, pruned, and lightweight nodes. Full and pruned nodes participate in transaction validation and block generation, while lightweight nodes store only transaction headers and do not participate in consensus and block generation processes. Service nodes may also be used to coordinate the general workflow between other nodes [3].
- 10.
- End user interface. Through this, users can initiate transactions and see the query results of blockchain data. The end user interface can be a graphical user interface (GUI) or a command-line interface (CLI).
- 11.
- Database. These data stores are used to store off-chain data and can be centralized or decentralized. They provide a solution for data privacy and blockchain scalability [34].
- 12.
- Server. Typically, servers are used to host UIs. The hosts can be centralized servers or decentralized hosting services.
- 13.
- API. This component is responsible for passing messages between the client application on one side and the blockchain network endpoints on the other side. For example, the JavaScript Object Notation encoded messages protocol (JSON-RPC) is used by the Ethereum, POA, Klaytn, EOS, Steem, and Hive platforms.
3.3. Mapping Components and Characteristics to Software Patterns
- The N-Tier pattern divides an application into multiple layers or tiers. Each tier has a particular responsibility, and communication happens between them through well-defined interfaces. In the context of blockchain systems, the components are mainly on two tiers: on-chain and off-chain. Each tier has its variations of architectures.
- The Peer-to-Peer (P2P) architecture relies on a distributed network of nodes that communicate directly with each other to exchange data [15]. The network component of the blockchain is responsible for facilitating communication and transactions between participants in a decentralized manner. All communication happens through the network, eliminating the need for a centralized server or authority.
- In the Layer architectural pattern, an application is divided into multiple layers, each with a specific function [15]. In the context of blockchain systems, the pattern provides a framework to ensure the separation of concerns, promote reusability, and facilitate testing and debugging.
- The Shared Repository pattern is responsible for storing data and ensuring data consistency across a network [15]. In blockchain systems, the ledger is a distributed database that maintains a record of all transactions across the network. It is not only shared, but is also immutable and replicated across the network. Each validation node has an identical copy of the ledger. The pattern provides a standardized method for maintaining a reliable and secure distributed ledger.
- The Broker pattern uses decentralized mechanisms for secure communication between nodes and actors in a system. It involves components acting as message producers, brokers, and clients [15]. In the context of blockchain systems, every node within the network has the capability to act as a producer or a consumer of messages, determined by whether, for example, it submits transactions or receives blocks from the network.
- The Pipe-Filter pattern represents a processing pipeline in which data flow through a series of filters, with each filter transforming the data in some way [15]. In blockchain systems, it ensures the authenticity of transactions and identifies potential threats. The ledger, consensus, and smart contract stream transactions through a series of filters to extract data and detect suspicious activity.
- The Access Control patterns involve methods such as authentication and authorization to ensure that only authorized individuals have access to the system’s resources [42]. The digital wallet, incentive mechanism, and permission management aim to protect blockchain systems from various types of threats. They provide an extra protection layer by offering authentication, encryption, and authorization for users.
3.4. Pattern Organization
- 1.
- Structural view: This view abstracts the logical and physical dissemination of the blockchain application components.
- 2.
- Interactional view: This view abstracts how the individual components of a blockchain application can exchange messages while retaining their autonomy.
- 3.
- Transactional view: This view abstracts how blockchain application components successively process transactions as persistent, immutable, shared data.
- 4.
- Security view: This view abstracts how blockchain systems implement security and privacy mechanisms to protect user data, prevent unauthorized access, and maintain privacy.
4. Pattern Description
4.1. Structural View Patterns
4.1.1. On-Chain-Off-Chain Pattern
- Summary: This pattern addresses the physical organization of blockchain system components as a multi-tier system.
- Context: A software system utilizes blockchain technology.
- Solution: This architecture provides a global view of blockchain applications. A blockchain application is separated into five logical and physical tiers, as shown in Figure 1. First, the presentation tier hosts the application front-end and handles the static and dynamic presentation of the user interface. It can be a remote web server or a local device, such as a smartphone or wearable. Second, the off-chain logical tier coordinates the interaction between the off-chain data and presentation tiers. It performs off-chain computation and business logic on data collected from the presentation tier, and passes data from and to the off-chain data tier. Source code files can be written in conventional server-side languages and run in dedicated frameworks. Third, the off-chain data tier is where off-chain data are stored and retrieved from to the off-chain logic tier and, eventually, to the presentation tier. It can be a database or a file system. Fourth, smart contracts perform on-chain computations and business logic through the on-chain logical tier. Finally, the on-chain data tier stores on-chain data in distributed ledgers. This architectural pattern is sophisticated in that each tier has several variant architectures.
- Known uses: Dtube is a video-sharing application. It consists of presentation and off-chain logic tiers as a web application hosted on a centralized server, an off-chain data tier that adopts centralized and distributed third-party data stores, and on-chain logic and data tiers hosted on the Steem and Hive blockchains. PUML is a health and fitness loyalty program. It consists of presentation and off-chain logic tiers combined in a mobile application hosted on users’ mobile devices, as well as an off-chain data tier that adopts third-party data stores. PUML’s on-chain logic and data tiers are hosted on the EOS blockchain and PUML’s private side chain. CryptoFlip Cars is a card-trading game application. It consists of presentation, off-chain data, and off-chain logic tiers combined as a web application hosted on a centralized server. The application’s on-chain logic and data tiers are hosted on the Ethereum blockchain.
- Related patterns: Communication between the off-chain and on-chain components is achieved through the blockchain broker pattern. The on-chain tier is depicted in the P2P on-chain pattern, whereas the off-chain tier is illustrated by the distributed off-chain and centralized off-chain patterns.
4.1.2. P2P On-Chain Pattern
- Summary: This pattern addresses concerns regarding the decentralized communication of back-end components within the internal environment of the blockchain.
- Context: A software system utilizes blockchain technology.
- Solution: This is the typical architecture of blockchain systems, as shown in Figure 2. A blockchain network consists of multiple decentralized peer nodes, in which each node has the same capabilities and responsibilities. For example, blockchain participants have equal reading and writing rights to the blockchain distributed ledger. However, permission components can manage these rights in certain cases. The propagation of blocks and transactions typically follows a gossip strategy. There are different protocols adopted by blockchain networks to manage the propagation of data between peers. For example, Ethereum Mainnet nodes run different protocols, such as the Light Ethereum Subprotocol (LES) used by lightweight clients and the Ethereum Wire Protocol (ETH) used by full nodes. Hyperledger Fabric implements a data dissemination protocol based on gRPC and protocol buffers.
- Known uses: Dtube is a video-sharing application. Its on-chain back-end is the Steem blockchain, which is a P2P network. PUML is a health and fitness loyalty program. Its on-chain back-end comprises the EOS blockchain and PUML sidechain, which are P2P networks. CryptoFlip Cars is a card-trading game application. Its on-chain back-end is the Ethereum blockchain, which is a P2P network.
- Related patterns: This pattern complements the on-chain-off-chain, distributed off-chain, and centralized off-chain patterns.
4.1.3. Distributed Off-Chain Pattern
- Summary: This pattern addresses concerns regarding the decentralized communication of back-end components within the external environment of the blockchain.
- Context: A blockchain application utilizes off-chain services as a distributed system.
- Solution: Off-chain back-end servers provide their services through distributed servers to distribute access to web apps and off-chain data, as shown in Figure 3. For example, a blockchain application may use an off-chain P2P file system, such as the BitTorrent File System (BTFS) and Interplanetary File System (IPFS), for web hosting and data storage. Instead, the application may utilize a P2P file-sharing system for either web hosting or data storage and use a centralized server for the other as a three-tier client–server architecture.
- Known uses: Aragon is an Ethereum-based service for the creation of Decentralized Autonomous Organizations (DAOs) that uses IPFS for their data. Augur is an Ethereum-based marketplace that uses IPFS for client application hosting and distribution. Dtube is a Steem-based video-sharing platform that uses IPFS and BTFS for users’ video hosting.
- Related patterns: This pattern complements the P2P on-chain and on-chain-off-chain patterns.
4.1.4. Centralized Off-Chain Pattern
- Summary: This pattern addresses concerns regarding the centralized communication of back-end components within the external environment of the blockchain.
- Context: A blockchain application utilizes off-chain services as a centralized system.
- Solution: Off-chain back-end servers provide their services through centralized server machines, as shown in Figure 4. For example, a blockchain application may use a single server for the off-chain application front-end and data or can use separate servers for each as a three-tier client–server architecture.
- Known uses: CryptoFlip Cars is an Ethereum-based game that uses centralized servers for web hosting and data storage. Dtube uses centralized servers for web hosting and data storage. Geon is a POA-based mobile game hosted locally by mobile device users.
- Related patterns: This pattern complements the P2P on-chain and on-chain-off-chain patterns.
4.2. Interactional View Patterns
4.2.1. Blockchain Broker Pattern
- Summary: This pattern addresses concerns about communicating the decoupled components of a blockchain application as a distributed system.
- Context: A blockchain application consists of decoupled off-chain and on-chain components.
- Solution: The blockchain broker enables communication between the decoupled components in distributed systems. Each node in the network can act as a message producer or consumer, depending on whether it submits transactions or receives blocks from the network. For example, smart contracts can act as message brokers by enabling communication and coordination between different nodes. Digital wallets and APIs can act as message clients that consume messages from the network and perform various actions based on them, such as updating balances, providing market data, and providing services to third-party applications or users. As shown in Figure 5, there are two types of blockchain brokers:
- 1.
- Side-chain broker: By design, blockchains are heterogeneous and not able to communicate with each other since each blockchain has its own set of rules and tools that make communication difficult. A side-chain broker allows blockchain interoperability through cross-chain bridges. It enables the transfer of assets between one blockchain (on-chain) and another (side-chain). Typically, a side-chain broker involves locking or burning tokens through a smart contract on the source chain and unlocking or minting equivalent tokens on the destination chain through another smart contract.
- 2.
- Off-chain broker: This type of service communicates among blockchain and client applications. A client API handles the input from the client UI and passes it to a dedicated blockchain endpoint. The blockchain endpoint node passes the input data to the blockchain and returns output data to the client API, which, in turn, passes the data to the UI. The client API and blockchain endpoint API are service broker components that connect off-chain and on-chain components.
- Known uses: Dtube is a Steem-based video-sharing application. It uses the JSON-RPC web service and the RPC endpoint of Steem’s public service node to communicate the off-chain components with the Steem blockchain. CryptoFlip Cars is an Ethereum-based game application. It uses the JSON-RPC web service and the RPC endpoint of Ethereum public nodes to communicate the off-chain components with the Ethereum blockchain. PUML is a health and fitness loyalty program. It uses the JSON-RPC web service and the RPC endpoint of EOS public nodes to communicate the off-chain components with the EOS blockchain and the PUML side chain.
- Related patterns: This pattern shows how the different tiers in the on-chain-off-chain pattern are connected.
4.2.2. Layered Application Pattern
- Summary: This pattern addresses the decomposition of blockchain application components into interacting parts as complex, heterogeneous entities.
- Context: A software application utilizes blockchain technology.
- Solution: A blockchain application can be represented in a generic layered architecture, as shown in Figure 6. A typical blockchain application architecture consists of the following layers:
- Application layer: This layer represents the use cases of blockchain applications, such as intelligent transportation, supply chain traceability, artificial intelligence, robotics, unmanned aerial vehicles, intelligent manufacturing, business process management, enterprise transformation, insurance processing, risk management, cryptocurrency exchange, games, gambling, social networking, community reputation systems, rights management, and data ownership.
- Presentation layer: This layer is related to front-end components that can interact with the blockchain layer via client APIs. This layer consists of a typical UI and digital wallet. It serves the purpose of providing an intuitive way for end-users to use blockchain applications. A digital wallet stores and manages digital keys and crypto assets in a blockchain system [3].
- Business logic layer: This layer handles the on-chain computations of the system. An essential component is a smart contract. The other components within this layer are smart contract wallets and application tokens. It also consists of web services to connect the presentation layer with the blockchain layer.
- Blockchain layer: The blockchain layer includes the actual blockchain network itself, which is composed of nodes, consensus algorithms, and the blockchain ledger. This layer is responsible for maintaining the integrity and security of the blockchain network and handles data storage, transaction validation, and other core blockchain functions.
- Support layer: This layer provides supportive services for other layers. Hosting services and external storage services are required for hosting and operating client applications. This layer also provides IoT-related services, such as processing and analyzing sensor data and transferring them to other layers.
- Security and privacy layer: This layer provides security services to the applications and users. It provides user authentication, membership management, access control, and permission management components. These components are responsible for authorizing access to other blockchain components, such as joining the network, invoking smart contracts, and reading from or writing to ledgers.
- Known uses: Dtub is a Steem-based video-sharing application that rewards users for sharing their content and commenting on and upvoting others’ content. KYC-Chain is an Ethereum-based customer onboarding application for verifying customers’ identities and managing the customer lifecycle. Hawk E-Scooter is a Klaytn-based decentralized, shared scooter travel platform.
- Related patterns: This pattern shows how the different layers in the on-chain-off-chain pattern are connected.
4.3. Transactional View Patterns
4.3.1. On-Chain Pipe-Filter Pattern
- Summary: This pattern addresses concerns regarding how data are transferred from a client to a shared ledger while retaining data integrity and confidentiality.
- Context: A software application utilizes blockchain services as a distributed ledger.
- Solution: Data in the blockchain are processed in the form of transactions. A transaction is a single instruction constructed and cryptographically signed by a client external to the scope of the blockchain. The process of adding new transactions to the ledger is a Pipe-Filter architecture, as shown in Figure 7. A transaction passes several filters (validators/miners) from the client (source) to the ledger (sink). The number and types of filters differ among blockchain systems. Initially, a transaction must be cryptographically signed at the client application using the user’s private key. The signed transactions then enter a pending pool. They are then filtered by validators/miners. Subsequently, a certain number of valid transactions are bundled into a block. The block size determines the number of transactions included within a block. The block size also differs between the blockchain systems. Finally, a valid block is added to the ledger and synchronized with all participants.
- Known uses: Transactions of Ethereum-based applications are submitted to Ethereum’s pending transaction pool and then validated by miners, who are rewarded for generating new blocks. Transactions of Hyperledger Fabric-based applications are validated by endorsing, ordering, and committing peers. Transactions of Steem-based applications are submitted to Steem’s pending transaction pool and then validated by witnesses, who are rewarded for producing new blocks.
- Related patterns: The generated blocks can be linked as in the chain-of-blocks pattern.
4.3.2. Replicated Repository Pattern
- Summary: This pattern addresses concerns regarding distributing on-chain data as a replicated ledger.
- Context: A software application utilizes blockchain services as a distributed ledger.
- Solution: A blockchain is a digital archive of transactions that are replicated and broadcast across the blockchain network nodes. Every time a new block is committed, a copy of this block is added to the ledgers of the other participants, as shown in Figure 8. Because each participant, with the exception of light clients, has its copy, ledgers on the blockchain are replicated rather than shared. Although nominated public nodes share their replications with other nodes and clients in permissionless networks, any newly added block is replicated and broadcast among all network participants. Reading from and writing to these replications is permitted equally among all the nodes in the network. In permissioned networks, broadcasting is performed for a subset of the network participants based on their granted permissions. This permission-based replication allows complex ledger structures in enterprise applications. In such cases, each member in a consortium has a digital ledger, and any subset of members of the consortium can have a mutual replication. Finally, there is a master replication among all the consortium members. The replicated records are also at varying transparencies to ensure data confidentiality in the private environment.
- Known uses: The Ethereum network is permissionless, and its digital ledger is replicated among all Ethereum nodes as a single-ledger-based architecture. The Hyperledger Fabric network is permissioned, and its digital ledger is replicated per channel, allowing for a multi-ledger-based architecture. The Corda network is permissioned and allows for shared ledger structures.
- Related patterns: The data in a replicated ledger can be linked, as in the chain-of-blocks pattern.
4.3.3. Chain-of-Blocks Pattern
- Summary: This pattern addresses concerns regarding structuring on-chain data.
- Context: A software application utilizes blockchain services as a distributed ledger.
- Solution: Confirmed transactions in the blockchain are grouped into blocks. Each block has a unique number, known as the block height. A block typically consists of two parts common to all blockchains: a block header and block data. The block header contains, among other information, a link to its preceding block, which allows the blocks to be chained in a strict order. Such a link is typically a hash of the preceding block. A block hash is cryptographically derived from the block’s data. The block data contain a list of confirmed transactions. Thus, a block can be searched for by its block number or hash. Additional parts are customized per blockchain platform for the block structure. Usually, these data are not included in the block hash calculation. The time interval, or block interval, is the time allowed to add a new block to the chain. This time differs between blockchain systems based on the blockchain protocol specifications. For example, Steem produces blocks every three seconds. Figure 9 illustrates this pattern.
- Known uses: Ethereum is chain-based, and its block structure consists of a block header, block data, and a list of ommers. The blocks are connected to a single chain. Hyperledger Fabric is chain-based, and its block structure consists of a block header, data, and metadata. The blocks are connected to a restricted shared chain. Klaytn is chain-based, and its block structure consists of a block header, block data, and a list of uncles. The blocks are connected to a single chain.
- Related patterns: The chain of blocks in the blockchain is synchronized between the network participants as a replicated repository pattern. When more than one block has the same block height, i.e., they are mined at nearly the same time, there could be a chain fork pattern.
4.3.4. Chain Fork Pattern
- Summary: This pattern addresses concerns regarding structuring on-chain data in conflict.
- Context: A software application utilizes blockchain services as a distributed ledger.
- Solution: To create a blockchain, the chain of blocks receives information from the blocks that preceded them. The block relationship can be viewed as a parent–child relationship, where each parent block has one child. The hash of the parent block is included in the header of the child block. Blockchain participants must follow common rules to maintain the history of the blockchain. When the participants are not in agreement or the rules are changed, alternative chains may emerge as chain forks. A chain fork occurs by splitting a chain of blocks into two paths. There are two main methods for such a split, as shown in Figure 10.
- Known uses: Ethereum was forked into Ethereum Classic (old) and Ethereum (new) as a protocol-level split. Hive is forked from Steem as a protocol-level split. Dtube is a Steem-based video-sharing application that runs on both blockchains: Steem and its forked chain, Hive.
- Related patterns: The forked chain is a chain of blocks synchronized between the network participants as a replicated repository pattern.
4.4. Security View Patterns
4.4.1. Incentivized Contribution
- Summary: This pattern addresses concerns regarding enhancing the security and increasing the overall health of the blockchain network by motivating users.
- Context: A blockchain system that requires from users significant resources or poses risks, such as energy consumption or hardware maintenance.
- Solution: Incentivizing users can increase the likelihood of active participation and improve the performance and security of the blockchain system. As shown in Figure 11, developers can design a reward mechanism that distributes tokens, privileges, or reputational benefits to users who actively contribute to the system. By rewarding honest behavior, incentive mechanisms encourage network participants to act honestly and discourage malicious actions. By providing rewards for nodes that validate transactions, participants are incentivized to agree on a single version of the distributed ledger, increasing the security of the network. Moreover, incentive mechanisms can prevent Sybil attacks by requiring network participants to stake or lock up a certain amount of cryptocurrency as collateral, making it expensive and difficult for attackers to create multiple fake identities to manipulate the network. These mechanisms can encourage network growth, which helps to maintain the security of the network by ensuring that there are sufficient resources to defend against cyber-attacks and by making it more challenging for attackers to compromise the system.
- Known uses: The Ethereum blockchain rewards miners with ether tokens for processing and validating smart contracts and transaction blocks. The amount of reward depends on the level of computing power provided by the miner, as well as the gas fees paid by the users. Steemit is a social media platform that incentivizes users to create and curate content by rewarding them with STEEM tokens based on the popularity and quality of their contributions. The STEEM tokens can be exchanged for other cryptocurrencies or fiat currencies or can be used to vote on proposals and decisions related to the Steemit ecosystem. Such participation contributes to the security of the Steem blockchain. Augur is a prediction market that incentivizes users to report on the outcomes of events and bets made on the platform. Users who report correctly on the outcomes can earn reputation tokens, which can be used to participate in the governance and dispute resolution processes of the platform. Such participation contributes to the security of the Ethereum blockchain.
4.4.2. Crypto Shield
- Summary: This pattern addresses concerns regarding the security and privacy of blockchain network applications through authentication, authorization, and encryption.
- Context: A software application utilizes blockchain technology.
- Solution: Digital wallets play an essential role in safeguarding blockchain applications by offering a permission mechanism for authentication, encryption, and authorization for users, as shown in Figure 12. This function reduces the chances of fraud and protects against cyber-threats. They authenticate users’ identities by utilizing digital signatures, while encryption secures the transaction data and digital assets transmitted to and from the wallet. Additionally, digital wallets only allow authorized personnel to access and manage digital assets, ensuring that they remain secure. Furthermore, they restrict unauthorized access to blockchain applications by only permitting authorized users to initiate transactions. Digital wallets also ensure privacy by offering pseudonymous identities for the blockchain users.
- Known uses: Dtube uses the Steemit wallet to secure access to the Steem network. MetaMask is a browser extension wallet that provides authentication and encryption for users utilizing the Ethereum blockchain. MyEtherWallet is a software wallet that utilizes encryption, authentication, and authorization for users utilizing the Ethereum blockchain.
5. Pattern Demonstration
5.1. Component Structure Design
5.2. Component Interaction Design
5.3. Transactional Design
5.4. Security Design
6. Discussion
7. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Narayanan, A.; Bonneau, J.; Felten, E.; Miller, A.; Goldfeder, S. Bitcoin and Cryptocurrency Technologies: A Comprehensive Introduction; Princeton University Press: Princeton, NJ, USA, 2016. [Google Scholar]
- Nakamoto, S. Bitcoin: A peer-to-peer electronic cash system. Decentralized Bus. Rev. 2008. Available online: https://assets.pubpub.org/d8wct41f/31611263538139.pdf (accessed on 22 September 2023).
- Alzhrani, F.E.; Saeedi, K.A.; Zhao, L. A Taxonomy for Characterizing Blockchain Systems. IEEE Access 2022, 10, 110568–110589. [Google Scholar] [CrossRef]
- Casino, F.; Dasaklis, T.K.; Patsakis, C. A systematic literature review of blockchain-based applications: Current status, classification and open issues. Telemat. Inform. 2019, 36, 55–81. [Google Scholar] [CrossRef]
- Bodkhe, U.; Tanwar, S.; Parekh, K.; Khanpara, P.; Tyagi, S.; Kumar, N.; Alazab, M. Blockchain for Industry 4.0: A Comprehensive Review. IEEE Access 2020, 8, 79764–79800. [Google Scholar] [CrossRef]
- Sharma, P.K.; Park, J.H. Blockchain based hybrid network architecture for the smart city. Future Gener. Comput. Syst. 2018, 86, 650–655. [Google Scholar] [CrossRef]
- Cai, W.; Wang, Z.; Ernst, J.B.; Hong, Z.; Feng, C.; Leung, V.C.M. Decentralized Applications: The Blockchain-Empowered Software System. IEEE Access 2018, 6, 53019–53033. [Google Scholar] [CrossRef]
- Zheng, Z.; Xie, S.; Dai, H.N.; Chen, X.; Wang, H. Blockchain challenges and opportunities: A survey. Int. J. Web Grid Serv. 2018, 14, 352–375. [Google Scholar] [CrossRef]
- Monrat, A.A.; Schelén, O.; Andersson, K. A Survey of Blockchain From the Perspectives of Applications, Challenges, and Opportunities. IEEE Access 2019, 7, 117134–117151. [Google Scholar] [CrossRef]
- Yang, X.; Zhao, L.; Wang, X.; Wang, Y.; Sun, J.; Cristoforo, A.J. Satisfying quality requirements in the design of a partition-based, distributed stock trading system. Softw. Pract. Exp. 2012, 42, 131–157. [Google Scholar] [CrossRef]
- Garlan, D. Software Architecture: A Travelogue. In Proceedings of the Future of Software Engineering Proceedings, FOSE 2014; Association for Computing Machinery: New York, NY, USA, 2014; pp. 29–39. [Google Scholar] [CrossRef]
- Monroe, R.T.; Kompanek, A.; Melton, R.; Garlan, D. Architectural styles, design patterns, and objects. IEEE Softw. 1997, 14, 43–52. [Google Scholar] [CrossRef]
- Zdun, U.; Avgeriou, P. Modeling architectural patterns using architectural primitives. ACM SIGPLAN Not. 2005, 40, 133–146. [Google Scholar] [CrossRef]
- Garlan, D. Software architecture: A roadmap. In Proceedings of the ICSE ’00: Conference on the Future of Software Engineering, Limerick, Ireland, 4–11 June 2000; pp. 91–101. [Google Scholar] [CrossRef]
- Avgeriou, P.; Zdun, U. Architectural patterns revisited—A pattern language. In Proceedings of the Tenth European Conference on Pattern Languages of Programs (EuroPLoP 2005), Irsee, Germany, 6–10 July 2005; pp. 431–470. [Google Scholar]
- Syed, T.A.; Alzahrani, A.; Jan, S.; Siddiqui, M.S.; Nadeem, A.; Alghamdi, T. A comparative analysis of blockchain architecture and its applications: Problems and recommendations. IEEE Access 2019, 7, 176838–176869. [Google Scholar] [CrossRef]
- Alzhrani, F. A Collection of Industry-Developed Blockchain-Based Applications. Zenodo CERN 2020. [Google Scholar] [CrossRef]
- ISO 23257:2022(E); Blockchain and Distributed Ledger Technologies—Reference Architecture. ISO: Geneva, Switzerland, 2022.
- Deng, X.; Huang, W.; Tang, X.; Basic Technology. Blockchain Application Guide: Methodology and Practice; Springer Nature Singapore: Singapore, 2022; pp. 3–17. [Google Scholar] [CrossRef]
- Xu, X.; Weber, I.; Staples, M.; Zhu, L.; Bosch, J.; Bass, L.; Pautasso, C.; Rimba, P. A Taxonomy of Blockchain-Based Systems for Architecture Design. In Proceedings of the 2017 IEEE International Conference on Software Architecture (ICSA), Gothenburg, Sweden, 3–7 April 2017; pp. 243–252. [Google Scholar] [CrossRef]
- Yánez, W.; Bahsoon, R.; Zhang, Y.; Kazman, R. Architecting Internet of Things Systems with Blockchain: A Catalog of Tactics. ACM Trans. Softw. Eng. Methodol. 2021, 30, 1–46. [Google Scholar] [CrossRef]
- Wöhrer, M.; Zdun, U. Architectural Design Decisions for Blockchain-Based Applications. In Proceedings of the 2021 IEEE International Conference on Blockchain and Cryptocurrency (ICBC), Dubai, United Arab Emirates, 3–6 May 2021; pp. 1–5. [Google Scholar] [CrossRef]
- Liu, Y.; Lu, Q.; Yu, G.; Paik, H.Y.; Zhu, L. A Pattern-Oriented Reference Architecture for Governance-Driven Blockchain Systems. In Proceedings of the 2023 IEEE 20th International Conference on Software Architecture (ICSA), L’Aquila, Italy, 13–17 March 2023; pp. 23–34. [Google Scholar] [CrossRef]
- Zhang, Q.; Lv, H.; Ma, J.; Li, J.; Zhang, J. Overview of Blockchain Data Privacy Protection. In Proceedings of the BIOTC’21: 2021 3rd Blockchain and Internet of Things Conference, BIOTC’21, Ho Chi Minh City, Vietnam, 8–10 July 2021; Association for Computing Machinery: New York, NY, USA, 2021; pp. 53–58. [Google Scholar] [CrossRef]
- Zimmermann, H. OSI Reference Model—The ISO Model of Architecture for Open Systems Interconnection. IEEE Trans. Commun. 1980, 28, 425–432. [Google Scholar] [CrossRef]
- Weber, I.; Lu, Q.; Tran, A.B.; Deshmukh, A.; Gorski, M.; Strazds, M. A Platform Architecture for Multi-Tenant Blockchain-Based Systems. In Proceedings of the 2019 IEEE International Conference on Software Architecture (ICSA), Hamburg, Germany, 25–29 March 2019; pp. 101–110. [Google Scholar] [CrossRef]
- Wan, Z.; Xia, X.; Hassan, A.E. What Do Programmers Discuss About Blockchain? A Case Study on the Use of Balanced LDA and the Reference Architecture of a Domain to Capture Online Discussions about Blockchain Platforms across Stack Exchange Communities. IEEE Trans. Softw. Eng. 2021, 47, 1331–1349. [Google Scholar] [CrossRef]
- Gupta, R.; Bhattacharya, P.; Tanwar, S.; Kumar, N.; Zeadally, S. GaRuDa: A Blockchain-Based Delivery Scheme Using Drones for Healthcare 5.0 Applications. IEEE Internet Things Mag. 2021, 4, 60–66. [Google Scholar] [CrossRef]
- Min, T.; Wang, H.; Guo, Y.; Cai, W. Blockchain Games: A Survey. In Proceedings of the 2019 IEEE Conference on Games (CoG), London, UK, 20–23 August 2019; pp. 1–8. [Google Scholar] [CrossRef]
- Qasse, I.A.; Spillner, J.; Abu Talib, M.; Nasir, Q. A Study on ĐApps Characteristics. In Proceedings of the 2020 IEEE International Conference on Decentralized Applications and Infrastructures (DAPPS), Oxford, UK, 3–6 August 2020; pp. 88–93. [Google Scholar] [CrossRef]
- Zeng, Y.; Zhang, Y. Review of research on blockchain application development method. J. Phys. Conf. Ser. 2019, 1187, 052005. [Google Scholar] [CrossRef]
- Wu, K.; Ma, Y.; Huang, G.; Liu, X. A first look at blockchain-based decentralized applications. Softw. Pract. Exp. 2021, 51, 2033–2050. [Google Scholar] [CrossRef]
- Zheng, Z.; Xie, S.; Dai, H.N.; Chen, W.; Chen, X.; Weng, J.; Imran, M. An overview on smart contracts: Challenges, advances and platforms. Future Gener. Comput. Syst. 2020, 105, 475–491. [Google Scholar] [CrossRef]
- Xu, X.; Weber, I.; Staples, M. Architecture for Blockchain Applications; Springer: Berlin/Heidelberg, Germany, 2019; p. 307. [Google Scholar] [CrossRef]
- Dinh, T.T.A.; Liu, R.; Zhang, M.; Chen, G.; Ooi, B.C.; Wang, J. Untangling Blockchain: A Data Processing View of Blockchain Systems. IEEE Trans. Knowl. Data Eng. 2018, 30, 1366–1385. [Google Scholar] [CrossRef]
- Pervez, H.; Muneeb, M.; Irfan, M.U.; Haq, I.U. A Comparative Analysis of DAG-Based Blockchain Architectures. In Proceedings of the 2018 12th International Conference on Open Source Systems and Technologies (ICOSST), Lahore, Pakistan, 19–21 December 2018; pp. 27–34. [Google Scholar] [CrossRef]
- Paik, H.Y.; Xu, X.; Bandara, H.M.N.D.; Lee, S.U.; Lo, S.K. Analysis of Data Management in Blockchain-Based Systems: From Architecture to Governance. IEEE Access 2019, 7, 186091–186107. [Google Scholar] [CrossRef]
- Kannengießer, N.; Lins, S.; Dehling, T.; Sunyaev, A. Trade-Offs between Distributed Ledger Technology Characteristics. ACM Comput. Surv. 2020, 53, 1–37. [Google Scholar] [CrossRef]
- Jennath, H.S.; Asharaf, S. Survey on Blockchain Consensus Strategies. In Proceedings of the ICDSMLA 2019: 1st International Conference on Data Science, Machine Learning and Applications; Springer: Singapore, 2019; pp. 637–654. [Google Scholar] [CrossRef]
- Ismail, L.; Materwala, H. A Review of Blockchain Architecture and Consensus Protocols: Use Cases, Challenges, and Solutions. Symmetry 2019, 11, 1198. [Google Scholar] [CrossRef]
- Jaiswal, M. Software architecture and software design. Int. Res. J. Eng. Technol. (IRJET) e-ISSN 2019, 6, 2452–2454. [Google Scholar] [CrossRef]
- Hafiz, M.; Adamczyk, P.; Johnson, R.E. Organizing Security Patterns. IEEE Softw. 2007, 24, 52–60. [Google Scholar] [CrossRef]
- Harrison, N.B.; Avgeriou, P. How do architecture patterns and tactics interact? A model and annotation. J. Syst. Softw. 2010, 83, 1735–1758. [Google Scholar] [CrossRef]
BC Components | SW Arch. Patterns | BC Arch. Patterns |
---|---|---|
All components | N-Tier | - On-Chain-Off-Chain
- Distributed Off-Chain - Centralized Off-Chain |
Network, nodes, permission management | Peer-to-Peer (P2P) | - P2P On-Chain |
Ledger, consensus | Shared Repository | - Replicated Repository
- Chain-of-Blocks - Chain Fork |
Node, API, smart contract, digital wallet | Broker | - Blockchain Broker |
Ledger, consensus, token, smart contract, incentive mechanism, permission management | Pipe-Filter | - On-Chain Pipe-Filter
- Incentivized Contribution |
All components | Layer | - Layered Application |
Permission management, digital wallet | Access Control | - Crypto Shield |
Architectural View | Proposed Patterns |
---|---|
Structural | - On-Chain-Off-Chain - Distributed Off-Chain - Centralized Off-Chain - P2P On-Chain |
ine Interactional | - Blockchain Broker - Layered Application |
ine Transactional | - On-Chain Pipe-Filter - Replicated Repository - Chain-of-Blocks - Chain Fork |
ine Security | - Incentivized Contribution - Crypto Shield |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Alzhrani, F.; Saeedi, K.; Zhao, L. Architectural Patterns for Blockchain Systems and Application Design. Appl. Sci. 2023, 13, 11533. https://doi.org/10.3390/app132011533
Alzhrani F, Saeedi K, Zhao L. Architectural Patterns for Blockchain Systems and Application Design. Applied Sciences. 2023; 13(20):11533. https://doi.org/10.3390/app132011533
Chicago/Turabian StyleAlzhrani, Fouzia, Kawther Saeedi, and Liping Zhao. 2023. "Architectural Patterns for Blockchain Systems and Application Design" Applied Sciences 13, no. 20: 11533. https://doi.org/10.3390/app132011533
APA StyleAlzhrani, F., Saeedi, K., & Zhao, L. (2023). Architectural Patterns for Blockchain Systems and Application Design. Applied Sciences, 13(20), 11533. https://doi.org/10.3390/app132011533