Cooperative communication method based on block chain for a large number of distributed terminals

The cooperative communication of distributed terminals has many performance advantages and wide application prospects. However, it lacks effective trust foundation between distributed terminals and lacks data security guarantee. Block chain naturally has the properties of transparency, tamper-proof, and full traceability. It can effectively solve the trust problem between untrusted terminals and ensure data security. Thus, we introduce block chain into the cooperative communication of large number terminals, propose a cooperative communication method based on block chain, design a multi-chain structure to reduce resource consumption, and give the detailed working procedure of the cooperative communication method. In the working procedure, we propose a source-relay pairing and pricing scheme based on Kuhn-Munkres algorithm (SRPP-KM) to solve the optimal source relay pairing and transaction price, and design a lightweight consensus mechanism based on intra-region dynamic delegated Byzantine fault tolerant (DDBFT) and interactive updates between regional chain and main chain to reduce resource waste and achieve fast consensus. Analyses show that the proposed method can establish trust foundation between terminals and promote cooperation between terminals. Simulation results show that the proposed method can obtain higher sum revenue of sources while satisfying relays’ expected revenue and achieve faster consensus when compared with other methods.

block chain have developed rapidly, such as bitcoin payment system and Ethereum smart contract platform, etc. Block chain is a distributed ledger maintained by a peer-topeer network, in order to make the transactions written in the ledger valid, the network participants must reach a consensus on these transactions. The operation of block chain network does not rely on any centralized trusted third-party. So block chain naturally has the properties of transparency, tamper-proof, and full traceability.
Existing researches on the application of block chain in wireless communication mainly focused on the terminal transaction and data privacy protection in IoT [11], computing task offloading in mobile edge computing [12], spectrum management [13], etc.
From [11]- [13], we can see that the trust between different individuals can be established through block chain. Therefore, this paper intends to introduce block chain (as an incentive mechanism) into cooperative communication of large number MTs to establish the trust foundation between MTs. In this block chain system, relay forwards data for source, can obtain the rewards (electronic money) paid by source. By writing this transaction information into block chain and making it public in an open and transparent manner, the deception between source and relay can be avoided, and relay can be motivated to forward data for source.
The main contributions of this paper are as follows: 1) We propose a cooperative communication method based on block chain for a large number of distributed MTs, design a multi-chain structure based on region division to reduce resource consumption, give the detailed working procedure of the cooperative communication method.
2) We propose a source-relay pairing and pricing scheme based on KM algorithm (SRPP-KM). This scheme encourages terminals to cooperate through the transactions between source and relay, and uses Kuhn-Munkres (KM) algorithm to solve the optimal source-relay pairing and corresponding transaction price.
3) We propose a lightweight consensus mechanism based on intra-region DDBFT and interactive updates between regional chain and main chain (IRD-IURM). This consensus mechanism adopts consortium chain and DDBFT in each region, and it can reduce resource waste and achieve fast consensus.

A. RELATED WORKS ABOUT COMBINATION OF BLOCK CHAIN AND COOPERATIVE COMMUNICATION
To the best of our knowledge, there has been very little research about the combination of block chain and cooperative communication, such as [14], [15]. Reference [14] added jammer at relay to prevent information from being eavesdropped on, and realized the transaction between source and relay's jammer based on an auction mechanism to ensure the security of the physical layer. The purpose of using block chain in [14] was to prevent information eavesdropping, whereas in our work, the purpose is cooperative information transmission. Thus, the model and analysis in [14] are totally different from ours.
Reference [15] introduced block chain into relay-assisted D2D communication to realize the incentive of cooperation between nodes. However, the system model in [15] is different from that in our work: reference [15] focused on the cooperation of a small number of terminals, while our work focuses on the cooperation of a large number of terminals. For a large number of terminals, the consensus mechanism consumes large terminal resources, so we design a multi-chain structure based on region division and a lightweight consensus mechanism in this paper to reduce resource consumption. By contrast, [15] did not mention what consensus mechanism should be used and did not consider the resource consumption of terminals.

