Multi-Operator Dynamic Spectrum Sharing for Wireless Communications: A Consortium Blockchain Enabled Framework

To enable secure and efficient dynamic spectrum sharing (DSS) with guaranteed revenue and quality of service (QoS) in future wireless communications, we present a consortium blockchain based DSS framework, where the regulators supervise the whole process of DSS, and thus the revenue of each participant can be guaranteed. Each mobile network operator (MNO) on the chain can adaptively act as a spectrum provider or spectrum requestor based on their demand, and the spectrum resource allocation is recorded on the chain with a smart contract. The optimal spectrum pricing and buying strategies are solved based on a multi-leader multi-follower (MLMF) Stackelberg game model, and the equilibrium is solved with the proposed algorithm. We then build a prototype with Hyperledger Fabric consortium blockchain, and the average latency is evaluated. Simulations and prototype evaluations validate the feasibility of blockchain based DSS and show that the average latency increase with the participants, which provides useful insights for real applications.

Abstract-To enable secure and efficient dynamic spectrum sharing (DSS) with guaranteed revenue and quality of service (QoS) in future wireless communications, we present a consortium blockchain based DSS framework, where the regulators supervise the whole process of DSS, and thus the revenue of each participant can be guaranteed. Each mobile network operator (MNO) on the chain can adaptively act as a spectrum provider or spectrum requestor based on their demand, and the spectrum resource allocation is recorded on the chain with a smart contract. The optimal spectrum pricing and buying strategies are solved based on a multi-leader multi-follower (MLMF) Stackelberg game model, and the equilibrium is solved with the proposed algorithm. We then build a prototype with Hyperledger Fabric consortium blockchain, and the average latency is evaluated.

Simulations and prototype evaluations validate the feasibility of blockchain based DSS and show that the average latency increase with the participants, which provides useful insights for real applications.
Index Terms-Multi-operator spectrum sharing, consortium blockchain, smart contract, Stackelberg game.

I. INTRODUCTION
W ITH the ongoing deployment of the fifth generation (5G) wireless infrastructure, the research for the next sixth-generation (6G) wireless networks has started, with a focus to support diverse smart applications, such as virtual and augmented reality, holographic communications, ultra-highresolution video streaming, etc [1]. With such an ambitious goal, 6G is anticipated to adopt both evolutionary and disruptive technologies, including space-air-ground integrated networking for global ubiquitous coverage, and utilization of full spectrum ranging from low and mid-band at sub-6 GHz frequencies to millimeter wave (mmWave), terahertz (THz), and optical bands [2]. While 6G is evolving towards higher frequencies, efficient spectrum management at the sub-6 GHz band still remains essential due to its superior indoor propagation property. Disregard the golden spectrum resources at the sub-6 GHz band are almost exhaustively licensed, it has been reported that the actual spectrum utilization rate of this band is only around 15% to 85% [3], which is far from an ideal scenario. The spectrum shortage and its low utilization rate have motivated researchers to develop dynamic spectrum sharing (DSS) technologies, which have been very active research topics over the past two decades [4], [5], [6], [7], [8]. Despite the development of numerous DSS solutions since the emergence of cognitive radio (CR) technologies [9], like the licensed shared access (LSA) system [10] and the spectrum access system (SAS) for citizens broadband radio service (CBRS) system [11], largescale DSS is still not deployed in practice. One main obstacle lies in the lack of reasonable incentives for spectrum resource providers, guaranteed quality of service (QoS) for secondary users, and security and privacy protection for both participants, which directly results in the reluctance for sharing of previously licensed spectrum resources.
As an emerging technology with unique property of transparency, anonymity, immutability, and traceability, blockchain has been regarded as a promising tool to empower DSS in future wireless communication networks [12], [13], [14]. Leveraging the cryptographic and signature techniques, the identity of a participant in a blockchain network can be verified by others, but it does not need to provide any private information. With the multi-party jointly maintained distributed ledgers, the spectrum assets ownership, right to use and corresponding sharing process can be recorded permanently on the chain, and thus the revenue of both the spectrum resource provider and the resource consumer can be guaranteed. Moreover, any improper spectrum usage, such as breaking the power and bandwidth limitations, can be identified with the assistance of off-chain spectrum monitoring. Particularly, with the deployed smart contract and spectrum assets information on the chain, spectrum allocation decision can be made automatically and reach a consensus with mutual interference avoidance [15]. Compared with the conventional centralized database based approaches, the blockchain based approach shows great potential to facilitate secure and efficient DSS, and it has been considered as a promising solution by 2332-7731 c 2022 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission.
the Federal Communications Commission (FCC) of the United States at the 2018 Mobile World Congress (MWC) [16]. It is worth noting that even though existing works [14], [17], [18], [19], [20], [21], [22], [23], [24], [25], [26], [27], [28], [29] have been discussed to use public or consortium blockchain for DSS, the detailed operations are still not clear, and most of them directly follow a framework similar to CR, which cannot be applied in practice. Different from [26] and [28], in this paper, we consider operator level spectrum sharing, where the regulators supervise the whole process of DSS. Each micro or virtual mobile network operator (MNO) can adaptively act as spectrum provider or spectrum requestor based on their demand, and we design a multi-leader multi-follower (MLMF) Stackelberg game to achieve optimal spectrum pricing and resource allocation to maximize the revenue of all participants. The Stackelberg equilibrium of the game is analysed and is solved through the best response approach. Moreover, we build a complete simulation environment with Hyperledger Fabric to evaluate the performance of DSS. The contributions of this paper are summarized as follows: • We propose a consortium blockchain-based DSS framework, where the regulators are responsible for regulating the whole process of DSS, which facilitates the security and efficiency of DSS among different operators. • We model the interactions between multiple buyers and sellers as a MLMF Stackelberg game, where micro or virtual MNOs can dynamically share or rent spectrum resources for their own demand. The optimal spectrum pricing and resource allocation is optimized to maximize the revenue of all participants, with the constraints of available bandwidth of each seller operator (SOP), and budget of each buyer operator (BOP). The Nash equilibrium is proved to exist and the optimal solution is obtained with the proposed algorithm. • We design a smart contract incorporating the MLMF Stackelberg game, and build a prototype with Hyperledger Fabric consortium blockchain to verify the feasibility of our proposed DSS system. The average latency performance of the blockchain is evaluated. The remainder of this paper is organized as follows. We discuss related works in Section II and present the system model in Section III. The MLMF Stackelberg game is formulated in Section IV, followed by the equilibrium analysis and solutions in Section V. In Section VI, simulation results are presented, and the performance analysis are also discussed. Finally, conclusions are given in Section VII.

