Trust Model for Effective Consensus in Blockchain

. Abstract Blockchain technology is a revolution started as a new economy with an alternative currency namely Bitcoin. Besides the economical aspect, the technological capabilities of Blockchain such as distributed computing, record keeping, irrecoverability of transactions, reliability and etc., are harnessed by variety of real-world applications. Blockchain is a rising pool of records known as blocks linked using security procedure. It is typically managed by a group of nodes in a distributed network technology which integrates technologies such as distributed ledger, security and consensus algorithm to ensure reliability and immutability. In Blockchain, the access privileges are determined by a set of nodes called miners, which run the consensus algorithm to access and submit transactions in to the block after authentication. However, in the existing Blockchain, there is no mechanism to ensure the trust and robustness of the miners and eliminate the malicious miners which runs the consensus algorithm. Therefore, this paper proposes a trust model with an objective of eliminating untrusted nodes from the mining process to enhance the reliability and security of the Blockchain. Further, the proposed trust model is suitably analysed for transaction rate, efficiency and scalability with Hyper Ledger framework to ensure the robustness.


Introduction
Blockchain is a series of blocks with records in a distributed environment and are managed by group of computing nodes called peers with characteristics like immutability, transparency, scalability, reliability and etc [1].Blockchain is perhaps the biggest innovation with a revealing future.Though the principal use of Blockchain innovation is Bitcoin as a cryptographic money, different use cases of Blockchain innovation have picked up variety of applications viz., administration, healthcare, SCM, etc [2].Blockchain stores the transactions in a hash-based structure referred as Block.Each block contains three significant components namely the information, hash block and hash value of the previous block.The hash value in every block ensures the integrity of the data and any malicious change in the data will certainly affect the hash value.To further strengthen the security the entire block is protected by a hash and the hash is stored in the previous block.Therefore, any change in one block will affect the entire Blockchain and thus it is more secured.In brief the Blockchain incorporates distributed ledger, cryptosystem, consensus process and smart contract to provide its characteristics [3].Blockchain is a decentralized information base with improved security and integrity of data that are stored regardless of the type of Blockchain namely permissionless or permissioned Blockchain.Permissioned Blockchain requires the nodes to be authenticated and controlled by central authority preventing accessing data directly unlike the permissionless Blockchain [4].The permissioned Blockchain is further classified into consortium Blockchain and private Blockchain where the read and write operations are controlled by group of nodes and a centralized node respectively.
On the other hand, in permissionless Blockchain any node can access the data without any centralized administration.Though there are many application areas in the Blockchain, apparently the consensus mechanism is important that decides the access control of the data with the help of set of nodes in the network namely miners.Miners are the nodes that validate the transactions in the Blockchain access control with the help of consensus algorithms that guarantees the consistency and validity.There are numerous consensus algorithms exists in the literature.Out of which Byzantine Fault Tolerant (BFT) consensus algorithm [5] and its variants are widely used in consortium Blockchain.Generally, the BFT consensus algorithm and its variants do not offer scalability.Moreover, failure in the primary node and untrusted nodes on the consensus group drops the overall performances of the consensus process.Therefore, in this paper, a trusted consensus algorithm to restrict the consensus group based on the trust values of the individual nodes is proposed.In the proposed model all the nodes in the consensus group are most trusted nodes which will ensure the security and scalability.The scalability issues are restricted only with the nodes perform consensus process.The trust value of the individual nodes is proposed to be calculated based on these factors namely, History Factor (HF), Risk Factor (RF) and Feedback Factor (FF) [6].The HF is obtained based on the successful and unsuccessful transactions committed by the node.The RF is obtained based on risk of deviation between the peers and the FF is calculated based on the feedback value of the neighbour nodes.Finally, these three factors are combined with an appropriate proportion to compute the overall trust of a node.Then the trusted consensus group is formulated with nodes having certain trust value and above based on a threshold value.The main contribution of the paper is to formulate a trust model to construct a trusted miner's group for BFT consensus algorithm to enhance the performance and scalability in the consensus process.The forthcoming sections are organised with a detailed literature of existing consensus algorithms in section II and the framework proposed trust model in section III.Section IV presents the experimental setup and evaluation parameters.The experimental setup also proposes an application to demonstrate the trust model.Section V finally concludes the paper.