B. RELATED WORKS ABOUT CONSENSUS MECHANISM OF BLOCK CHAIN
Introducing block chain into the cooperative communication of large number MTs, we need to solve the problem of large resource consumption of consensus mechanism. In a distributed system of block chain, there is no management center, so a consensus mechanism is needed to ensure the reliability of block generation and verification. In existing consensus mechanisms, the proof of work (POW) protocol is one of the most important consensus mechanisms because of its simplicity and effectiveness. Its "mining" process is slow and long-term, takes up large computing resources and consumes a significant amount of energy. Its block verification process requires many information exchanges, takes up large communication resources and affects the network throughput. For MT with limited resources and low delay requirements, it is difficult to deploy POW directly on MT.
Based on this, some researchers have proposed lightweight consensus algorithms, trying to reduce computing resource consumption, improve network throughput and reduce time delay of block verification. For example, [16] studied how to reduce the difficulty of "mining". Reference [17] introduced the consortium chain to solve the problem that ordinary devices cannot implement POW. The consortium chain can be regarded as a special block chain that maintains a distributed ledger through authorized institutions or some authorized nodes. In [18], POW was implemented on MT by offloading computing-intensive tasks (such as the consensus process) to an edge server. Reference [19] proposed proof of stake (POS) to replace POW, where the "miner" is selected based on the stakes that they are holding, and members with more stakes have higher chances to be "miner". [20] adopted delegated proof of stake (DPOS) consensus mechanism to reduce resource consumption. Similar to the POS or DPOS, [21] proposed a consensus mechanism based on user reputation, the user with the highest reputation is "miner". References [22] and [23] respectively used Byzantine fault tolerant (BFT) algorithm and dynamic delegated Byzantine fault tolerant (DDBFT) algorithm to reduce the information exchanges during block verification. The comparison of different consensus mechanisms in [16]- [23] is given in Table I. For a certain number of terminals, the methods in [16]- [23] can reduce the computing resource consumption and execution time of consensus mechanism. However, these methods cannot be directly applied into the cooperative communication of large number MTs. For large number MTs, these consensus mechanisms [16]- [23] still consume large resources due to the large amount of information recorded and exchange, MT cannot bear such resource consumption. In addition, MT is mobile, and transaction information traceability of MT is still a problem need to be solved. So, it is necessary to find a lightweight consensus mechanism which is suitable for the cooperative communication of large number MTs.

C. RELATED WORKS ABOUT SOURCE-RELAY PAIRING IN COOPERATIVE COMMUNICATION
There are many studies about source-relay pairing (or the relay selection for source) in cooperative communication. For example, [24]- [30] and [1] introduced a series of relay selection methods to improve system performance, such as opportunistic relay, partial relay selection, hybrid relay selection, relay selection with inter-relay cooperation, etc. The relay selection methods discussed in [24]- [30] and [1] were selecting one or more relays for a single source, not applicable to multi-source scenarios (source-relay pairing situations). References [31]- [36] tried to study source-relay pairing for multi-source multi-relay cooperative wireless network. Among them, [31]- [32] discussed selection cooperation or coding cooperation scheme to improve diversity order. [33]- [34] studied source-relay pairing for cognitive secondary user network to reduce the interference to the primary receiver. Reference [35] pointed out that in order to improve the system performance, the optimal source-relay pairing can be achieved by exhaustive search, but the computation complexity of exhaustive search is high. To reduce the computation complexity of source-relay pairing, [35] proposed a low-complexity relay selection method using weighted bipartite graph model. Reference [36] proposed a subset selection (SSS) method to reduce computation complexity. In the SSS method, each source finds its own optimal relay sequentially, so we call it "sequential relay selection scheme" in this paper. However, [31]- [36] did not consider block chain, and did not have incentive mechanism for terminal cooperation. In our work, we introduce block chain into cooperative communication to motivate terminals to cooperate and propose a sourcerelay pairing and pricing scheme based on KM (Kuhn-Munkres) algorithm to complete source-relay pairing and transaction pricing in block chain. In addition, we use a bipartite graph similar to [35] to reduce the computation complexity of source-relay pairing, although the system model of [35] is different from ours.
The comparison of different source-relay pairing (or relay selection) methods in [24]- [36] is given in Table II.

