# Blockchain-Based Licensed Spectrum Fair Distribution Method towards 6G-Envisioned Communications
## 3 BEAST System Model
### System Process
```
1:\(\textit{MNO}_{addlist}\), \(\textit{MNO}_{\textit{deposilped}}\), \(\textit{MNO}_{\textit{ir}}\)
2:\(\textit{User}_{add}\), \(\textit{User}_{\textit{4}posil}\), \(\textit{User}_{\textit{tim}}\), \(\textit{ServiceRecord}\)
3:\(\textit{Inert}\):
4:\(\textit{in address of suspect}_{add}\)
5:\(\textit{1: BEGIN}\)
6:\(\textit{2: StartTime=Localtime()}\);
7:\(\textit{3: Initialize}\)\(\textit{VoteCounter}\)
8:\(\textit{4: Initialize ValidList}\)
9:\(\textit{5: Initialize}\)\(\textit{Cache}\)
10:\(\textit{6: Initialize}\)\(\textit{PI}_{addlist}\) as an empty list for PUs
11:\(\textit{User}_{add}\)\(\textit{User}_{\textit{4}posit}\)\(=\textit{User}_{\textit{4}posit}\)
12:\(\textit{User}_{add}\)\(\textit{User}_{\textit{tim}}\)\(=\textit{User}_{\textit{tim}}\)
13:\(\textit{User}_{\textit{4}posit}\)\(=\textit{User}_{\textit{4}posit}\)/(\(\textit{User}_{\textit{tim}}\)* unit price)
14:\(\textit{10: Uploading available resources }\textit{SR}_{A}\)\(=\)\(\{\textit{S}_{1},\ldots,\textit{S}_{m}\}\)
15:\(\textit{11: Uploading spectrum demands }\textit{SR}_{\textit{D}}\)\(=\)\(\{\textit{P}_{1},\ldots,\textit{P}_{n}\}\)
16:\(\textit{2: MNO sends }\textit{MNO}_{\textit{deposil}}\)
17:\(\textit{13: Initialize}\)\(t_{\textit{d}}\)\(=\)\(\{\textit{d}_{1}\textit{d}_{2},\ldots,\textit{d}_{n}\}\)
18:\(\textit{14: Initialize}\)\(T^{\prime}\)\(=\)\(\{\textit{P}_{1},\textit{TV}_{2},\ldots,\textit{TV}_{n}\}\)
19:\(\textit{15: Define priority index }\textit{Pr}_{i}=\frac{1}{1+\text{ln}(\textit{d}_{i}+1)}\bullet\frac{\textit{ d}_{i}}{1+\textit{c}^{-1}\textit{v}_{i}}\)
20:\(\textit{16: Call formula X to get the priority index of the PU
21:\(\textit{17: Spectrum distribution according to }\textit{Pr}_{i}\)
22:\(\textit{18: Update the ServiceRecord}\)
23:\(\textit{19: Return result to M



into the trust value assessment method. The technical approaches to identify users' violating behaviors in an LSA coverage area are well researched in articles [24; 25]. Compared to the above two articles focusing on misbehavior surveillance and detection, our research focuses on the trust value establishment mechanism. By utilizing the emerging blockchain technology, the consistency of a user's trust value at each node on the blockchain can be guaranteed. The trust value of each spectrum user is modeled, recorded and also agreed to with other nodes on the consortium blockchain. Since available spectrum resources and users accessing demand have obvious time-varying characteristics, PU and PBS behaviors during different occupation periods may differ over time, and the corresponding trust value will change accordingly. In our design, the time cost to generate a new block is denoted as \(T_{g}\), and the longest period that a spectrum user occupies the channel is denoted as \(T_{occ}\). It is obvious that \(T_{g}\
eq T_{occ}\). And if \(T_{occ}<T_{g}\), a user's trust value will be updated at the end of \(T_{g}\). If \(T_{occ}>T_{g}\), the trust value will be updated in the next new block generating period. The initial trust value of each user is set to \(100+d_{\text{token}}\), where \(d_{\text{token}}\) is the amount of the token that is deposited in the account. The later time-varying trust value is calculated with the following formulation. \[TV_{i}=(100+d_{\text{token}})\times\lim_{W\to\infty}\frac{\sum_{j=t-W}^{t-1}I (\text{Violating at }j)}{\sum_{j=t-W}^{t-1}I(\text{Access sin g at }j)}=(100+d_{\text{token}})\times\frac{N_{p,n}}{N_{a,n}} \tag{2}\]

where \(I(. )\) denotes the indicator function. If the argument is true, \(I(. )=1\), and if not, \(I(.)=0\). \(N_{p,n}\) and \(N_{a,n}\) denote the number of times that the corresponding behavior is counted, respectively. According to the above formulation, a high trust value correlates to good behavior and a low trust value correlates to bad behavior. ### PoT Procedure

The essence of the blockchain consensus algorithm is to ensure the consistency of ledgers on different nodes.