Today, intelligent drone technology is rapidly expanding, particularly in the defense industry. A swarm of drones can communicate, share data, and make the best decisions on their own. Drone swarms can swiftly and effectively carry out missions like surveillance, reconnaissance, and rescue operations, without exposing military troops to hostile conditions. However, there are still significant problems that need to be resolved. One of them is to protect communications on these systems from threat actors. In this paper, we use blockchain technology as a defense mechanism against such issues. Drones can communicate data safely, without the need for a centralized authority (ground station), when using a blockchain to facilitate communication between them in a leader–follower hierarchy structure. Solidity has been used to create a compact, lightweight, and effective smart contract that automates the process of choosing a position in a certain swarm formation structure. Additionally, a mechanism for electing a new leader is proposed. The effectiveness of the presented model is assessed through a simulation that makes use of a DApp we created and Gazebo software. The purpose of this work is to develop a reliable and secure UAV swarm communication system that will enable widespread global adoption by numerous sectors.