Advantages (or important conclusions) Disadvantages
Relay selection for single source [24] Best relay selection to maximize effective capacity Single source and multi-relay, amplify-and-forward (AF) relaying High effective capacity They are not applicable to the multisource scenarios, and they do not have incentive mechanism for terminal cooperation. [25] SNR-suboptimal multiple relay selection Single source and multi-relay, AF relaying High signal-to-noise ratio (SNR), low computational complexity [26] Max-max relay selection (MMRS), hybrid relay selection (HRS) for relays with buffers of finite size Single source and multi-relay, decode-and-forward (DF) relaying, relays are equipped with buffers High SNR gain, low outage probability [27] Opportunistic relaying (OR), selection cooperation (SC) Single source and multi-relay, DF relaying The closed-form expressions for the outage and bit error probability (BEP) of OR and SC are obtained.
[28] Partial relay selection Single source and multi-relay, AF relaying, outdated channel estimates The effect of outdated channel estimates on relay selection is summarized. The decrease in outage probability achieved by increasing the number of relays is greater than that of conventional relay networks.
[29]- [30] Select-max relay, distributed switch and stay (DSS) relay, or relay selection with inter-relay cooperation [33]- [34] Source-relay pairing according to link SNR or channel gain in the secondary network Cognitive multi-source multi-relay cooperative networks, AF and DF relaying Reducing the interference to the primary receiver [35] Relay selection based on the simplified metric using weighted bipartite graph model Multi-source and multi-relay, DF relaying High overall rate in interference-limited environment, low complexity [36] Full-set selection (FSS) and sub-set selection (SSS) based on max-min criterion Multi-source and multi-relay, AF and DF relaying The full spatial diversity is achieved.

A. SYSTEM MODEL AND MULTI-CHAIN STRUCTURE BASED ON REGION DIVISION
Considering a wireless network with many BSs and a large number of MTs, when the uplink channel quality of source MT is poor, or the power of source MT is low, it is necessary to use another MT as relay to forward data, i.e., relay cooperative communication. As mentioned, in order to establish trust foundation between source and relay, we intend to introduce block chain into cooperative communication. Relay that helps source to forward data can obtain the reward (electronic money) paid by source. By writing this transaction information into block chain in an open and transparent manner, deceptive behavior between source and relay can be avoided. What is more, the rewards that relay obtains from source can encourage relay to cooperate. For wireless networks with a large number of MTs, no matter what consensus mechanism is used, terminals need to exchange many information, which consumes large communication resources, affects network throughput and causes long block verification delays. Therefore, we consider dividing MTs into multiple block chains to form a multi-chain structure. This method can decrease the number of MTs in one block chain, reduce the resource consumption and the time delays of consensus process.
How to divide MTs into multiple block chains? We all know that source usually selects relay that is not far away from it. This indicates that both the relay selection and the transaction between source and relay are carried out in a certain area. Inspired by this idea, we use the method of regional division to form a multi-chain structure. As shown in Fig. 2, the whole network is divided into several regions according to location and distance, and each region is connected to the main chain of the cloud platform. Fig. 2 shows the multi-chain structure based on region division. Each region has its own regional chain. In each region, the regional chain records the transaction information of MTs in the region, and BSs (in the region) store the regional chain. All regional chains are connected to the main chain of the cloud platform, so it forms a multichain structure. The main chain is responsible for the summary and storage of all regional chains' information. The anchor link between the main chain and all regional chains is shown in Fig. 3. In Fig. 3, the blocks on regional chains and main chain show synchronously linear growth according to the time sequence of the system.
In the multi-chain structure, transaction data are parallel segmented and stored in different regional chains, so this structure can achieve high data concurrency, improve data processing speed and boost system throughput.
6 Cloud platform Regional chain 1 Regional chain n Regional chain N

Information transmission
Blockchain Main chain  After source-relay pairing and pricing, cooperative communication is implemented in two time slots. In the first time slot, sources transmit their own data simultaneously using frequency division multiple access (FDMA) mode as shown in Fig. 5 [36], [37] . Assume j r is  (1) and (2) where the multiplier 1/2 is from the dual-hop transmission in two time slots [1], [31] .