Related Work
The Blockchain technology is a highly secured technology where maintaining the security and integrity of the transactions mainly depends on the consensus process that are performed by the miners.Therefore, identifying the trust among the peers and allowing trusted peers to involve themselves into the mining process is the primary goal in the trusted consensus process [7].This section highlights the related concepts that are present in the literature.Eigen trust based PBFT consensus algorithm [8] was proposed to improve the efficiency and to separate the malicious nodes in the network to form a consensus group based on the trust value.The author computes the global trust value of a node by summing up the local trust of a node 'i' with all the remaining nodes in the network.The local trust is computed based on the direct and recommended trust value.The basis for the direct trust depends on the satisfactory and unsatisfactory transactions between the pair of nodes.In this paper, the consensus group is formed based on the trust value and then PBFT algorithm is used for consensus process with trusted nodes to improve the efficiency.The major limitation of this method is that, it gives absolute ordering of peers without interpretation of recent history and feedback from other peers.An enhanced Eigen Trust algorithm was proposed in [9], to identify and isolate a malicious peer in a network.This is carried out by analysing the recorded values of global reputation rating and reputation given by certain peer after each transaction they are involved in, to track and identify the malicious peer.This work computes the trust purely based on the feedback from other peers without considering the direct trust with the past history.Therefore, feedback from malicious peer will have a negative impact on the trust calculation.Further this method was not suitably analysed in the Blockchain network for effectiveness.Peer Trust [10], is a reputable model for trust calculation of a node which includes two factors such as feedback received from other nodes and the credibility factor of the node that delivers the feedback.This model considers the recent transactions to calculate the trust in order to avoid traitor of the problem.It has also a limitation by considering only feedback to compute the trust of a node and has been proposed in a P2P environment.Power Trust [11], is another trust management system dynamically a set of reputable power nodes using a distributed ranking method which once again uses first hand and second-hand information to build the trust of a peer.However, this method is not suitably analysed in Blockchain network effectively.Wang et al., [12] has proposed a trust model for access control in collaborative environment based on history and peer recommendations to evaluate the trustworthiness of the requester.The author has used the number of transactions as a history and number of recommendations for computing the trust.Based on that, the trust score is calculated for access control.However, the freshness of history and Direct Trust Tree based recommendations were not considered.Further, trust value is used for access control for providing privacy.Monrat et al. [5], has elaborated various consensus mechanisms that are used in Blockchain network for consensus process.Further the paper portrays the complete functionalities of Blockchain network process along with vulnerabilities which are happening in the consensus mechanism.However, there exists no discussion about trust model to avoid malicious miner in a network which could be harmful during the consensus process.Xiaoyong Li, et al. [6], proposed a multi-dimensional trust evaluation model for P2P computing based on cognitive behaviour by incorporating multiple factors such as history, feedback, risk, motivation and availability factors.The weights are dynamically assigned using ordered weighted average algorithms.However, little effort is paid on identifying and evaluating certain factors for the recently joined peer.Further, this model has not been completely explored practically on various P2P model and in Blockchain networks.Many research groups are proposing fuzzy logic concepts for building effective trust models in distributed computing and Blockchain technologies.Wang et al. [13], proposed a fuzzy based trust model to access the interactions where confidence is derived from direct and indirect transactions in distributed network systems.In certain other paper [14], the trust and reputations of nodes were built based on the observations and recommendations while fuzzy logic is used Trust Model for Effective Consensus in Blockchain for judgements.Fuzzy based Certain Trust Model was proposed [15], with average rating, certainty and expectation to build the trust model specific to e-commerce applications.However, significant research on application of these models in Blockchain consensus group has not been explored in the literature and forms the motivation for proposing a trust model in this research work.

Proposed Trust Model
This paper proposes a Trust based model to select the trusted miners who will involve in the consensus process for Blockchain network in order to process the block transactions in a more secured manner.

Overview of BPFT
Consensus mechanism is one of the important elements of a Blockchain which is responsible for verification process for inserting a block consisting of the transactions into a chain.The major objectives of the consensus algorithms are to reach an agreement by taking the collective interests of the group by collaborating with all the nodes in the distributed network [1].Though there are many consensus algorithms exists in the literature, this paper makes use of the practical Byzantine Fault Tolerance (pBFT) [3] as it has many characteristic benefits of pBFT such as transaction finality, scalability, energy efficiency, non-requirement of asset, less computation, low reward variance, etc., make it more suitable for Blockchain.The pBFT algorithm is an agreement calculation based on the Byzantine fault tolerance (BFT) [3], which has the essence of characteristic of a distributed network of reaching consensus even when some of the nodes of the network do not respond or respond with incorrect information.The goal of a BFT mechanism is to protect against system failure by making collective decisions to reduce the influence of faulty nodes.This is achieved by applying the concepts of Byzantine Generals Problem, in which generals have to tka a common decision to fight or withdraw the war.If a few of the wanted to fight when others wanted to withdraw, they cannot win the war.The important thing is a common decision has to be taken for the fight, otherwise the war would turn into defeat.The pBFT consensus process selects a group of nodes with one node as leader and other are members.The nodes in the group communicates with each other to get a common agreement while processing the ledger in the Blockchain.To perform the process correctly, pBFT two third of the total nodes should agree with the consensus verification.Thus, when there are more nodes and two third of them are agreeing result in more reliability in the network.The pBFT process has four phases [3] viz., 1) Client sends request to the leader about the transaction.2) The leader then collects the transactions, group them into a block and broadcast the block to the other nodes in the group.3) The nodes in the group verifies the transactions in the block.Upon verification of valid block, the hash value for the block is computed and broadcasted.4) Finally, two-third nodes in the group reply with the same hash for successful consensus and the block is then added to the Blockchain.
The pBFT algorithm is designed for asynchronous consensus systems and optimized in a more efficient way to deal with all problems.The level of communication is quite high because nodes want to verify all the information that is found on the network.However, this algorithm suffers with lack of scalability since large number of nodes will communicate with each other for the common consensus which may sometimes include untrusted nodes in the network.

