Research Article

A Reputation-Based Approach Using Consortium Blockchain for Cyber Threat Intelligence Sharing

Algorithm1

Leader and supervisor election phase.
Data: state: the state of a node, num: total number of nodes in the CTI sharing consortium network.
Result: void
(1)begin
(2)switch state do:
(3)  case “follower” do:
(4)   communicate with the current Supervisor node by ReputationValue RPC;
(5)   update the UNL data of local;
(6)   if receive the RequestVote RPC from candidate then:
(7)    if candidate is not in UNL then: Ensure that only the faithful node can serve as the leader /
(8)     vote to candidate;
(9)    else:
(10)     reject vote to candidate;
(11)   if not receive the heartbeat request from the leader in a period then: The timeout of the heartbeat request indicates that there is no leader node in the current network /
(12)    state = candidate;
(13)    break
(14)   if the term in heartbeat request from the leader is less than current term then: The leader’s term must be greater than or equal to the term of current network /
(15)    state = candidate;
(16)    break
(17)   else if the node is not in UNL then: The faithful follower node can become the supervisor node in the new term /
(18)    become supervisor and step to phase 2;
(19)    break
(20)  case “candidate” do:
(21)   for i = 1, i++, i<=num do:
(22)    communicate with the node i by using RequestVote RPC;
(23)    if received vote from most follower nodes then:
(24)     the number of term is increase;
(25)     become the leader and step to phase 2;
(26)     break
(27)    else:
(28)     state = follower;
(29)     break
(30)  case supervisor do:
(31)   If receive the ReputationValue RPC from follower node then:
(32)    send UNL data to node;
(33)   if receive the RequestVote RPC from candidate node then:
(34)    if candidate is not in UNL then:
(35)     vote to candidate;
(36)    else:
(37)     reject vote to candidate;
(38)   if the term in heartbeat request from the leader is more than current term then:
(39)    become the follower and step to phase 2; the supervisor node of last term no longer serves as supervisor in the new term /
(40)    break
(41)end