In the past two decades, technological advancements in smart devices, IoT, and smart sensors have paved the way towards numerous implementations of indoor location systems. Indoor location has many important applications in numerous fields, including structural engineering, behavioral studies, health monitoring, etc. However, with the recent COVID-19 pandemic, indoor location systems have gained considerable attention for detecting violations in physical distancing requirements and monitoring restrictions on occupant capacity. However, existing systems that rely on wearable devices, cameras, or sound signal analysis are intrusive and often violate privacy. In this research, we propose a new framework for indoor location. We present an innovative, non-intrusive implementation of indoor location based on wireless sensor networks. Further, we introduce a new protocol for querying and performing computations in wireless sensor networks (WSNs) that preserves sensor network anonymity and obfuscates computation by using onion routing. We also consider the single point of failure (SPOF) of sink nodes in WSNs and substitute them with a blockchain-based application through smart contracts. Our set of smart contracts is able to build the onion data structure and store the results of computation. Finally, a role-based access control contract is used to secure access to the system.