Proposed Framework
This work proposes a trust enabled consensus algorithm to make the consensus more reliable and scalable.In the proposed model a group of trusted nodes are formed which will run the pBFT consensus algorithm to make the verification more reliable and scalable.The new trust model verifies the node before getting into the consensus group based on three characteristic parameters viz., history of past performances, risk associated based on the previous transactions and the feedback of the peers based on their transactions [6].The new trust model will calculate the trust value for each and every node based on the above-mentioned factors and a normalised trust value will be computed by applying appropriate weights for the three factors.Based on the normalised trust value of each node in the Blockchain network, nodes with trust value greater than the predefined trust value will only be included into the trusted consensus group.The nodes in the trusted consensus group alone will participate in the pBFT consensus for adding a block into the chain.This will improve the transaction rate, reliability and scalability in the Blockchain network.The architecture and the workflow of the proposed trust enabled algorithm in the Blockchain network is depicted in the figure 3.1.In the diagram, the components shown in the rectangular box viz., trust calculation, fusion and rating are the proposed components of the trust model.In the proposed work, once the transaction proposal is submitted to the Blockchain network for inserting a block, the execution of consensus process will be preceded by formation of trust group with the trust model.The trust model uses three factors namely History Factor (HF), Risk Factor (RF) and Feedback Factor (FF) for trust calculation [6].The first factor in the proposed trust model is History Factor HFij for two nodes Pi and Pj and is defined as the rating of Pi on Pj based on the satisfaction degree of their transactions over a time period 'h'.This rating is purely based on the satisfactory and unsatisfactory transactions between Pi and Pj at a specific timestamp within the time period 'h'.
The ratings quantization for Pi will give score for Pj based on the performance as below: ----- (1) where, sat(i, j) is satisfactory transactions held between node i and node j, unsat(i, j) is unsatisfactory transactions held between node i and node j, Tr is total transactions at the time of 't'.Based in the above ratings and an adjustable positive constant h, the HFij is calculated using equation ( 2).

-----(2)
The HFij is calculated using the equation when h is not equal to zero otherwise it is assumed as 0. Also in the above equation is equal to 1 when t = h, otherwise where h acts as an adjustment constant which can be tuned and is a constant.h = n // is a history evidence period and be set with a value 2. Sij = 0 // the difference between the satisfactory and unsatisfactory transactions between i and j 3. HFij = 0 // Weighted average of past experiences between i and j 4. t = x // timestamp and the value is between 1 and h 5.
Initialize the values for for every t between 1 to h 6.

// ------for computing the probabilistic ratings based on the satisfactory and unsatisfactory transactions between i and j -
for every 't' in h do 10.
for node j ∈ nodes do 11.
Tr = max (Sij, 0) 13.The second factor is the Risk Factor RFij which is defined as the risk of deviation between Pi and Pj from the expected outcome based on the past results.Here, the risk rating is purely based on the number of failed transactions during time period 'h'.RFij is given by the equation ( 3).

----(3)
where r(h) is the number of failed or unsatisfactory transactions during h risk window and  is a constant adjustment factor.
Algorithm for Risk Factor: _______________________________________ Algorithm 2. CalcRiskFactor _______________________________________ Input : Node 'i' and a transaction nodes of i viz., 'j' Output: Risk based Trust Factor RFij 1. z = n // is a risk period and be set with a value 2. RFij = 0 // Weighted average of past experiences between i and j 3.  is a positive adjustment constant factor 4.