IV. WORKING PROCEDURE OF COOPERATIVE COMMUNICATION METHOD BASED ON BLOCK CHAIN
In order to establish trust foundation among untrusted terminals and encourage terminals to cooperate, this paper proposes a cooperative communication method based on block chain for a large number of MTs. Fig. 6 shows the flowchart of this method. The detailed working procedure is as follows: (1) Sources broadcast their request information. Sources broadcast their request information simultaneously using FDMA mode, and all idle relays and BS receive the request information. The request information of i s includes the wallet address of i s , transmit power of i s and so on. (2) All idle relays that receive request information send response information to BS. Sending response information means it agrees to be relay. The response information of j r includes its expected minimum revenue j x . Note that BS excludes the relays with bad records, and the remaining idle relays are j r , {1,2,...,} jJ Î .
(3) BS finds the source-relay pairing and corresponding pricing. Using source-relay pairing and pricing scheme based on KM algorithm, BS pairs the sources and relays (without bad record) one to one, and gets the corresponding relay transmission power and transaction pricing for each pair. BS notifies the pairing results to all sources and relays. For detailed descriptions of the source-relay pairing and pricing scheme based on KM algorithm, see section V.A. to the wallet of j r .
(6) Transaction information is recorded in block chain. The consensus mechanism based on intra-region DDBFT and interactive updates between regional chain and main chain (IRD-IURM) is used to record the transaction information and relays' bad records in block chain. For detailed descriptions of IRD-IURM consensus mechanism, see section V.B.
(1)Sources broadcast their request information (2)All idle relays that receive request information send response information to BS (1) (6)Transaction information is recorded in block chain

A. SOURCE-RELAY PAIRING AND PRICING SCHEME BASED ON KM ALGORITHM (SRPP-KM)
According to the process of cooperative communication, BS excludes the relays with bad records at first, and then pairs the remaining relays with sources. Thus, we describe the optimal source-relay pairing and pricing as an optimization problem, and solve this optimization problem.
Our purpose is to maximize the sum revenue of all sources while satisfying the expected revenue of each relay, so the optimal source-relay pairing and pricing problem can be rewritten as P1: , ,, , ij p is the transaction pricing between i s and j r . Condition 1 C means that the expected revenue of relay j r is not less an increase in the relay revenue, the source revenue decreases. Similarly, with an increase in the source revenue, the relay revenue decreases. The source revenue and relay revenue are opposite variables, so it is impossible to find the optimal solution of the two variables at the same time. Therefore, the objective of optimization problem P1 is to maximize the source revenue while satisfying the relay revenue.
The solution process of problem P1 can be divided into two steps: first, find the optimal , , , ij rij p p for each pairing of i s and j r (i.e., optimal transmission power and pricing problem); and second, find the optimal pairing coefficient , ij a for all sources and relays (i.e., the optimal pairing problem). Thus, the optimal transmission power and pricing problem for each pairing i s and j r is written as problem P2: P2: , , , . We can get the optimal solution of (10), which is  For problem P3, we need to find the optimal pairing coefficient , ij a for sources and relays. This is equivalent to finding the maximum weight matching of a bipartite graph. Sources and relays are subsets of the bipartite graph, and the connection weight of two subsets is the optimal solution (b) Return a failure flag and end the algorithm 2 for i s .