II. RELATED WORKS
Recently, DSS among multiple operators has been introduced by the industry and academia to enable wireless communication services. In 3GPP Release 15 [30], DSS as a technology was proposed to provide a migration path from fourth generation (4G) long term evolution (LTE) to 5G new radio (NR) by allowing LTE and NR to share the same frequency band. DSS was also included in Release 16 [31] and further enhanced in Release 17.
There have been some works considering to use blockchain for DSS in the literature [14], [17], [18], [19], [20], [21], [22], [23], [24], [25]. Blockchain as a platform for spectrum allocation was proposed in [18], where secondary users (SUs) obtain the spectrum access right through buying the idle spectrum of primary users (PUs). Combining ring signature, a privacy protection mechanism was proposed to protect nodes' identities when they upload data. Likewise, a blockchainbased proof-of-strategy (PoS) consensus scheme for DSS between PUs and SUs was proposed in [19], where the ring signature technique was designed as the privacy protection method for users. In [20], a blockchain-enabled reverse auction mechanism was devised for radio access network (RAN) sharing and dynamic users' service provision in beyond 5G (B5G) networks, where a public blockchain is used to record spontaneous service requests made by users, while a private blockchain allows operators and other participants to share spectrum resources. However, most of them directly follow a framework similar to CR, which cannot be applied in practice. In [17], the authors constructed a blockchain based decentralized self-organized trading platform for industrial Internet of Things (IIoT) devices, where the interactions between the cloud provider and miners are modeled as a Stackelberg game, which assists the lightweight IoT devices to offload huge computational tasks to the cloud provider. In [14], the authors proposed a two-tier hierarchical blockchain empowered dynamic resource sharing architecture, where a public blockchain is maintained and accessed by all the users, while a private blockchain supports the DSS for base stations. Similarly, a blockchain-based spectrum access system comprising of two layers of blockchain networks was proposed in [21], where a global chain is used to serve the servers and regulator nodes at a global scale, and a local chain is dedicated for spectrum access management for a local spectrum zone.
In public blockchain (e.g., Bitcoin [32] and Ethereum [33]), anyone is free and anonymous to join and participate in the core activities of the blockchain, which is unfavorable for the regulators to supervise DSS. As a counterpart of public blockchain, consortium blockchain can only accept the approved participants, and thus can be applied to facilitate DSS with regulation. In [26], the authors devised a consortium blockchain framework to achieve spectrum sharing in multi-operator wireless communication networks, where a double auction and free-trading market based on smart contract was designed to enable operators to autonomously share the spectrum resource. However, the spectrum auction algorithm is finished by matching a bidding queue or comparing whether the lowest seller price is higher than the highest buyer price, which is not an optimal strategy and does not provide an effective incentive for operators to share their spectrum. In [27], a spectrum-efficient framework based on consortium blockchain was proposed for human-to-human and machineto-machine coexistence in 5G heterogeneous networks, where PUs (i.e., human-to-human users) can share their unused spectrum resources with SUs (i.e., machine-to-machine users). In [28], to provide high speed network services with reliable QoS, a blockchain-based framework was proposed to evaluate 5G spectrum sharing and model intra and inter spectrum management among multiple telecom-operators. However, how to achieve spectrum sharing is not clearly presented. In [29], a spectrum trading blockchain model was presented to improve the efficiency and security of spectrum transactions in virtual optical networks, where a new consensus solution was proposed to quickly confirm transactions, and a temporary anonymous transaction was designed to prevent mainstream attacks. In [34], a hierarchical blockchain and deep reinforcement learning framework was proposed to achieve secure resource trading in 5G RAN, where a single-leader multifollower Stackelberg game was formulated to determine the buyers' demands and the seller's price, and a consortium blockchain network was deployed to support their resource trading smart contract.

