Architecture for Blockchain

Blockchain as a Software Connector

Source: 1

Motivation for considering the architectural implication of blockchain

The design of a blockchain-based system has not yet been systematically explored, and there is little understanding about the impact of introducing the blockchain in a software architecture.

Considering the blockchain as a software connector helps make explicitly important architectural considerations no the resulting performance and quality attributes (for example, security, privacy, scalability and sustainability) of the system.

Blockchain as a Software Connector

Based on this experience, from an architectural perspective, according to the taxonomy of software connectors, we propose to consider the blockchain as a novel kind of software connector, which should be considered as a possible decentralized alternative to existing centralized shared data storage.

The blockchain is a complex, network-based software connector, which provides communication, coordination (through transactions, smart contracts and validating oracles) and facilitation services.

Connectors in distributed systems are the key elements to achieve system properties, such as performance, reliability, security, etc.

...

The services provided by a software connector should be classified into four categories: communication, coordination, conversion, and facilitation.

  • Communication service transfer data among components
  • Coordination transfers control among components
  • Conversion services adjust the interactions to allow components that have not been exactly tailored for each other to establish interactions
  • Facilitation services help to support and optimize component's interactions

bc-connector

The main idea is that the entire blockchain network, comprising clients decentralized across the world, or at least across organizations form a connector between software components.

  • These components can be within one organization, or exist across organizations.
  • These components can have different rights in the process and they don't necessarily trust each other.
  • Not trusting each other but still able to work together is the special ability that is provided by the blockchain. This is what they say "trustless" operation.

Communication Service

Components use blockchain as a mediator to transfer data.

There are two ways to store data on the blockchain:

  1. Add data into transactions, like Bitcoin
  2. Add data into contract storage, like Ethereum

Using the ordinary database indexing techniques, the historical transactions can be analyzed more efficiently.

Coordination Service

Different components can coordinate their computations through the blockchain by:

  • Submitting transactions to smart contracts to invoke the functions defined in the smart contracts
  • Using a validation oracle to sign transactions, the outcome of which depends on the external state

Contracts behave like autonomous agents that live in the execution environment of the blockchain network.

Validation oracle is a mechanism that facilitate component coordination within the network using external state

...

When a validation of transactions depends on some external state, the validation oracle is requested to validate the transaction and sign the valid transaction.

...

If the validation cannot be automated, a human arbitraror can validate transactions and sign valid transactions.

If the transaction can be automated, an automated arbitrator could periodically pull the value of the variables from contract storage as state of the application to validate the transactions.

...

An automated validation oracle can be implemented as a server outside of the blockchain network, which has its own key pair. When a transaction requires external state to be validated, the validation oracle is requested to sign the transaction on-demand.

Facilitation Services

  1. Transaction validation
  2. Mining mechanism
  3. Secure clearing payment
  4. Permission management
  5. Economic incentive

Comparison with other connectors

Versus centralized, shared data store

  1. Shared data stores, like key-value stores, export a basic Create/Read/Update/Delete (CRUD) interface. The blockchain is an append-only data store as it does not support update but rather supports the creation of new transactions.
  2. Traditional shared data stores have their own consensus protocols to synchronize replicas in a fully trusted environment, such as 2-phase commit and pacts. Blockchain, on the other hand, aims to tolerate Byzantine Generals Problem.
  3. Moreover, blockchain is able to validate the consistency of transactions based on rules attached with the transactions in terms of smart contract.

Replicated State Machine

Architectural design decisions for the blockchain connector

bc-connector-decisions


  1. The Blockchain as a Software Connect, Xu, et al., WICSA 2016