B. LIGHTWEIGHT CONSENSUS MECHANISM BASED ON INTRA-REGION DDBFT AND INTERACTIVE UPDATES BETWEEN REGIONAL CHAIN AND MAIN CHAIN (IRD-IURM)
In each regional chain, if POW is deployed on MTs, the "mining" process at terminal is slow and long-term, takes up large computing resources and produces large energy consumption. The block verification process needs MTs to exchange verification information, this takes up large communication resources and affects network throughput. Thus, for MT with limited resources and energy, and mobile communication with low delay requirements, POW is not suitable to be directly deployed on MTs. To reduce the resource consumption of MT and decrease block verification delays, this paper adopts a consortium chain in each region. Tasks with high resource consumption, such as "mining" and consensus process, are implemented at BSs. As shown in Fig. 2, in each regional chain, only BSs are responsible for "mining" and verifying new blocks. For the consortium chain in each region, if all BSs compete "mining", their calculations are meaningless when they do not obtain the accounting right, this will cause computing resource waste. In the process of block verification, verification information needs to be exchanged between BSs. When the number of BSs is large (although only a few BSs are shown in Fig. 2, there may be many in practice), the communication consumption will affect network throughput and cause long block verification delays. To reduce computing waste, improve network throughput and decrease the block verification delay in each region, we consider DDBFT consensus mechanism [23], in which the selected main representative BSs are responsible for accounting in turn, and the BFT algorithm is used to audit and verify block. What's more, DDBFT has the advantages of fairness and dynamic of delegated representative BSs and fast block verification. Fig. 7 shows a flowchart of the IRD-IURM consensus mechanism. The detailed descriptions of IRD-IURM consensus mechanism are as follows.
<1> Download blocks. All MTs download blocks from BSs in the region.
<2> Vote for BSs. MTs vote for BSs in the region according to the downloaded blocks. The representative BSs are selected based on the MTs' voting. That is, BSs are sorted according to the number of votes they received from more to less. The first Q BSs with more votes are selected as representative BSs, and the remaining BSs are candidate BSs.
<3> Request to record transaction information. MTs that have participated in transactions broadcast their transaction information, and all BSs receive and record their transaction information. When the time of block generation arrives, MTs request BSs to record transaction information.
<4> Consensus prepare. The main representative BS generates a block and requests consensus, where the main representative BS is selected from representative BSs in turn for each "mining". After receiving request record information from MTs, the main representative BS of the round packages all recorded transaction information and relays' bad records to generate a new block, and then broadcasts the new block to other representative BSs and requests other representative BSs to verify whether the information recorded in the block is correct.
<5> Consensus confirm. After receiving the new block and consensus request from main representative BS, other representative BSs verify the new block according to the transaction information and relays' bad records they have previously recorded. Each of them broadcasts the verification result to all other representative BSs. After receiving verification success messages sent by more than half of the representative BSs, the new block reaches a consensus, each representative BS adds the new block to the block chain. Then, the system scores each representative BS according to its honesty in the process of consensus preparation and consensus confirmation.
<6> BSs reply to MTs. The BSs send the record results to MTs.
<7> Interact with the main chain of cloud platform. After new block is added to the regional chain, the regional chain completes the information exchange with the main chain of cloud platform, and updates the anchor link. The anchor link between regional chains and main chain can be seen in Fig. 3. Then, return to step <3>, i.e., when it is time to generate the next block, the next representative BS, as the main representative BS, is responsible for "mining" in turn. Until the end of a round of "mining", turn to step <8>. <8> Update representative BSs and candidate BSs. After a round of "mining", the representative BSs are sorted according to their scores from high to low. The last M representative BSs with lower scores are changed to candidate BSs, and the top M candidate BSs with higher scores are changed to representative BSs, where M<Q. In this way, representative BSs and candidate BSs are updated according to DDBFT. Then, return to step <3> According to the working process of IRD-IURM and the characteristics of DDBFT [23], we can get that as long as the number of malicious representative BSs does not exceed 3 Q , it can ensure that the error message sent by malicious nodes will not be recognized by other nodes, and this will not lead to Byzantine fault tolerance.

C. THE TRANSACTION TRACEABILITY WHEN MT MOVES AMONG DIFFERENT REGIONS
Due to the mobility of MT, MT may move among different regions, so the transaction information of one MT may be stored in different regional chains. How can we solve the transaction traceability problem when MT moves among different regions? That is, how can we trace the source of payment currency for each transaction? The red anchor link in Fig. 8 shows the tracing of transactions when MT moves among different regions. We intend to modify the structure of each transaction record in blocks, add the regional number, block ID and transaction number of the payer's last transaction before each transaction record in each regional chain. If the payer's last transaction is in another region, then this transaction can be connected to the payer's previous regional chain through the anchor link of regional chains and main chain. The anchor link of regional chains and main chain is shown in Fig. 3. Thus, we can trace the source of payment currency for each transaction. The relay's bad record can also be traced and recorded in this way, we will not repeat the description.

ID of block 1 in region 1
Transaction 5 【The regional number, block ID and transaction number of the MT1's last transaction】 【MT1 pays MT2 ten electronic money】 Last block ID Next block ID

ID of block 2 in region 3
Transaction 9 【The regional number, block ID and transaction number of the MT2's last transaction】 【MT2 pays MT3five electronic money】 Last block ID Next block ID Regional chain 2 Regional chain 3

