## 4 Voting Algorithm
### Threshold Setting Standard  
For the proper setting of threshold value \(th_{cs}\), we should consider the following constraints. For this algorithm, collusion attack is a key security issue. If there are unsafe nodes in the voting users, colluding to vote and the malicious revocation of other users' public keys will cause great security problems. Assuming that the total number of legitimated honest users in the domain is \(r\) and the total number of malicious collusion users is \(k\), the voting weight calculation model of users with collusion attack is as follows:  
\[th_{c}=\sum_{i=1}^{4}\sum_{j=1}^{V_{i}}VW_{ij}\alpha_{ij}+\sum_{i=1}^{4}\sum_{ g=1}^{U_{i}}VW_{ig}\alpha_{ig}\text{ and }\left(\sum_{i=1}^{4}V_{i}\leq r,\sum_{i=1}^{4}U_{i}\leq k\right). \tag{12}\]  
\(V_{i}\) is the number of legal users in grade \(i\), \(VW_{ij}\) is the voting weight corresponding to each honest user, \(\alpha_{ij}\) is the honest user's voting coefficient, and \(U_{i}\) is the number of malicious users in grade \(i\). \(VW_{ig}\) is the voting weight corresponding to each malicious user, and \(\alpha_{ig}\) is the malicious user's voting coefficient.  
There are two purposes that collusion attackers want to achieve through conspiracy: one is to prevent the revocation by voting against it; the other is to cause the user's public key or contents to be revoked by mistake by approval voting actively. For the first case, the attacker and his accomplices use the voting rights obtained in the previous stage to vote, so that the accumulative voting threshold \(th_{c}\) cannot reach the approval threshold \(th_{cs}\) required to revoke. In order to achieve the attack target, the conspirators in the domain will do their best to vote against it, which means the number of opponents voting in the domain is close to the upper limit k. If the number of legitimate voters in the domain responding to the revocation information cannot reach the set threshold after offsetting the negative vote of the attacker, the collusion attack is considered successful, and the accumulative valuewould satisfy Formula (13). In this case, the voting coefficient \(\alpha_{ig}\) is \(-1\). At the same time, the threshold value \(th_{cs}\) should also be less than the \(th_{max}\) as Formula (14); otherwise, the revocation event cannot be completed even if all users in the domain vote.  
\[\sum_{i=1}^{4}\sum_{j=1}^{V_{i}}VW_{ji}\alpha_{ij}+\sum_{i=1}^{4}\sum_{g=1}^{U_{ i}}VW_{ig}\alpha_{ig}=th_{c}<th_{cs} \tag{13}\]  
\[th_{max}=\sum_{i=1}^{4}\sum_{j=1}^{V_{i}}VW_{ij}\alpha_{ij}+\sum_{i=1}^{4}\sum_ {g=1}^{U_{i}}VW_{ig}\alpha_{ig}\text{ and }\left(\sum_{i=1}^{4}V_{i}=r,\sum_{i=1}^{4}U_{i}=k\right) \tag{14}\]  
For the second case, the attacker and his conspirators also use the voting right obtained in the previous period to vote so that the accumulative voting threshold value cannot avoid reaching \(th_{cs}\), thus accelerating the revocation process, which should not be revoked. In this case, the collusion attack is considered successful and the threshold value \(th_{c}\) would satisfy Formula (15). In this case, the voting coefficient \(\alpha_{ig}\) is 1.  
\[\sum_{i=1}^{4}\sum_{j=1}^{V_{i}}VW_{ji}\alpha_{ij}+\sum_{i=1}^{4}\sum_{g=1}^{U _{i}}VW_{ig}\alpha_{ig}=th_{c}>th_{cs} \tag{15}\]