# Blockchain-Based Model for Incentivized Cyber Threat Intelligence Sharing
## 3 Proposed Solution
### Building of Motivation and Trust
#### 3.2.3 Algorithm for Reward Score Calculation  
The CTI data reviewer assigns a numeric rating ranging from 1 (low value) to 10 (great) to CTI data provided for a defined quality criterion. Behind the scenes, this external rating is converted into a scale from \(-4\) to \(+5\). Then, the quality of the CTI data is evaluated as a weighted sum of the quality criteria. If the obtained value is negative, the CTI data producer receives a penalty score related to this value. In addition, the reviewer is encouraged to write a review in a free form and is assigned a reward score for the review provided.  
The CTI data producer is encouraged to verify the reviews. The reviews may be emotional, incomprehensive, or lack important details. Therefore, the CTI data producer can reject or accept the reviews after verification. If the review is rejected, the reasons are given to the reviewer to ensure fairness. Valid reviews are included together with the produced CTI data. An additional reward score is assigned to the first three reviewers to supply valid reviews, and a reward score is assigned to the producer for every included review. Future CTI data consumers then have more trust in the data as they can check the producer ratings and CTI data reviews.  
The reward scores are converted into a monetary reward. User scores are accumulated for one year of the subscription, and then the total sum is calculated to determine the monetary value. This value depends on the subscription fund collected and the total sum of the reward scores. Then, the subscription fund is distributed to the users according to their reward scores.  
The reward scores represent a reputation rating, and the reward scores obtained for various activities are accumulated. The accumulation of reward scores has been kept for the last five years. The pseudocode of the algorithm for reward score calculation is provided in Algorithm 1.  
```
Input parameters:  Rw1: CTI producer reward score;  Rw2: CTI consumer reward score;  Rw3: CTI reviewer reward score;  Ps: penalty score;  PID: CTI producer ID;  CID: CTI consumer ID;  Prw: PID CTI producer reward score; /* Reward score for one year */  Crw: CID CTI consumer reward score; /* Reward score for one year */  Prs: PID CTI producer rating score; /* Reward score for five years */  Crs: CID CTI consumer rating score; /* Reward score for five years */  Rating: weighted sum of quality factors of metrics. Result: Reward scores and rating scores calculated for PID and CID. If PID provided CTI data  Prw = Prw + Rw1;  Prs = Prs + Rw1;  If CID have requested the CTI data provided  Crw = Crw + Rw2;  Crs = Crs + Rw2;  If CID reviewed CTI data  Crw = Crw + Rw3;  Crs = Crs + Rw3;
```  
**Algorithm 1** Reward score calculation The proposed algorithm looks complex; however, the time complexity of this algorithm is negligent for the following reasons:  
1. All data for calculation are stored in the data structures of smart contracts, which are directly accessible. The data structures are detailed in Section 3.3.
2. The algorithm has no loops.
3. The algorithm is only executed in the case of specific events, either on the provision of new CTI data or on the provision of new CTI data reviews.