  Recently, blockchain has gained momentum in the academic community thanks to
its decentralization, immutability, transparency and security. As an emerging
paradigm, Multi-access Edge Computing (MEC) has been widely used to provide
computation and storage resources to mobile user equipments (UE) at the edge of
the network for improving the performance of mobile applications. In this
paper, we propose a novel blockchain-based MEC architecture where UEs can
offload their computation tasks to the MEC servers. In particular, a blockchain
network is deployed and hosted on the MEC platform as Blockchain as a Service
(BaaS) that supports smart contract-based resource trading and transaction
mining services for mobile task offloading. To enhance the performance of the
blockchain-empowered MEC system, we propose a joint scheme of computation
offloading and blockchain mining. Accordingly, an optimization problem is
formulated to maximize edge service revenue and blockchain mining reward while
minimizing the service computation latency with respect to constraints of user
service demands and hash power resource. We then propose a novel Deep
Reinforcement Learning (DRL) approach using a double deep Q-network (DQN)
algorithm to solve the proposed problem. Numerical results demonstrate that the
proposed scheme outperforms the other baseline methods in terms of better
system utility with computational efficiency. Experiment results also verify
that the trading contract design is efficient with low operation cost, showing
the feasibility of the proposed scheme.
