Approaching the Problem of Eventual Consistency in Blockchain

Fluence.sh
7 min readNov 20, 2018

--

What Is Eventual Consistency in the Blockchain Ecosystem?

In order for any transaction to be confirmed within the blockchain, it has to be approved by several nodes. Basically, this is the process of reaching consensus on activities conducted on the blockchain platform. Because distributed-ledger technology functions in a decentralized manner, there is no central authority that can approve any action or validate it. Thus, in order to reach consensus within the system, a number of consensus algorithms can be used.

First things first. How can blockchain provide consistency?

Blockchain technology was created in such a way that it is possible to reach consensus on actions conducted in the data storage system. This type of consistency contributes:

  • auditability and verification
  • atomicity
  • durability
  • information integrity

In comparison to traditional data storage systems, blockchain provides a wider choice of ways to reach consensus. It uses data blocks and transaction mechanisms where various organizations (even mutually untrusting ones) can host different informational patterns. These parties (nodes, individuals, or organizations) constantly verify data integrity and validity via consensus algorithms to agree upon transaction execution. For this, a cryptographic audit is used which relies on the Merkle tree structure:

Eventual consistency is reached via order-executive architecture. First, the blockchain orders transactions using consensus protocol. Only after that can transactions be executed sequentially, one after another.

This type of approach is often the reason for performance failure in various blockchains. As transaction execution happens in a serial manner, it relies upn a certain consensus algorithm that can be slow and computationally expensive.

It is no secret that proof of work, used by the Bitcoin, Ethereum, Litecoin, and numerous other blockchains, turned out to be inefficient in terms of expense and slow throughput. PoW consensus algorithm functions on the basis of miners, who solve mathematical puzzles that require a decent amount of computational power. The problem is that if a puzzle is too complicated, transaction execution can take a lot of time to be validated. For instance, in the Bitcoin blockchain, transaction confirmation can take from several minutes up to six to ten hours, as validation must go through six steps. Additionally, this process depends upon network load and the fee set for confirmation. If a problem is complex, block generation time can expand and execution may get stuck, thereby slowing the entire workflow. On the other hand, if a problem/puzzle is too easy, it is open to attacks and malicious behavior. Though this approach enables faster confirmation by a set of nodes, it violates the main blockchain characteristics: transparency and security.

Considering the above-mentioned problem of eventual consistency, blockchain platforms tend to use alternative consensus mechanisms that are not as expensive in practice, and provide higher speed and transaction-execution throughput.

How Different Blockchains Solve the Problem of Eventual Consistency

As of today, a range of consensus algorithms used by various platforms provide more efficient solutions in terms of speed, scalability, and security.

Each business should approach choosing the right platform precisely, taking into consideration that blockchains like Bitcoin or Litecoin are best suited to micropayments, escrow, and general transactions. They serve as a base for private/sidechain anchoring, which allows improvement of security and trustability. Hashgraph and IOTA appear to be the best match for secure communication in the context of the Internet of Things because signaling happens through their blockchain. Graphene is well-suited to decentralized platforms and applications, whereas Ethereum Consortium and Hyperledger are great for areas of business with a huge number of potential customers when speed of transaction isn’t prioritized. Speaking of the financial sector, the best choice would be Ripple or Stellar.

For instance, Hyperledger uses proof of stake (PoS) and Byzantine Fault Tolerance (BFT) algorithms to ensure higher speed of eventual consistency along with computational cost efficiency. This process involves the connection of a number of nodes to services like Zookeeper, the components of which provide a strong and resistant order of events and node consensus. PoS requires transaction verification of participants who have a higher stake (number of coins in their balance). This algorithm is beneficial in terms of performance and scalability. BFT, in contrast, may not be as scalable, as it requires verification according to an agreement between several nodes. This is achieved by solving the Byzantine Generals’ Problem via voting. BFT contributes better security, but could be corrupted in cases of control over a majority of nodes, which is much simpler than gaining the computational power to hack PoW. The combination of such algorithms proves to be a better choice than PoW itself.

Another alternative consensus used by the Corda and Quorum blockchains is RAFT. This consensus algorithm is pretty easy, in practice. Divided into several independent problems, it legibly addresses the main parts of the problem. In addition, the computational power is significantly reduced, which provides a higher speed of transaction execution.

Graphene, a popular blockchain for decentralized applications, uses the delegated proof-of-stake algorithm (DPoS). According to DPoS, users don’t vote on transaction validity themselves, but are able to delegate this right to other members. Commonly, the DPoS system enumerates between 21 (as in EOS) and 100 delegates, who are chosen in a random manner and provided with an order, according to which their blocks are delivered. This algorithm stands out because of its scalability, energy efficiency, and cheap transaction costs. On the other hand, it should be stated that this approach requires partial centralization; for instance, DPoS in EOS is empowered by the EOS constitution, a legal agreement between delegates according to which consensus is respected. This means that nodes know each other, and decision-making is centralized.

Take a closer look at the following graphic to find out the characteristics of consensus algorithms:

Another problem commonly faced when using blockchain technology is the problem of coopetition. In coopetition, businesses face issues in terms of communication and coordination across various blockchains. For example, if one project is launched on the Ethereum platform while another is launched on Hyperledger, there arises a difficulty in exchanging data, coordinating, and sending transactions across various blockchain platforms. The reason for that is a lack of standards.

Considering the fact that healthy competition between various industries serves as a factor of prosperity, development, and improvement, Fluence.sh suggests avoiding the coopetition issue by means of its API layer. Fluence is blockchain agnostic, meaning that different blockchain platforms are enabled to connect on the back end with the use of API layers. In addition, one project can combine the use of various platforms with Fluence, and manage it easily due to the simple user interface (UI).

What to Keep in Mind When Choosing the Right Algorithm for Your Blockchain-Based Business

A wide range of industries can benefit from blockchain implementation, as it provides data transparency, security of transaction processing, and enhanced trust between participants with smart-contract use.

Despite all the benefits, blockchain technology is still not that obtainable for common users without a deep understanding of technology and development features.

The problem of eventual consistency is something that users commonly face, and they will not always understand it. This is why we provided an explanation above, and listed several examples of alternatives for better results.

To put the problem simply, let’s picture the following situation. Let’s say a service similar to Uber provides users with the ability to order a cab to any place they need. Blockchain serves as the means of providing transparent information on the car and the driver plus his experience, geographical location, service timing, etc. Smart-contract use ensures that both parties will comply with regulations in order to settle the deal. The customer pays the driver, who then has to arrive on time and bring the customer to a specified destination.

When the user pays for the service, it is important to remember that the transaction will take a certain amount of time to get confirmed. It has to be checked in the system to verify whether or not the customer has enough funds on his or her wallet to process the transaction, and whether the driver has complied with his obligations in order to get paid. Problems can occur if the transaction isn’t yet confirmed, but the customer starts using the service when he/she thinks it has been.

In order to avoid such situations, the only thing that has to be done is to make the right choice of blockchain platform with the appropriate algorithm used for reaching consensus. In the above-mentioned example, PoW might not be the best match, as it takes a lot of time for transaction confirmation.

With this in mind, don’t hesitate to contact Fluence.sh. Our blockchain-as-a-service and smart contract-as-a-service platform will help you decide which blockchain platform is the best match for your business. Moreover, with Fluence, you won’t have to worry about the technical process of blockchain technology implementation. We do it all for you. All you have to do is think through your business model and say yes to the benefits of blockchain integration.

For more updates follow us on Twitter and Telegram!

--

--