# Blockchain-Based UAV-Assisted Mobile Edge Computing for Dual Game Resource Allocation
## 3 Model of a Drone-Assisted Mobile Edge Computing System
### Blockchain Resource Transaction Framework  
There are a total of three roles in this system, namely the edge computing resource allocator, the edge computing resource requester, and the final demander of edge computing resources. As shown in Figure 2, the user is the final demander of edge computing resourcesand sends a resource request to the UAV, specifically including the service demand and the price it is willing to pay [34]. As the demander of edge computing resources, the UAV collects and summarizes the user's demand and sends it to the ECS.Server (ECS). The ECS is the edge computing resource allocator that receives and processes the UAV's resource requests, records the transaction information, executes the smart contract for resource allocation, and maintains the transaction records in the blockchain. For the resource allocation process and user request sending, the user sends the resource request to the drone. For drone request aggregation, the drone collects requests from multiple users and requests resources from the ECS. The ECS records transactions, recording and encrypting all incoming resource requests and packaging them into blocks. The ECS creates and verifies the blocks through the PoW consensus mechanism and adds them to the blockchain. The ECS executes the resource allocation through the smart contract and receives rewards from the blockchain system. Blockchain integration significantly enhances the security and transparency of the UAV-MEC system through its tamperability, authentication, smart contracts, decentralized architecture, and transaction transparency. Specifically, distributed ledger and cryptographic hashing technologies ensure that transaction data cannot be tampered with, and public-private key encryption and digital signatures enable authentication of UAVs, edge servers, and users to prevent illegal access. Smart contracts automatically execute resource allocation and transaction settlement, reducing human intervention and guaranteeing the fairness and transparency of transactions. The decentralization mechanism improves the system's anti-attack capability, prevents DDoS attacks and single points of failure, and enhances system robustness. In addition, the open ledger of the blockchain makes all transaction records auditable and traceable, ensuring a transparent and verifiable resource allocation process. Together, these features enhance the security, reliability, and transparency of the UAV-MEC system in complex environments. The drone sends an edge computing resource request to the ECS, including its requirements and the price of the service. The ECS records these requests as transaction information, including the request time, requester identity, resource requirements, service price, and so on [35]. When the transaction information reaches a certain number or time interval, the ECS starts to create a new block and packs the collected transaction information into the block. The transaction information is encrypted with a public key and a private key to ensure data security and privacy. According to the set PoW consensus mechanism,  
Figure 2: Blockchain resource transaction framework. ECS generates a computational puzzle as a mining task. ECS uses its computing resources to perform hash operations and tries to solve the PoW puzzle to find an appropriate hash value (i.e., the \"proof of work\" for the block). Once the ECS finds a valid hash value, it sends it to other nodes in the blockchain network for verification. Other nodes verify the validity of the hash. If a majority of nodes (e.g., more than 50%) confirm its validity, a consensus is reached and the block is considered valid. The verified block is added to the blockchain and becomes part of it [36; 37; 38]. All nodes update their local ledgers by adding the newly generated block to ensure the consistency of the blockchain data. The ECS that successfully mines is rewarded with the appropriate credit currency as an incentive to participate in maintaining the blockchain and verifying transactions.