  The fifth generation (5G) wireless networks are on the way to be deployed
around the world. The 5G technologies target to support diverse vertical
applications by connecting heterogeneous devices and machines with drastic
improvements in terms of high quality of service, increased network capacity
and enhanced system throughput. Despite all these advantages that 5G will bring
about, there are still major challenges to be addressed, including
decentralization, transparency, risks of data interoperability, network privacy
and security vulnerabilities. Blockchain can offer innovative solutions to
effectively solve the challenges in 5G networks. Driven by the dramatically
increased capacities of the 5G networks and the recent breakthroughs in the
blockchain technology, blockchain-based 5G services are expected to witness a
rapid development and bring substantial benefits to future society. In this
paper, we provide a state-of-art survey on the integration of blockchain with
5G networks and beyond. Our key focus is on the discussions on the potential of
blockchain for enabling key 5G technologies, including cloud/edge computing,
Software Defined Networks, Network Function Virtualization, Network Slicing,
and D2D communications. We then explore the opportunities of blockchain to
important 5G services, ranging from spectrum management, network
virtualization, resource management to interference management, federated
learning, privacy and security provision. The recent advances in the
applications of blockchain in 5G Internet of Things are also surveyed in
various domains, i.e. smart healthcare, smart city, smart transportation, smart
grid and UAVs. The main findings derived from the survey are then summarized,
and possible research challenges with open issues are also identified. Lastly,
we complete this survey by shedding new light on future directions of research
on this newly emerging area.