III. DSS SYSTEM WITH CONSORTIUM BLOCKCHAIN
In this section, we first introduce the DSS system, where multiple operators form a consortium blockchain to achieve secure and efficient inter-operator spectrum resource sharing. Then the operation details of DSS are described.

A. System Overview
As shown in Fig. 1, we consider a DSS scenario in a specific region, where each operator has one macro base station (MBS) and several small base stations (SBSs). Different types of user terminals (e.g., vehicles, unmanned aerial vehicles (UAVs), and smart phones, etc.) are connected to the corresponding nearby BSs for wireless services. We assume that the DSS is conducted among different operators in a slot-by-slot manner. The BSs monitor spectrum usage within the region, and analyze spectrum demand at the beginning of each slot. Without loss of generality, we assume that the duration of each slot is T.
Then, the BSs send the spectrum demand request to the corresponding operation administration and maintenance (OAM) server of each operator, which is responsible for spectrum assignment and management [26]. According to the request information collected from the BSs, each OAM server can determine the spectrum demand during the slot. 1 For the ease of understanding, we summarize the notations in Table I.
To facilitate secure and efficient spectrum sharing, the operators form a consortium blockchain, where each operator stands for an organization. The operators can choose to become seller operators (SOPs) or buyer operators (BOPs) based on their spectrum demand results at the beginning of each slot, and they are divided into SOPs group and BOPs group. The SOPs group consisting of N operators is denoted as N = {n|n = 1, . . . , N }. The total available spectrum resources of SOP n for selling is B n , with a unit price p n . The pricing strategies of all SOPs are denoted as Similarly, the BOPs group consisting of M operators is denoted as For the consortium blockchain, each organization consists of a client, some peer nodes, and orderer nodes. Peers are responsible for executing spectrum sharing strategy and transactions while orderers package the transactions and generate a new block for consensus [21]. To ensure the secure and robust operation of DSS, there are regulators in the consortium 1 The OAM server can calculate the terminals' spectrum demand by two methods: (1) The terminals report their spectrum demand to the associated MBS or SBSs, then the OAM server counts the total spectrum demand collected from the MBS and SBSs; (2) By leveraging the prediction tools, the OAM server predicts the terminals' spectrum demand based on the historical spectrum usage in the specific region. blockchain, which are responsible for regulating the process of DSS and managing the permissions of nodes. The main duties of regulators are listed as follows: 1) The regulators synchronize the data on the chain, and then regulate and audit the whole process of DSS through mining and analyzing these data. To prevent the occurrence of risk, the regulators trace the history of each transaction and monitor the transaction information of the associated nodes. If the regulators identify violations, they will have the right to revise and delete corresponding transactions in that blocks. 2) The regulators are responsible for the certificate authorization of operators before they join the blockchain.
To monitor the running status of nodes, the regulators can dynamically modify the permissions of nodes, such as consensus and transaction. If some nodes are found malicious, the regulators will remove them. Moreover, smart contract is immutable once deployed, which guarantees immutability. To achieve automatic execution of the spectrum sharing strategy between BOPs and SOPs, the DSS smart contract is deployed on the consortium blockchain. The execution of the DSS smart contract is restricted to primary nodes that vouch for the results of spectrum sharing strategy. To reduce the communication overhead, one primary node is selected to execute the DSS smart contract based on reputation. The higher reputation of the peer node, the more likely it is to be selected as the primary node. Furthermore, the primary node will get reward for executing the DSS smart contract after finishing spectrum sharing.