A. SIMULATION RESULTS OF SOURCE-RELAY PAIRING AND PRICING SCHEME
In order to show the performance of the proposed sourcerelay pairing and pricing scheme, we compare it with the sequential relay selection scheme in [36], random pairing scheme and fixed pairing scheme. In the following figures, "SRPP-KM" means the proposed source-relay pairing and pricing scheme based on KM algorithm (SRPP-KM). "Sequential relay selection scheme" means the subset selection (SSS) method in [36], where each source finds its own optimal relay in sequential order. "Random pairing scheme" means random source-relay pairing for each time, and each pair finds its optimal relay transmission power and pricing. "Fixed pairing scheme" means that fixed sourcerelay pairing is always used.
In the simulations, the number of source nodes is set to I=3, the revenue of per unit achievable rate is 10 m = , the cost of per unit transmission power is 1 e = , the expected minimum revenue of each relay is 1 x = , i.e.,   This result can be obtained from expression (9). The proposed pairing scheme SRPP-KM can achieve higher sum revenue than other schemes, that is because the KM algorithm in SRPP-KM can get the optimal pairing to maximize the sum revenue while other schemes cannot obtain the optimal solution.   Fig. 10 shows the sum revenue of different source-relay pairing schemes changes with the number of relay nodes when ps=10dB. As seen from Fig. 10, the sum revenue of random pairing scheme and fixed pairing scheme shows little change because they have nothing to do with the number of relay nodes. The sum revenue of SRPP-KM and sequential relay selection scheme increases with an increase in the number of relay nodes, this is because both SRPP-KM and sequential relay selection scheme have the process of finding and pairing the optimal relay in order to maximize the sum revenue. The greater the number of relay nodes, the more choices, and the higher the sum revenue.  Fig. 11, the sum transaction pricing of all schemes increases with an increase in p s . The sum transaction pricing of SRPP-KM and sequential relay selection scheme is lower than that of random pairing scheme and fixed pairing scheme, that is because their optimal solutions , ij r p and , ij p for selected relays are lower in order to maximize the sum revenue. Moreover, the sum transaction pricing of SRPP-KM is lower than that of sequential relay selection, this is because SRPP-KM can find the optimal pairing with lower transaction price, while sequential relay selection scheme only finds the pairing for each source in a certain order, which is not the optimal pairing and cannot get the optimal transaction price. That is to say, when compared with sequential relay selection, SRPP-KM can obtain higher source revenue at lower transaction price.  Fig. 12 shows the comparison of sum transaction pricing for different source-relay pairing schemes when ps=10dB. Fig. 12 shows similar results to those in Fig. 11. In addition, we can see that the sum transaction pricing of random pairing scheme and fixed pairing scheme shows little change when the number of relay nodes increases, that's because they have nothing to do with the number of relays. The sum transaction pricing of SRPP-KM and sequential relay selection scheme decreases with an increase in the number of relay nodes. This is because the greater the number of relay nodes, the more choices, the higher the sum revenue, and the lower the transaction price.

