## 4 Secure, and Private Data Filtering, and Aggregation
### Data Filtering and Aggregation
By designing a unique onion routing-based protocol, we were able to conceal the network identity of nodes in the WSN. Moreover, our onion-based approach allows a general-purpose computing model for distributed algorithms, and to the best of our knowledge, no comparable solution exists. To address the issue of SPOF on sink nodes, we used blockchain-based smart contracts that replace the onion creation and storage of query results. The blockchain operates in permissioned mode in which sink nodes are registered, and their public keys stored on the blockchain. We also show how using a blockchain-based RBAC is possible to further protect the query and data access. We validate our solution on our use case of tracking violations of indoor physical distancing restrictions to avoid the spread of COVID-19. The presented solution aims at an implementation of a self-managing system to control the compliance to a set of predefined rules, such as the COVID-19 pandemic rules issued by local governments. The set of rules can be arbitrarily defined and modified without requiring updates of sensor nodes. A typical use-case for the presented system would be the installation in a nursing home. The occupants are automatically pseudo-identified by the system in bedrooms and later tracked along the corridors of the building, ensuring an overview of the number of occupants in specific areas, triggering temporary blocks and sanitizing actions. The system cannot be used as a critical contact signalling system (such as the exposure notification system by Google and Apple) as it is lacking a backward loop that would enable the information about an infection or critical contact to be attributed to a specific person. Future work should explore more sophisticated algorithms for the detection and tracking of users. Data should be analyzed to advance our understanding of behavior in an effort to improve future building designs. Implementations that aim to identify occupants (i.e., elderly homes) should explore a key management scheme and extend the smart contracts to include the ability for users to grant the system permissions to use their data. Conceptualization, A.T.; methodology: A.T., N.H. and J.V. ; software, A.T. and N.H.; validation, A.T., J.V. and N.H.; formal analysis, A.T., J.V. and N.H.; investigation, A.T., J.V. and N.H.; funding acquisition and resources, J.V. ; data curation, N.H.; writing--original draft preparation, A.T., N.H.; writing--review and editing, J.V. ; visualization, A.T. and N.H. All authors have read and agreed to the published version of the manuscript. This research was funded by H2020 grant number 739574 and 857188 by the Slovenian Research Agency (ARRS) grant number J2-2504. Not applicable. The authors gratefully acknowledge the European Commission for funding the InnoRenew CoE project (H2020 Grant Agreement #739574) as well as the Slovenian Research Agency (ARRS) for supporting project number J2-2504. The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results. ## References

* [1] [PERSON]; [PERSON] Data Resource Profile: COVerAGE-DB: A global demographic database of COVID-19 cases and deaths. _Int. J. Epidemiol._**2021**, _50_, 390-390f. [CrossRef]
* [2] [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON] Simulation of droplet dispersion in COVID-19 type pandemics on Fugaku. In Proceedings of the Platform for Advanced Scientific Computing Conference, Geneva, Switzerland, 5-9 July 2021; pp. 1-11. * [3] [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON]; et al. Risk assessment of airborne COVID-19 exposure in social settings. _Phys. Fluids_**2021**, _33_, 087118. [CrossRef]
* [4] [PERSON]; [PERSON] The efficacy of social distance and ventilation effectiveness in preventing COVID-19 transmission. _Sustain. Cities Soc._**2020**, _62_, 102390. [CrossRef] [PubMed]* [PERSON] et al.