B. Operation Details of DSS
In the DSS system, elliptic curve encryption algorithm is used to generate digital significance for each organization. In order to obtain effective supervision, each operator must first be certified by a certificate authority (CA) before it become a legitimate organization, and it is licensed to a digital identify (ID) based on its organizational role. Legal organization will now receive public-private key pairs and corresponding certificates for encrypting shared data. When sharing spectrum with other operators, the operator specifies and presents its ID. A membership service provider governs the valid ID for the operator. 2 As shown in Fig. 2, the DSS flow consists of nine phases: 1) On the BOP side, it signs and transmits its spectrum request message MSG req to the memory pool via client, which is expressed as follows: where id m , sig m , and loc m are ID, digital significance, and location information of BOP m. fee m is the prepaid coin of BOP m for spectrum sharing, which contains the transaction fees for the primary node processing the transactions and deposit for the violation. slot no is the slot number. Similarly, to share the available spectrum resource, SOP n signs and sends its selling message MSG sel to the memory pool, which is denoted as: MSG sel = {id n , sig n , loc n , B n , C n , fee n , slot no }, (2) where C n is SOP n's cost coefficient per unit bandwidth.
2) The selected primary node collects these messages from the memory pool.
3) The primary node automatically executes the DSS smart contract to compute a spectrum sharing strategy.
4) The primary node packages the spectrum messages and the spectrum sharing strategy into a transaction proposal (i.e., proposal) signed with its signature, and then as a client uploads the proposal to endorsing peers (endorsers).
5) The endorsers simulate the proposal by executing the operation on another specified smart contract. After the simulation, the endorsers cryptographically sign a message called endorsement, which contains readset and writeset (together with metadata such as transaction ID, endorser ID, and endorser signature), and send it back to the primary node in a proposal response. The primary node collects endorsements until they satisfy the endorsement policy, which means that most endorsers agree on the transaction, and then proceeds to create the transaction and passes it to the ordering service. Ordering nodes (orderers) establish the total order of all transactions, batch multiple transactions into blocks, and output a hash-chained sequence of blocks containing transactions. But they do not participate in the execution nor in the validation of transactions. Then the orderers send blocks back to the endorsers. Finally, the endorsers validate blocks including the identities of primary node, parameters, the identifier of the DSS smart contract, and signatures on endorsements of the transaction. 6) Peers update the spectrum sharing ledger using the blocks [35]. 7) BOPs and SOPs obtain the spectrum sharing strategy from their ledgers. 8) After that, the rewards for the primary node are paid by the transaction fees from both BOPs and SOPs. 9) BOPs pay SOPs for buying bandwidth after receiving the spectrum sharing strategy. If BOPs or SOPs violate the spectrum sharing rule, their deposits will be confiscated.

IV. MLMF STACKELBERG GAME
In this section, we first give the utility functions of BOPs and SOPs, and then describe their problems. Specifically, we model the interactions between BOPs and SOPs as a MLMF Stackelberg game.

A. Utility Function
Each participant aims to maximize its revenue driven by its selfishness. SOPs decide the pricing strategies to maximize their revenues based on the budgets of BOPs and their own bandwidth constraints. BOPs determine the buying strategies given the pricing strategies of the SOPs. Therefore, the interactions between SOPs and BOPs can be modeled as a MLMF Stackelberg game, where SOPs and BOPs act as leaders and followers, respectively. We consider the reasonable utility functions of SOPs and BOPs, so that the pricing and buying strategies can be obtained.
For SOPs, the revenue function can be defined as the income by providing bandwidth to BOPs minuses its service cost and charge for the primary node. The service cost of SOP n is directly related to the provided bandwidth and is given by C n b m,n , where C n is the cost per unit bandwidth. Therefore, for SOP n, the revenue function can be defined as follows: For BOPs, the more bandwidth they buy, the larger utility they may receive. The utility should be an increasing function of the bought bandwidth. Hence, for BOP m, a log function can be used to model the utility which can be defined as: where w m denotes the weight of BOP m in current DSS, which is a positive real number. η m is the transmission channel gain of BOP m, and η m ∈ [0, 1].

