## 4 Motivations and Use Cases  
In this section, we outline the motivations behind our work and describe the use cases where our solution can be adopted. Specifically, our aim is twofold.  
* We aim to achieve the integrity of the flow of messages exchanged between publishers and subscribers. This property should be preserved even in the case of an attacker being able to intercept the communication and tamper with it. This attacker can also be placed at the broker.
* We aim to achieve accountability guarantees. Specifically, in our solution, once the integrity of the exchanged flow is proven, the sender of a flow of messages (either a publisher or the broker) cannot deny having sent it. This property, known as non-repudiation, is essential for maintaining accountability.  
In MQTT systems, it is important to guarantee the end-to-end integrity of the data flow. This is due to the fact that the presence of the broker in the middle of the communication between publishers and subscribers represents an inherent vulnerability of the system. Therefore, if the broker is compromised or untrusted, it exposes the system to relevant risks.  
In many deployment scenarios, brokers may not be controlled by the communicating parties. Instead, they might be located in third-party, potentially untrusted environments (such as cloud providers).  
Therefore, an untrusted or malicious broker can intercept, modify, or inject messages between publishers and subscribers. If these attacks go undetected, they could potentially cause severe consequences. Indeed, if the integrity of the message flow is not preserved, subscribers might make decisions based on manipulated data.  
For example, MQTT can find applications in the healthcare domain to send patient data from medical devices to monitoring systems. Clearly, the integrity of these data is important, as any modification by a malicious broker could result in incorrect treatment decisions. Another critical application of MQTT is represented by smart cities. In this context, MQTT can be used to enable several services, such as traffic management, environmental monitoring, and so on. Data integrity guarantees that decisions based on this information are accurate and reliable.  
We now discuss accountability. In our approach, subscribers who receive data from the broker may want to obtain proof that the received messages are indeed sent by the publisher/broker. With this proof, the subscribers can maintain a verifiable storage for the data.  
Without accountability mechanisms, a broker or a publisher could deny having sent certain messages to subscribers to avoid liability or responsibility for the consequences of those messages. For instance, in a stock trading application, a publisher could send fraudulent market data and later deny its actions, causing significant financial losses to subscribers relying on that data. Without accountability, the publisher could deny having sent the data to avoid backlash or financial penalties.  
Similarly, on the broker's side, accountability is also important. Brokers often should enforce access control and ensure that only verified publishers are allowed to publish on specific topics. For example, subscribers relying on critical information, such as in financial or health-related applications, need assurances that their data come from verified publishers. By providing accountability on the broker side, our solution guarantees that brokers perform these verification checks. Therefore, they cannot deny having sent a flow of messages produced by unauthorized publishers.