# Enhanced Scalability and Security in Blockchain-Based Transportation Systems for Mass Gatherings
## 3 Methodology
### Mathematical Model for Throughput and Latency  
By applying blockchain technology to the existing system, we have enhanced the security and transparency of the transportation system. Vehicle registrations, ride-sharing payments, and logistics tracking all require their transactions to be processed efficiently to prevent delays and congestion; these are all covered by the transactions of this network. To address scalability issues, the system is developed with a variety of operational modes, ranging from traditional blockchain transactions to State Channels and Rollups.  
In baseline mode, all transactions are processed directly on the chain, providing very high security but low latency and throughput. State Channels enable speedy transactions and reduced costs by facilitating off-chain transactions and periodically settling them on-chain. Rollups densely batch multiple transactions into a single batch and commit them to the blockchain, achieving better latency and throughput simultaneously.  
1. Mathematical Model  
Several key parameters of the blockchain-based transportation system are defined to quantify its performance. Specifically, we indicate throughput (T) (transactions per second, TPS), latency (L) in seconds, and cost (C) in USD as \(T,~{}L\), and \(C\), respectively. Additional parameters include the number of transactions \(N\), block size \(B\) (number of bytes), block generation time \(t\_block\) (seconds), number of State Channels \(S\), and Rollup efficiency factor \(R\), defined as the number of batched transactions.
2. Throughput Model  
As shown in Equation (9) [31], the throughput of a standard blockchain system is  
\[T=\frac{B}{Avg_{tXSize}}\times\frac{1}{t_{block}} \tag{9}\]  
where \(Avg_{tXSize}\) is the average transaction size in bytes.  
In the case of State Channels, since transactions are processed off-chain before final settlement, we obtain the effective throughput \(T_{SC}\) as in Equation (10) [15].  
\[T_{SC}=T+S\times\delta_{SC} \tag{10}\]  
This is expressed in terms of their transaction rate per state channel, \(\delta_{SC}\).  
Throughput is improved by batch processing, which is formulated in Equation (11) [15] for Rollups.  
\[T_{R}=T\times R \tag{11}\]  
where \(R~{}>~{}1\) represents the compression efficiency factor of Rollups.
3. Latency Model  
Consensus delay affects latency, which is computed in terms of the number of blocks k that are needed for confirmation in Equation (12) [15].  
\[L=K\times t_{block} \tag{12}\]  
In the case of State Channels, because transactions are executed off-chain and only settled on-chain, the latency, as shown in Equation (13) [15], is greatly improved.  
\[L_{SC}\approx\frac{L}{2} \tag{13}\]For further optimization of latency, Rollups further minimize the number of on-chain interactions as shown in Equation (14) [15]:  
\[L_{R}\approx\frac{L}{2} \tag{14}\]  
This mathematical model applies to blockchain technology in the transportation sector, utilizing layer 2 solutions--specifically, State Channels and rollups--to address scalability issues. These solutions enhance throughput and reduce latency, enabling the framework to handle a large transaction volume.