return RFij
The third and final factor in the proposed model is Feedback Factor FFij which is defined as Pi has rated Pj based on the feedback using the Direct Trust Tree path function β(W(k)) and is defined by the following equation ( 4).
For calculating the feedback factor using eqn.4, the value of N ranges from 1 to Q, β(WN) is said to be a path function in the Direct Trust Tree [11] where it reflects the feedback trust value.The feedback trust value is defined by the below equation.
--- (5) where, T(PQ, PQ+1) is defined as the trust value of node PQ with its next descendant node PQ+1 in the direction of the trust path [11].Further details and the construction of the direct trust tree and the principle can be read from the reference [11].
Algorithm for Feedback Factor: __________________________________ Algorithm 3. CalcFeedbackFactor _______________________________________ Input : Node 'i' and a transaction node of i viz., 'j' Output : Feedback based Trust Factor FFij Where, W = (w1, w2, w3) are the weight of the related trust factor which is in the range between 0 and 1.

Consensus Group Formation and Consensus Process
In the trust enabled consensus process, before the actual process of consensus, the consensus group is formed with the trusted nodes in the underlying network.In the network the trust values for every node calculates the transaction behaviour, risk and feedback values from the other connected nodes.Further, these three trust values of individual nodes are normalised to get a single trust value.The normalised value is computed by suitably assigning weight value for the above said three factors namely history factor, risk factor and feedback factor.After computing the normalised trust value of every node, nodes which are higher trust value than the predefined threshold value is selected and included into the consensus group.The nodes with lesser trust value are identified as untrusted nodes and hence they are not allowed to enter in the consensus group.After forming the consensus group with only trusted nodes the actual consensus process is started.The transactions initiated by nodes are entered in to the transaction pool.Transactions from the transaction pool are grouped into a block and is subjected to the pBFT consensus processes.After the clear verification and consensus obtained from the pBFT algorithm, the Block is inserted in to the Blockchain.The pBFT consensus algorithm will allow only the nodes in the trusted group to participate in the consensus process.This process will ensure that the trusted nodes will be involved in the block creation and hence the reliability and security will further be maintained.As such in the proposed research, the trust model before the pBFT consensus process ensures more security in the Blockchain network.

Experimental setup
In order to evaluate the performance of the proposed trust model, simulation experiments were conducted using Hyperledger Fabric version 2.3.The proposed trust model is implemented using Go language.To analyse the performance, an application namely Project Management System for the funding agencies was considered.This system implements a consortium Blockchain in which the funding agency, monitoring agency and research institutions who are getting the grant from the funding agencies are members and form the Blockchain network.The proposal from the research institution will be received by the funding agency and approved based on the merit of the proposal.The approved institutions will get research grant from the funding agency and the institutions spend the money to carry out the research project.The entire workflow during the project period and the transactions generated were monitored by the monitoring agency.All the transactions were maintained in a secure manner in the Blockchain with the proposed trust model.This application was implemented using Hyperledger and Go lang using Docker environment.The smart contract and chain code was implemented using Go language.Docker and Docker compose was used to run the images of the Distributed Ledger/Nodes.A distributed network with 15 nodes were created for experimentation.Each transaction of 54 KB was inserted into the Blockchain.To analyse the performance of the proposed trust model, experiments were conducted in three different scenarios namely, without trust model (all the 15 nodes), with trust model having threshold value 0.75 and with trust model having threshold value 0.6.The proposed trust model has been evaluated for three parameters namely, transaction rate, transaction delay and processing time.Experiments were conducted for several trails to get the results.The obtained results were averaged over several runs and are presented as data points in the graphs for better accuracy.

Experimental results and analysis
The performance of the proposed trust model is analysed in three different scenarios for the following evaluation metrics.

Transaction Rate
Transaction rate is calculated based on the transactions per block against the processing time of the block.The transaction is given in terms of ms.The following graph in figure 4.1 shows the transaction rate for three different scenarios.The first scenario is without transaction model, the second scenario is with trust model having threshold value 0.75 and the third scenario is with trust model having threshold value 0.6.The data points were averaged by obtained data from three set of experiments.The experimental results shows that there is an increase of 21% transaction rate on an average.

Transaction Delay
Transaction delay is calculated based on the transactions per blocks compared with basic network of three nodes.The transaction delay is given in terms of ms.The following graph in figure 4.2 shows the transaction delay for three different scenarios.The first scenario is without transaction model, the second scenario is with trust model having threshold value 0.75 and the third scenario is with trust model having threshold value 0.6.The data points were averaged by obtained data from three set of experiments.The experimental results shows that there is a decrease of 37% transaction delay on an average.

Conclusion
A new trust enabled consensus mechanism is proposed to enhance the performances of the BPFT consensus algorithm.The proposed trust-based consensus mechanism creates a trusted group of miners based on history factor, risk factor and feedback factor of the nodes to improve the efficiency.Since the trusted nodes are only present in consensus the communication complexity is also reduced to limited nodes and the transaction rate is also increased.This will address the scalability to some extend in the consensus process.The proposed trust model was experimentally analysed with a suitable application implemented in Hyperledger framework.The experimental results shown significant improvement in transaction rate, transaction delay and block processing time.