# Architectural Patterns for Blockchain Systems and Application Design
## 3 Pattern Identification
### Application Analysis  
We analyzed these 400 applications one by one, to identify key components from each application. Guided by a taxonomy for blockchain application development [3] and our knowledge of blockchain technology, we found 13 core functional components from these applications. These components are briefly outlined as follows:  
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]. _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]. * _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]. * _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].