# A Blockchain-Based Trust Model for Uploading Illegal Data Identification
## 4 Key Technology
### The Detailed Design of RBRSA  
In the blockchain-based trust model for uploading illegal data identification, it is very important to identify the data information from IDBC fairly and impartially; that is, IN cannot be biased towards IDBC. The paper proposes a reputation-based random selection algorithm for committee member selection, as shown in Algorithm 1. The algorithm in this paper is implemented in INPSC. Different from the selection algorithm of the paper [20], the selection algorithm is based on reputation, and the higher the reputation, the greater the probability of being selected. When the reputation value of NN is lower than 0, NN will no longer be selected as IN.  
```
Input: A set of Registered NN, NNAddrs, a list of addresses; Required number, _Number_, of members in a IN committee; The address of the IDBC; The address of the IDC; The address of the IDC; Output: Selected Number IN to form a committee, INC;
1: assert (NNAddrs.length > 10*N) & assert (curBlockNum!= 0);
2: Seed \(\leftarrow\)0, Trust \(\leftarrow\)0;
3:for i = 0; i <NNAddrs.length && NN.state = WState.online; i++ do  Trust \(\leftarrow\) NN.Trust; endfor  Hash =Hash(Trust, timestamp, height); for node = 0; node < Number; node++ do  Seed = Hash % Trust;  reputation \(\leftarrow\) 0; for n = 0; n<NNAddrs.length && NN!= IBC && NN!= IDBC && NN.state ==WState.online; n++ do  if InPool[NNAddrs[n]].state!= WState.NNtoIN then  reputation = reputation + NN.Trust; if Seed < reputation then  NN.state = WState.NNtoIN;  NN.confirmDeadline = now+ 5 minutes;  NN.IdentificationContract = sender;  onlineCounter-;  Trust \(\leftarrow\) NN.Trust;  INC\(\leftarrow\)NN;  Break; endif endif  endfor  Hash = Hash(Seed, timestamp); endfor  return INC;
```  
**Algorithm 1** Reputation-Based Random Selection Algorithm()  
First, the trust model has a basic smart contract that manages normal nodes. INPSC provides a set of interfaces for any IBC node to join in the identification node pool. In addition, the state of the NN can be changed to \"Online\" or \"Offline\", and only the NN that is \"Online\" can be selected as IN. The management of NNs state is introduced in Section 5.1. NNs in the identification node pool are managed in registration order.  
INPSC is designed with two interfaces called by ISC to select _Number_ INs in the identification node pool. The \"Request\" interface is mainly used to record some parametersnecessary for selecting the algorithm. The \"Sortition\" interface is used to select \(Number\) INs from NNs.  
\[\mathit{Seed}=\mathit{Hash}(\mathit{trust},\mathit{block.timestamp},\mathit{ block. height}) \tag{1}\]  
\[\mathit{Seed}=\mathit{Hash}(\mathit{Seed},\mathit{block.timestamp}) \tag{2}\]  
RBRSA uses the hash value as the seed. The hash is consisting of the total reputation value in the node pool, timestamp and block height, as shown in the Formula (1). RBRSA selects NNs with high reputation value according to seeds but does not rule out selecting NNs with low reputation. In addition, every time a quasi-identification node is selected, a new seed is generated. The new seed is generated based on the previous seed and timestamp, as shown in Formula (2). Repeat this process until \(Number\) quasi-identification nodes are selected. At the beginning of Algorithm 1, RBRSA will check whether the available NNs are enough. The number of NNs is much larger than INs to ensure the fairness and randomness of the algorithm output.  
Considering the difficulty of using the hash value composed of the total reputation value in the node pool, timestamp, and block height as the seed and it is difficult for the outside world to know the total reputation value in the node pool. The paper can prove that the random selection algorithm based on reputation is credible. That is, IDBC cannot manipulate selection results to prevail in the identification committee.