B. SIMULATION AND ANALYSIS RESULTS OF IRD-IURM CONSENSUS MECHANISM
In this section, we compare the proposed IRD-IURM consensus mechanism with POW [18], POS [19] and DPOS [20] consensus mechanisms through simulations and analysis. In order to fairly compare these four consensus mechanisms, we simulate all these consensus mechanisms in the multi-chain structure based on region division, POW, POS, DPOS and IRD-IURM are used in each region, and their interactive updates between regional chain and main chain are the same. In simulations, we use Java language, RESTful service architecture and lightweight JOSN data exchange format to build the block chain system. The calculation configuration parameters are as follows: Operating System-windows, Memory-16RAM, CPU-Inter Core i5-10400, JDK-8. In order to test the block delay and maximum transaction throughput of each consensus mechanism, we introduce the transaction simulation module in simulations, which can provide enough transaction data for block generation and consensus.
In simulations, POW [18] refers to bitcoin block chain, the difficulty value of its hash calculation is set to 7, that is, the first 7 bits of the hash value obtained by hash calculation are 0. All the difficulty values of hash calculation for POS, DPOS and IRD-IURM are set to 0, because they do not have "mining" competition. POS [19] refers to alogorand block chain, and uses Byzantine agreement (BA) consensus algorithm based on verifiable random functions (VRFs). DPOS [20] refers to EOSIO block chain and uses DPOS+BFT consensus algorithm, all nodes vote and select 21 consensus nodes, and then the 21 nodes achieve block consensus through the BFT algorithm. In order to show that the proposed IRD-IURM consensus mechanism can achieve rapid consensus, the block delay of different consensus mechanisms in one region is show in Fig. 13. The block delay includes the delay of random number calculating and the delay of block consensus. Compared with the calculating delay and consensus delay, the delay of "miner" selection in POS, DPOS and IRD-IURM can be ignored, so we omit it in simulations. As can be seen in Fig. 13, the block delay of POW is much greater than that of POS, DPOS and IRD-IURM, this is because POW needs "miner" competition, network delay may cause several versions of the chain or two members finding two blocks simultaneously, this delays the block consensus significantly. Whereas in POS, DPOS and IRD-IURM, they omit the process of "miner" competing, select the "miner" based on stakes or voting, so their chains only have one version, plus their difficult value of hash calculation is lower than POW, so their block delay are much smaller than POW. The block delay of POS is greater than that of DPOS, and the block delay of DPOS is greater than that of IRD-IURM. That's because the numbers of nodes participating in consensus in one region for POS, DPOS and IRD-IURM are 110, 21 and 6 respectively. The more nodes participating in consensus, the greater the delay of block consensus, and the greater the block delay. In conclusion, compared with POW, POS and DPOS, proposed IRD-IURM can achieve rapid consensus.
where tran T represents the TT, tran N is the number of transactions that is recorded in blocks during t D time. Figure  14 actually shows the relationship between TT and the time delay. The slope at a certain point of the curve in figure 14 represents the TT of the curve at this time. It can be seen that the TT of IRD-IURM outperforms the TT of other three consensus mechanisms. Therefore, proposed IRD-IURM is suitable for a large number of distributed terminals with a large number of transactions. The detailed TT results of different consensus mechanisms can be seen in Table III. Table III shows the comparison of simulation and analysis results of different consensus mechanisms in one region. From the simulation results, we can see that proposed IRD-IURM can achieve shorter average block delay (ABD) and higher TT than POW, POS and DPOS, these are consistent with the results in Figures 13 and 14.
In addition, according to the simulation results in table III, we found that the following TT calculation expression can be summarized for each consensus mechanism, CEBATPMB TT ABD = (14) The detailed analysis of time complexity, number of messages and number of rounds during block consensus is given as follows.
For POW [18], all nodes in the region use computing power to find a random hash number that meets requirements, the node that first finds the random number will get the accounting right (i.e., to be leader) and generate a new block. During POW consensus, the leader broadcasts the new block to other nodes, other nodes verify and record it. So the number of rounds for message transmission is 1, the number of nodes participating in consensus is the sum of the number of BSs and MTs in the region, that is  For POS [19], referring to alogorand block chain, POS selects the leader based on their stakes, and uses Byzantine agreement (BA) consensus algorithm based on verifiable random functions (VRFs), i.e., an improved BFT consensus. All nodes in the region participate in consensus, so the number of nodes participating in POS consensus is =110 POS N . According to the characteristics of BFT consensus [23], the number of rounds of message transmission is 3, the three rounds are consensus preprepare, consensus prepare, consensus confirm respectively. So the number of messages transmit during POS consensus is 2 231 POSPOS NN -+ , the time complexity of POS consensus algorithm is 2 (2) POS ON , which is the basic time complexity of BFT consensus.
For DPOS [20], referring to EOSIO block chain, all nodes vote and select 21 consensus nodes, the leader is selected from the 21 consensus nodes, and then the 21 nodes achieve block consensus through the BFT algorithm. So, similar to POS, the number of rounds for message transmission during DPOS consensus is 3, the number of messages transmit during DPOS consensus is For IRD-IURM, in one region, 6 representative BSs (i.e., consensus nodes) are selected based on voting from MTs, and the main representative BS (i.e., leader) is selected from the 6 representative BSs, then 6 representative BSs achieve block consensus through the DDBFT algorithm. DDBFT consensus changes the three rounds of message transmission in BFT into two rounds of message transmission, which are consensus prepare and consensus confirm. So the number of rounds for message transmission during IRD-IURM consensus is 2. According to the characteristics of DDBFT consensus [23], the number of messages transmit during IRD-IURM consensus is    Figure 15 shows the influence of region division on block delay. Simulation parameters are the same as those in figures 13, 14 and table III. In addition, it is assumed that the number of nodes participating in consensus is directly proportional to the number of nodes in the region. "IRD-IURM, 1 region" means there is only one region and the region uses IRD-IURM consensus mechanism, i.e., there is no region division. "IRD-IURM, n regions" means BSs and MTs are equally divided into n regions, then IRD-IURM consensus mechanism is used in each region. Other legends can be explained similarly. From figure 15, we can see that IRD-IURM can achieve smaller block delay than POS, this is consistent with the result in Figure 13 and Table III. What's more, for the same consensus mechanism, the more regions are divided, the smaller the block delay. That's because the more regions are divided, the fewer BSs and MTs in each region, thus the fewer nodes participating in consensus, and the shorter the block delay. DPOS and POW can also get the similar results, so we omit them in figure  15. This simulation experiment is carried out on the premise of a sufficient number of transactions. If the number of transactions is limited, the number of regions divided needs to be selected according to the number of transactions. For example, for the IRD-IURM consensus mechanism, simulation parameters are the same as those in Table III. Since the number of transactions that can be recorded per second is about 12000 in each region, if the whole network has 60000 transactions per second, it is appropriate to divide the whole network into 5 regions. If it is divided into 2 regions, transactions cannot be recorded in blocks in time, resulting in transaction accumulation in each region. If it is divided into 10 regions, the number of transactions in each region is small, resulting in a waste of capacity space of each block in each region. Similarly, If the whole network has 36000 transactions per second, it is appropriate to divide the whole network into 3 regions.