B. Problem Formulation
Given the utility functions of SOPs and BOPs, we can formulate the optimal spectrum buying and pricing problems for the lower and upper layers of the MLMF Stackelberg game. The lower-layer game can be defined as follows.
Problem 1: The problem in the lower layer (followers' side) can be formulated as: Since the other BOPs' buying strategies B −m affect the SOPs' pricing strategies p, the utility function U m is an implicit function of B −m . The first constraint in (5) means that the bandwidth purchased from SOPs is nonnegative. The second constraint guarantees that the cost of BOP m's buying bandwidth cannot exceed its budget Q m . The third constraint guarantees that the bandwidth which SOP n sells to all BOPs cannot exceed its own available bandwidth B n .
At the upper layer, the optimization problem of SOP n can be defined as follows.
Problem 2: The problem in the upper layer (leaders' side) can be formulated as: p −n , B) s.t. p n ≥ C n , ∀n ∈ N , The first constraint in (6) guarantees that the utilities of SOPs are nonnegative. The second constraint means that the price p n cannot exceed its maximum value P n . Considering the scarcity of spectrum, the less bandwidth SOPs have, the higher prices they may set. The maximum price P n should be related with B n . Suppose that P n = φ n exp(−B n / max{B 1 , . . . , B N }), where φ n is the weight factor.
For a MLMF Stackelberg game, its Stackelberg equilibrium is the Nash equilibrium between the leaders and followers. The Nash equilibrium of a game is a point at which no player (leader or follower) can unilaterally increase its utility by changing its strategy without deteriorating the utilities of the other players [36]. In this case, the Nash equilibrium point is expressed by the best response that is the optimal strategy of one player, which is defined as follows: Definition 1: Let B * and p * be the optimal strategies of BOP and SOP, respectively. The point (B * , p * ) is the Stackelberg equilibrium of the MLMF Stackelberg game if it satisfies the following conditions. For each BOP m, and for each SOP n, where b m,n and p n are arbitrary feasible strategies for the BOP and the SOP, respectively.

V. SOLUTION OF THE MLMF STACKELBERG GAME
In this section, we first analyze the existence and uniqueness of the Nash equilibrium in terms of the lower-layer and upperlayer problems, respectively. Then, we analyze the solution of the lower-layer problem, and leverage the root mean square propagation (RMSProp) algorithm to solve the upper-layer problem.

A. Lower Layer (Followers' Side) Analysis
For the lower-layer game, each BOP decides its buying strategy based on the SOPs' pricing strategies p. We have the following proposition about the lower-layer Nash equilibrium.
Proposition 1: The Nash equilibrium point of the lowerlayer game exists and is unique, regardless of SOPs' pricing strategies p.
Proof: As defined in Problem 1, the strategy space of BOP m is [0, b max m,n ] which is nonempty, closed, and convex, and b max m,n is defined as: where b l m,n and b r m,n are defined as: Therefore, the lower-layer game exists a Nash equilibrium [37]. The first and second order derivatives of the utility function U m with respect to b m,n are calculated as: and where w m ≥ 0 is the profit coefficient of BOP m. Consequently, we have ∂ 2 U m /∂b 2 m,n ≤ 0. Thus, the utility function U m is a concave function with respect to b m,n , and the problem for each BOP in the lower-layer game is a convex optimization problem. The interaction among the BOPs forms a concave M-person game. Therefore, the Nash equilibrium point of the lower-layer game always exists and is unique.
The first order derivative of the utility function U m should satisfy (∂U m /∂b m,n )| bm,n =0 ≥ 0, ∀m ∈ M. Otherwise, BOPs have no motivation to buy bandwidth from SOPs because of no profit. It means that p n ≤P , whereP = min{w 1 η 1 , . . . , w M η M }. We have C n ≤ p n ≤ P n based on the constraints in (6). Therefore, the pricing strategy space of SOP n is [C n , min{P n ,P }], which is bounded. According to Proposition 1, the lower-layer game can be decomposed to M distributed optimization problems. Sequentially, we use the Karush-Kuhn-Tucker (KKT) conditions to solve Problem 1, and its optimal solution is obtained in the following proposition.
Proposition 2: For a given pricing strategy p, the optimal solution for Problem 1 is given by: where C1, C2, and C3 are defined in (25), (27), and (29), respectively. Proof: Please refer to Appendix A.

B. Upper Layer (Leaders' Side) Analysis
On the leaders' side, each SOP determines its unit price p n to maximize its revenue R n . Note that the pricing strategies of SOPs directly affect the buying strategies of BOPs. Consequently, the pricing strategies of SOPs affect each other's revenue. The upper-layer game among SOPs is noncooperative and competitive. In the following, we will analyze the Nash equilibrium of the upper-layer game, and design an algorithm to find its solution.
For the upper-layer game, we first prove the existence and uniqueness of its Nash equilibrium point.
Proposition 3: The Nash equilibrium point of the upperlayer game exists and is unique.
Proof: Please refer to Appendix B. Given the pricing strategies of all leaders, the followers will determine their buying strategies. For the MLMF Stackelberg game, we have the following proposition.
Proposition 4: The Stackelberg equilibrium point of the MLMF Stackelberg game exists and is unique.
Proof: As analyzed in Proposition 2, each BOP can find its optimal buying strategy, which is unique given the pricing strategies. Each SOP in the upper-layer game has a unique Nash equilibrium point, based on Proposition 3. Thus, we can conclude that the Stackelberg equilibrium point of the MLMF Stackelberg game exists and is unique.
The Nash equilibrium point of the lower-layer game can be found based on Proposition 2, given in (13). However, the Nash equilibrium point of the upper-layer game cannot be expressed in a closed form, and can only be calculated through numerical manners. Next, we leverage the RMSProp algorithm with an adaptive learning rate to find the numerical solution of the upper-layer game, which is an extension of gradient descent in order to locate the optimization of an function. In the RMSProp algorithm, the gradient of the objective function gradually approaches or becomes zero based on the cyclic iteration scheme. At the i-th iteration, the pricing strategy of SOP n is defined as: where δ i is the adaptive learning rate at the i-th iteration. ε (ε > 0) is a constant which avoids division by zero. g n,i denotes the partial derivative of the objective function of SOP n at the i-th iteration, defined as follows: Then, the optimal solution of the upper-layer game can be solved through several iterations. The detail of the optimal pricing and demand optimization algorithm is shown in Algorithm 1. We have the following lemma for the RMSProp algorithm.
Lemma 1: The RMSProp algorithm will converge at a rate of O (log(Θ)/ √ Θ), where Θ is the maximum rounds of iteration.
Proof: The convergence of the RMSProp algorithm has been proved in [38]. The upper-layer game among SOPs is convergent by using a batch size as large as the number of maximum rounds Θ, and its convergence rate is O (log(Θ)/ √ Θ) under satisfying the necessary restrictions listed in [38].

VI. SIMULATION RESULTS
In this section, we focus on the spectrum sharing in the consortium blockchain to verify the feasibility of our design. We first show the numerical results to validate the theoretical analysis and evaluate the performance of the MLMF Stackelberg game. Then, we evaluate the performance of spectrum sharing in Hyperledger Fabric. 3

A. Evaluation of the MLMF Stackelberg Game
We consider M BOPs and N SOPs in the spectrum sharing market, as illustrated in Fig. 1. We assume that SOPs provide the same spectrum leasing service for all BOPs, which means that the buying strategies of BOPs are determined only by their prices. Parameters in the RMSProp algorithm are set as δ i = 0.001, ε = 10 −6 , and γ i = 0.9 which is similar to [39], at each iteration.
First, we analyze the convergence of the MLMF Stackelberg game, where the bandwidths provided by 5 SOPs are {B n } = {20, 40, 60, 80, 100} MHz. The initial prices of all SOPs are set as 2, i.e., p n = 2, ∀n ∈ N . All cost coefficients of SOPs while ||U − U old || > ξ and j < J do 6: U old = U; 7: for m = 1 to M do 8: for n = 1 to N do 9: Calculate b m,n according to (13) // Calculate the pricing strategies at the upper-layer 18: game; 19: while ||R − R old || > ξ and k < K do 20: R old = R; 21: for n = 1 to N do 22: Calculate g n according to (15); 23: Calculate p n according to (14); 24: p[n] = p n ; // p updates p n ; 25: Calculate R n according to (3); 26: R[n] = R n ; // R updates R n ; 27: end for 28: k = k + 1; 29: end while 30: if ||U − U old || < ξ and ||R − R old || < ξ then 31: break 32: end if 33: end for 34: return (B, p) are assumed to 1, i.e., C n = 1, ∀n ∈ N , similar to the configuration in [8]. The weight factor of SOP n is set to φ n = 10. The BOPs' budgets are set to follow a Poisson distribution with a mean value of 30, i.e., Q m ∼ Poisson (30). The BOPs' profit coefficients {w m } are set to follow an uniform distribution between 10 and 20. Similarly, the bandwidth efficiencies {η m } are set to follow an uniform distribution between 0.7 and 0.9.
As shown in Fig. 3, the price of each SOP gradually increases at first, and then they reach their plateaus after about 10 iterations, which means that the upper-layer game reaches the Nash equilibrium. We can observe that the less bandwidth SOP owns, the higher price it will set, which is straightforward and follows the spectrum trading market. In Fig. 4, the   revenue of each SOP increases and then fluctuates at first, because the update of a SOP's pricing strategy will affect other SOPs' utilities. In addition, we can obtain that the SOP owning more bandwidth sets a lower price, but it still achieve a higher revenue.
After that, we consider a 3 SOPs and 30 BOPs cases, where SOPs provide 40MHz, 80MHz, and 120MHz bandwidth, respectively. The unit prices and cost coefficients of SOPs remain the same as above. The budgets of BOPs follow Q m ∼ Poisson (20). For BOPs, the profit coefficient is 10, i.e., w m = 10, and the bandwidth efficiency is 0.8, i.e., η m = 0.8, ∀m ∈ M. We select one BOP and vary its budget from 0 to 40, with a step size 2. As illustrated in Fig. 5, the BOP can not buy bandwidth from SOP 1 with the highest price when the BOP's budget is very low. The BOP's bandwidth bought from each SOP increases gradually when its budget is less than 10. After that, the BOP's bought bandwidth keeps steady, which is because of the limited bandwidth of SOPs.
Then, we evaluate the revenue of each SOP in the proposed algorithm and compare with a fixed pricing approach. In this simulation, the parameters except the budget Q m are the same as in the first simulation. All BOPs' budgets are identical and we vary each BOP's budget Q m from 0 to 40, with a set size 4. The price of each SOP is the initial price in the fixed pricing approach. As illustrated in Fig. 6, when the total budgets of BOPs is less than 400, the revenue of SOP 2 in the proposed algorithm is lower than that in the fixed pricing approach. It suggests that a SOP with a high price obtains a lower revenue in the proposed algorithm, when there are abundant spectrum resources. However, the revenue of each SOP in the proposed algorithm is more than that in the fixed pricing approach, when the BOPs' demand of spectrum resource exceeds SOPs' supply, e.g., total budgets of BOPs more than 600. Besides, each SOP reaches its maximum revenue faster in the fixed pricing approach. Because it is easier to run out of bandwidth under a fixed price, when the bandwidth demand is high.
Finally, we compare the convergence time of the proposed algorithm with Greedy-SM and Random-SM mechanisms proposed in [40], which are based on the greedy algorithm to match buyers with sellers. The convergence time is the time from the beginning of an algorithm to the completion of its convergence. As shown in Fig. 7, we can observe that the convergence time of the proposed algorithm is shorter than Greedy-SM and Random-SM. This is because the proposed algorithm always maximizes the utilities of BOPs and SOPs with simple judgements and calculations according to (13) (14), while Greedy-SM and Random-SM obtain the local optimal utilities of operators with complex calculations.
From the above simulations, we can observe that the game reaches the Nash equilibrium after 10 iterations, but the number of iterations I can be set to 20 in the DSS smart contract for ensuring the convergence of the game. The buying and pricing strategies formulated in the MLMF Stackelberg game are rational to BOPs and SOPs in both abundant and short spectrum scenarios.

B. Evaluation of Spectrum Sharing in Hyperledger Fabric
In this section, we evaluate the performance of spectrum sharing in Hyperledger Fabric. As one of consortium blockchains, Fabric is a extensible blockchain system for running distributed applications and one of the Hyperledger projects hosted by the Linux Foundation [41]. Compared to the traditional blockchain, Fabric reaches a consensus much more quickly and with less effort, and achieves higher end-toend throughput. Consequently, we leverage Fabric to evaluate the spectrum sharing assignment.
We implement the deployment of a Fabric v2.2 network on 4 Linux desktops, and each that has the same configurations as illustrated in Table II. Each Linux desktop consists of the same number of operator organizations, and organizations are deployed in docker containers as virtual networks. Each organization includes a peer node that also acts as leader, committing, endorsing, and anchor peer, and an orderer node. We select the Fabric's native Kafka consensus, an efficient consensus protocol, for the ordering service. In the blockchain network, the batch timeout is fixed to 2 seconds (s), the batch size is set to 32KB, and the maximum message count is fixed to 10 transactions. 4 According to the regulations in Fabric, a block is synchronized to distributed ledgers of organizations in three cases after the consensus peers reach a consensus on the block: (1) The delay of block synchronization triggers the maximum synchronization timeout, which is set to 1s in our designed blockchain network; (2) The number of blocks stored in a cache triggers the maximum block number, which is set to 30 in our designed blockchain network; (3) The data size in the cache triggers the maximum data size, which is set to 512KB in our designed blockchain network.
Our evaluations focus on the core task of spectrum sharing (i.e., running the DSS smart contract and the primary node sending out the buying and pricing strategies to consensus peers), as it most directly impacts the spectrum sharing system's QoS. Specifically, two metrics are evaluated: submission time, which is the time between when the primary node starts to calculate the buying and pricing strategies after collecting spectrum sharing requests (i.e., step 3 in Fig. 2) and when each endorsing peer in each organization receives the strategies (i.e., step 4 in Fig. 2), and latency, which is the time between the buying and pricing strategies calculated by the primary node (i.e., step 3 in Fig. 2) and all operators receiving the buying and pricing strategies (i.e., step 7 in Fig. 2).
In the proposed DSS system, a block of the spectrum sharing ledger supports all transaction information, e.g., the requesting and selling information, the buying and pricing strategy, and ID of each operator, etc. A block header of data instance is listed, as shown in Fig. 8. We can get data hash, block number, block size, and create timestamp, etc., by querying the block header. The block header only stores the data Hash of the transaction information, while it is recorded in the block body. As listed in Table III, the data recorded in a block gradually increases with the organization's continual entry to the system, which results in the increase of the block size and submission time, especially when the number of organizations is very large.  Then, we evaluate the submission time. As shown in Fig. 9, the mean values of the submission time are 5.46s, 5.49s, 5.70s, 6.16s and 6.73s under 10, 20, 30, 40, and 50 organizations, respectively, and they gradually increase as the number of organizations increases. The intervals between the submission time are 0.03s, 0.21s, 0.46s, and 1.32s, respectively. This suggests that the intervals of submission time gradually increase with organizations continually joining the system.
Finally, we compare the average latency under three classical consensus algorithms, i.e., practical Byzantine fault tolerance (PBFT) [42], Raft [43], and Kafka. As shown in Fig. 10, the average latency increases gradually with the number of consensus nodes. However, compared with Raft and Kafka, PBFT produces longer latency to reach a consensus on the spectrum sharing strategy, especially when the number of consensus nodes is larger than 16, whereas the latencies with Raft and Kafka are less affected by the number of consensus nodes. In addition, the performance of Kafka is better than that of Raft. That is because Kafka does not rely on the peer-to-peer communication between nodes. Compared with Raft and PBFT, Kafka is more suitable for multi-operator DSS scenario, which produces less end-to-end latency.

VII. CONCLUSION
In this paper, we have proposed a consortium blockchainbased secure and efficient DSS framework with guaranteed revenue and QoS. Each operator can adaptively act as spectrum provider or spectrum requestor based on its demand, and the spectrum allocation is made on the chain with the DSS smart contract. To guarantee the fairness of spectrum sharing, we have presented a MLMF Stackelberg game to determine the buying and pricing strategies of BOPs and SOPs, and developed the solution leveraging KKT conditions and RMSProp algorithm. We have implemented the DSS in Hyperledger Fabric, and evaluated the latency and throughput performance, which shows that the submission time and average latency increases with the participants.

APPENDIX A PROOF OF PROPOSITION 2
Let λ 1 m , λ 2 m and λ 3 m be Lagrange multipliers that are associated with the constraints in Problem 1, respectively. Then, the Lagrangian function is given as follows: The KKT conditions of Problem 1 are listed as follows. Stationarity condition: Primal feasibility conditions: b m,n ≥ 0, Dual feasibility conditions: Since 2016, he has been with the Nanjing University of Aeronautics and Astronautics and has been appointed as a Distinguished Professor. He was appointed the Changjiang Distinguished Professorship in 2016. His current research interests span the areas of wireless communications and statistical signal processing, with emphasis on system design of software defined radio, cognitive radio, and smart radio.
Xianbin Wang (Fellow, IEEE) received the Ph.D. degree in electrical and computer engineering from the National University of Singapore in 2001.
He is a Professor and the Tier-1 Canada Research Chair with Western University, Canada. Prior to joining Western, he was with Communications Research Centre Canada (CRC) as a Research Scientist/Senior Research Scientist from July 2002 to December 2007. From January 2001 to July 2002, he was a System Designer with STMicroelectronics. He has over 450 highly cited journal and conference papers, in addition to 30 granted and pending patents and several standard contributions. His current research interests include 5G/6G technologies, Internet-of-Things, communications security, machine learning and intelligent communications.
Dr. Wang has received many awards and recognitions, including the Canada Research Chair, the CRC President's Excellence Award, the Canadian Federal Government Public Service Award, the Ontario Early Researcher Award, and the six IEEE Best Paper Awards. He currently serves/has served as an Editorin-Chief, an Associate Editor-in-Chief, an Editor/Associate Editor for over 10 journals. He was involved in many IEEE conferences, including GLOBECOM, ICC, VTC, PIMRC, WCNC, CCECE, and CWIT, in different roles, such as the General Chair, the Symposium Chair, a Tutorial Instructor, the Track Chair, the Session Chair, the TPC Co-Chair, and a Keynote Speaker. He has been nominated as an IEEE Distinguished Lecturer several times during the last ten years. He is currently serving as the Chair of IEEE London Section and the Chair of ComSoc Signal Processing and Computing for Communications Technical Committee. He is a Fellow of Canadian Academy of Engineering, a Fellow of Engineering Institute of Canada, and an IEEE Distinguished Lecturer.