# A Blockchain-Assisted Security Protocol for Group Handover of MTC Devices in 5G Wireless Networks
## 3 Preliminaries
### Blockchain  
Blockchain is a collaborative distributed ledger that utilizes multiple computer hosts/nodes in a network to store and manage transaction data. Each host maintains a complete copy of the ledger, eliminating the necessity for a single central authority. Transaction data are organized in chronological order into blocks, with each block containing a certain number of transaction records, typically linked to the previous block utilizing a hash value, forming a chain. It ensures the immutability of transaction data. To ensure the ledger remains consistent across all hosts, the blockchain network uses a consensus algorithm to determine which hosts have the authority to add new blocks. This prevents malicious hosts from tampering with ledger data. Blockchain employs encryption technology to safeguard the confidentiality and integrity of transaction data. Each transaction undergoes a digital signature.  
Blockchains are categorized into three types [19]. Public blockchains are open allowing any user to join the blockchain network, view the ledger, and participate in the consensus process. Private blockchains are usually controlled by specific entities or organizations, and only invited participants can join the blockchain network. Consortium blockchains are managed collaboratively by multiple entities or organizations, allowing these participants to share data and jointly manage the blockchain network.  
In the system under the study, in normal circumstances, around a small cell controlled by a base station, there are six adjacent cells designated as neighbors. The base station of this cell and those of the adjacent cells are used as nodes in a blockchain network. Each 5G base station in the network serves as a private blockchain node, responsible for storing the public key information of MTCDs. Each base station maintains a complete copy of the blockchain. After an MTCD completes initial registration at a nearby base station, the source base station adds the MTCD's public key information to the blockchain by creating a new transaction. To reduce storage overhead, each block contains multiple transaction records. These transactions are verified by nodes in the blockchain network and consensus can be achieved with other nodes using the Practical Byzantine Fault Tolerance (PBFT) consensus algorithm. Once a new block is accepted by the other blockchain nodes and added to the blockchain, it is distributed to all nodes, including the target base station, thereby updating their blockchain copies. When an MTCD moves from a location controlled by the source base station to the location controlled by the target base station, during the handover preparation phase, the target base station will search for the MTCD's public key information on the entire blockchain.  
This blockchain consists of numerous blocks, each with a size of 1 MB. Each block is stored as a file containing multiple transaction records, each of which includes the public key information of an MTCD. Given that we use public keys based on the elliptic curve secp256k1 with public keys of 256 bits in length according to [20]. Together with other transaction information including transaction inputs, outputs, version, and other fields, and transaction fees, the total comes to approximately 180 Bytes per transaction. Therefore, using Equation (1), we can calculate how many transactions can be stored in a block. Sincethe size of a block is primarily composed of transaction data, for simplicity, we omit other block information in this calculation.  
\[N=\frac{M}{P} \tag{1}\]  
where \(N\) represents the number of users that the base station can serve, \(M\) is the block size, and \(P\) is the size of the transaction data; the number of transactions that can be stored reaches into the thousands. Considering that the number of MTCDs under a single base station's coverage is only in the dozens, the capacity of the blockchain to store MTCD public key information far exceeds the needs of a group of MTCDs.