## 3 System Design
### UWB Localization  
#### 3.2.1 Ranging Module for Framework  
In our framework, the TWR method was used among the UWB distance measurement techniques. TWR is a ranging method that measures the Time of Flight (ToF), which is the transmission and reception time between devices, through two-way message exchange. TWR is divided into Single-Sided TWR (SS-TWR) and DS-TWR depending on the number of message exchanges. SS-TWR is a method of sending and receiving a total of two messages once from each device, and the ToF is calculated by dividing the difference between the round-trip time and the reply time in half. This method has the advantage of having a simple structure with a small total number of messages exchanged between devices. However, SS-TWR has a clear disadvantage in that, as the clock offset and response time to the first received message increase, the ToF estimation error can increase to a level where  
Figure 2: This is a system architecture of the proposed localization framework with a distributed ledger.  
the distance estimation becomes significantly inaccurate. DS-TWR, an extension of basic SS-TWR, uses two round-trip time measurements and combines them to produce the ToF results with reduced error even in the case of quite long response delays. The proposed system uses DS-TWR, which uses a total of 3 messages to estimate the ToF for ranging between nodes, and this method does not need to perform clock synchronization between the nodes [56].  
In the proposed framework, the estimated ToF in the timestamp can be calculated using the following equation:  
\[t_{\text{ToF}}=\frac{T_{round1}\times T_{round2}-T_{reply1}\times T_{reply2}}{T _{round1}+T_{round2}+T_{reply1}+T_{reply2}}, \tag{1}\]  
where all the parameters are shown in Figure 3, which shows the process of communication between the nodes.  
Then, the measured timestamp can be straightforwardly converted into the distance using the following equation:  
\[d=\alpha\times t_{ToF}+\beta. \tag{2}\]  
In this equation, \(d\) represents the estimated distance between the ranging nodes, \(t_{ToF}\) is the estimated ToF from the timestamp including the antenna delay correction factor, and \(\alpha\) is a proportional factor. \(\beta\) is a constant value utilized in the calculation of the estimated distance from the ToF.  
The DW1000, which is the UWB sensor used in our system implementation, is equipped with a sampling clock operating at 63.8976 GHz [57]. In other words, 63.8976 \(\times\) 10\({}^{9}\) clock cycles occur per second, which means that the clock cycle is \((63.8976\times 10^{9})^{-1}\) s. Therefore, the clock period is approximately 15.65 ps. This high sampling frequency allows timestamps to be measured at very short time intervals, enabling highly precise distance measurement and location tracking. Considering the propagation speed of UWB signals of 300,000 km/s, the UWB signal propagates 0.0047 m per clock cycle, which means that it travels 0.0047 m per timestamp of the ToF calculated with DS-TWR. Therefore, we established the proportional factor \(\alpha\) at 0.0047, and through subsequent experiments, we empirically derived the optimal \(\beta\) value of 0.2321.