In mobile ad hoc networks (MANETs), group communication is an important communication mode, and group key agreement technology is the key to ensure the security of group communication. Due to the influence of node movement, topology change and network congestion in MANETs, the traditional group key agreement technology has many security and performance problems, such as node authentication, access control, data integrity, topology maintenance, routing protocol and so on. Therefore, we propose a certificateless dynamic group key protocol scheme based on blockchain, which can be used for cluster communication in unmanned aerial vehicle (UAV). In our scheme, blockchain technology is used to realize the agreement of group keys, which protects privacy and ensures the transparency of the agreement process. All nodes can verify the generation process of the group key through the information recorded in the blockchain. Meanwhile, the consensus algorithm of blockchain can ensure that the process of generating group keys is fair and there is no interference from malicious nodes. In addition, we propose a certificateless authentication protocol, which solves the problems of key escrow and batch authentication in traditional group key agreement technology. We have made formal security analysis and performance analysis, and the results show that this scheme is more secure and efficient than the existing certificateless group key protocol. This scheme can solve the problems existing in traditional group key agreement technology, such as key leakage and centralized management, and realize secure access control and key agreement mechanism. Therefore, this scheme is a safe and efficient solution, which can be effectively applied to the communication security of UAV network.