Research Article

A Consensus Algorithm Based on Risk Assessment Model for Permissioned Blockchain

Algorithm 1

RAC
Input: Transaction request from client.
Output: void
1.begin
2. if no evaluator group in the permissioned blockchain system then:
3.  generate evaluator group
4. end if
5. while Transaction request from client && evaluator group is existed do:
6.  if accountant node is not existed || the term of account node is less than current term || accountant node is Byzantine node then:
7.   generate candidate
8.   communication between all follower nodes and evaluator group through RiskCompute RPC
9.   all node update RNL
10.   communication between candidate node and all follower nodes through RequestVote RPC
11.   if received vote from most follower nodes then:
12.    candidate node become accountant node
13.  else if accountant node existed then:
14.   add the transaction request into block
15.   communication between accountant node and evaluator group through Judgment RPC
16.   if the number of “fail” in all Judgment RPC>50% then:
17.    the block is set to empty block
18.   else then:
19.    the block is set to valid block
20.  communication between all follower nodes and accountant node through AppendEntries RPC
21.  if follower node find empty block then:
22.    add accountant node into RNL
23.    the term of follower node is increase
24. end while
25.end