###### Abstract  
Livestock monitoring often requires human supervision to guide farm animals to a specific point and the displacement of workers to the places where these animals are, which is likely to be several kilometers away, thus resulting in a repetitive task that requires a significant amount of time and demands the usage of land vehicles capable of moving swiftly through the countryside. In addition to that, data collection about animal behaviour with such procedures is often insufficient and cannot be shared in a secure enough manner. This paper describes how Using Unmanned Aerial Vehicles (UAVs) tailored for this kind of task, when combined with other protocols and software technologies, can provide a useful to mitigate these issues. To prove this end, a functional prototype has been designed, built and tested, offering the operator accurate monitoring of farm facilities and animals. Additionally, security has been conceived as a cornerstone of the presented system from the very beginning. Not only the communication protocols used for this purpose have built-in security layers, but also InterPlanetary File System (IPFS) and blockchain have been used as the technologies that enhance data storage among peers in a network. Unmanned Aerial Vehicle; Smart Farming; InterPlanetary File System; blockchain 20231047110.  
deployments ([3]) to the usage of semantics ([4]) and Cyber-Physical Systems [5]. Using such developments should not come as a surprise, as they involve several technologies (sensors, actuators, manned and unmanned vehicles) of proven usefulness in activities like measuring, monitoring, and acting during prolonged periods of time. There are several technological hardware and software solutions that can be used in this regard. One of the most prominent is Unmanned Aerial Vehicles (UAVs), popularly referred to as drones. They can serve purposes that have been defined as in \"The four Ds\": _Dull_ (repetitive, mundane tasks that demand a significant amount of similar sets of movements without any elaborated procedure behind), _Dirty_ (tasks that imply high levels of pollution that might be unpleasant or hazardous to humans), _Dangerous_ (operations that have an inherent risk in their execution for humans, to the point that they might be fatal depending on the conditions where they take place) and _Dear_ (as in tasks that are of expensive nature that might be aided by the usage of robotics in general and UAVs in particular). Many UAVs work in deployments that are at least matching one of these purposes, especially when data must be transferred throughout heterogeneous, decentralized Cyber-Physical Systems as shown in [5]. However, while Smart Farming is one of these areas [6], the usage of UAVs in this application domain is still limited and there are no established criteria on their utilization, thus resulting in an underusage of resources that could potentially provide significant savings in time and funds for certain activities, while obtaining data of high accuracy and reliability over time about livestock behaviour or foodstuffs production. Security is another feature of critical importance that must be considered in any deployment that involves Cyber-Physical Systems (CPSs) and/or IoT (Internet of Things)-related technologies, especially in open environments with devices vulnerable to be hijacked, such as UAVs [7]. Despite the security features that HTTP Secure (HTTPS) or Transport Layer Security (TLS) can offer, security is often overlooked. We believe that one main aspect of security is that it should be integrated into the design and development of any solution from the very beginning rather than as an afterthought. Consequently, security-enabled components must be integrated into UAV-based systems to be deployed, regardless of the activities expected to be performed by it. Therefore, security must be present in every hardware and software component used to receive and/or transmit data so that cybersecurity threats are reduced to a minimum and attacks end up being ineffective.