# Enhanced Scalability and Security in Blockchain-Based Transportation Systems for Mass Gatherings
## 3 Methodology
### Mathematical Model for Scalability in Blockchain-Based Transportation System
Therefore, this serves as a basis for considering the impact of chain solutions on the transaction speed, network capacity, and overall blockchain efficiency, as expressed in Equation (2). Another critical aspect of blockchain-based transportation systems is their ability to function in the event of a failed blockchain node. The model can accommodate fallback mechanisms that guide the system in utilizing central or standby resources whenever a blockchain fails. \[R_{available}=\left\{ \begin{aligned} R_{blockchain},& if\text{ {blockchain} is active}\\ R_{fallback},& otherwise\end{aligned} \right.\]  
In Equation (3) [25], \(R_{available}\) represents the number of resources required for transaction processing. In a case where the application runs on the blockchain becomes unreachable, the system will switch to the backup \(R_{fallback}\) resources to continue running. Thus, the transportation system must always be available, even when the blockchain network experiences downtime or failure. In the blockchain-based transportation system, the fallback mechanism detects failures from real-time health checks of the network, such as heartbeat signals or consensus delays. A predefined failover protocol is triggered if a node failure is detected or a network outage occurs, redirecting transaction processing to the standby resources \(\left(R_{fallback}\right)\). In this case, the switch occurs through the logic of a smart contract or middleware, relaying workloads between centralized and a different set of nodes without interrupting system operation. Using Equation (4) [26], the goal is to prioritize transactions based on urgency and significance. Emergency services should be prioritized over less urgent transactions such as ticketing. \[R_{i}=\frac{P_{i}}{\sum_{j=1}^{N}P_{j}},C \tag{4}\]  
where \(R_{i}\) represent is the number of resources allocated to transaction \(i\), \(P_{i}\) is the priority score of the transaction, and C is the total system capacity. The priority score (\(P_{i}\)) can be adjusted dynamically, considering factors such as delays, congestion, or emergency needs, as expressed in the following Equation (5) [27]:  
\[P_{i}=\textit{base priority}+\textit{dynamic weight} \tag{5}\]  
Therefore, the dynamic adjustment of these priorities repositions the system to accommodate real-time reallocation and prioritize high-impact transactions, such as those that require processing at specific times. Other factors include latency, which is typically caused by the basic encryption validation and data propagation in the network. The total latency (\(L_{total}\)) can be modeled as the sum of validation time, encryption time, and network propagation time, as shown in Equation (6) [28]:  
\[L_{total}=L_{validation}+L_{encryption}+L_{network} \tag{6}\]  
To mitigate the effects of these delays, approaches such as parallel processing can be employed to reduce the total latency. Furthermore, network latency can be a significantly influential factor affecting system performance (P) in cases such as decentralized networks, as illustrated in Equation (7) [29]. \[P=\frac{C}{L_{total}} \tag{7}\]  
If the latency is high, it directly impacts the throughput, speed of the consensus, and overall system efficiency. Inversely, this means one can model the system performance \(P\) mathematically in terms of \(L_{total}\):  
It depends upon a system-dependent constant \(C\). With increasing \(L_{total}\), \(P\) decreases, indicating a decline in performance. Therefore, parallel processing can minimize validation and encryption delays, and optimized routing protocols can minimize network propagation time. Lower latency in the blockchain allows transactions to be final and prevents bottlenecks. Integrating latency into system models enables developers to design more efficient networks, allowing them to trade off speed for security to deliver optimal performance. Finally, the model should reflect the additional costs incurred through security processes such as encryption, hashing, and access control.