VII. DISCUSSION
In this section, we discuss the benefits of introducing block chain into cooperative communication.
(1) Establish trust foundation between untrusted MTs. Using block chain, relay that helps source to forward information can obtain the reward paid by source. When the number of malicious representative BSs does not exceed 3 Q , the source-relay transaction information is correctly written into blocks and is open and transparent to all terminals, thus the fraudulent behavior between source and relay can be avoided. In addition, the payment is automatically executed by smart contract, the source cannot refuse to pay and the relay cannot deny the payment of source. Thus, block chain can establish trust foundation between untrusted MTs.
(2) Encourage MTs to participate in cooperation. Using block chain in cooperative communication, relay can get rewards paid by source, and this can encourage relay to forward information for source.
(3) Improve the security of data transmission. After the cooperative communication of each sourcerelay pair, BS verifies the integrity of the received data. If relay tampers with or discards source's data, BS records that this relay has a bad record. When the number of malicious representative BSs does not exceed 3 Q , relays' bad records are correct, open and transparent to all terminals, so if a relay tampers data, it will have bad record, and other sources will not choose it as a relay. Thus, the IRD-IURM consensus mechanism can prevent malicious relay from tampering information, and improve the security of data transmission.

VIII. CONCLUSION AND FUTURE WORK
This paper introduces block chain into cooperative communication of a large number of MTs, and proposes a cooperative communication method based on block chain.
First, a multi-chain structure based on region division is designed to reduce resource consumption. Then, the detailed working procedure of this cooperative communication method is designed. In the working procedure, a source-relay pairing and pricing scheme based on KM algorithm (SRPP-KM) and a lightweight IRD-IURM consensus mechanism are proposed. Analyses show that the proposed cooperative communication method can establish trust foundation between untrusted terminals, encourage terminals to cooperate. Simulation results show that SRPP-KM can obtain higher source revenue while satisfying relay revenue when compared with other sourcerelay pairing schemes. The IRD-IURM consensus mechanism can achieve fast consensus.
This paper focused on the design of cooperative communication method based on block chain. There remain a number of open problems need to be solved. Our future works are as follows: (1) Source-relay pairing problem when network state changes.
In a real network, the location of the terminals and the channel conditions between terminals may be changing, it is challenging for the system to provide timely feedback on this information and make accurate judgments. Existing source-relay pairing schemes are computationally complex and time-consuming, and cannot sense and dynamically adapt in time according to network state changes. Machine learning is an effective way to solve such problems, so we intend to study a fast pairing method based on machine learning in our future work.
(2) Source-relay pairing problem when the number of sources and relays is random.
The source-relay pairing and pricing scheme based on KM algorithm (SRPP-KM) in this paper is a one-to-one pairing of source and relay on the premise that the number of sources is less than the number of relays. However, in practice, the number of sources and relays is random, so it is difficult to meet the condition that the number of sources is less than the number of relays, and it is difficult to be fixed into one-to-one pairing. Therefore, we will further study the pairing of one source to multiple relays, and the pairing of multiple sources to one relay in our future work.
(3) The problem of dynamic region division In this paper, the multi-chain structure adopts the fixed region division, which does not consider the need to redivide the regions due to the movement of MTs. Moreover, fixed region division easily leads to a large number of transactions in some regions, which are difficult to record in block in time, or a small number of transactions in some regions, which waste the capacity space of block. In the next research, we will discuss the dynamic region division method to ensure that each region can achieve the best performance.