## 3 Methods
### Security (S)  
Security is the blockchain's ability to resist attacks and ensure data integrity, even when some participants are malicious. It ensures that the system can reach consensus correctly and that transactions are immutable and tamper-proof [25]. To quantify and understand the security of a blockchain, we can introduce two key metrics: the adversary fraction and the security threshold.  
The adversary fraction (\(f\)) represents the fraction of the network's total resources (e.g., computational power, stake) that are controlled by malicious nodes. This metric is crucial because it allows us to model the potential influence of adversaries within the system. However, it is not enough to simply understand the presence of adversaries; we also need to define the system's resilience to such attacks. This is where the security threshold comes into play. The security threshold (\(f_{max}\)) represents the maximum fraction of malicious nodes the system can tolerate without compromising its overall security. Once the adversary fraction exceeds this threshold, the blockchain's ability to maintain consensus and transaction integrity becomes vulnerable to attacks such as double-spending or blockchain forks. To quantify how the presence of adversaries impacts the security of a blockchain, we can introduce the security function. This function allows us to model whether the system can maintain its integrity based on the proportion of malicious actors present in the network.  
The security function is expressed as follows.  
\[S(f)=\begin{cases}1&\quad\text{if }f<f_{max}\\ 0&\quad\text{if }f\geq f_{max}\end{cases} \tag{30}\]  
This step function indicates that the system is secure when the adversary fraction is below the threshold and insecure when it exceeds the threshold. Now, it is important to understand how different consensus protocols define and tolerate adversarial control, as their security thresholds can vary significantly depending on the underlying mechanisms. Different consensus protocols have varying tolerance levels for adversarial control, which is directly related to the value of \(f_{max}\). Below are some common examples.  
Proof-of-Work (PoW): The network remains secure if honest miners control more than 50% of the total hashing power.  
\[f_{max}=\frac{1}{2} \tag{31}\]  
Proof-of-Stake (PoS): In PoS systems, security relies on honest nodes holding the majority of staking tokens. Similar to PoW, the network remains secure if more than 50% of the stake is held by honest participants. Therefore, the security threshold is often as follows.  
\[f_{max}=\frac{1}{2}\ \ (\text{in terms of staked tokens}). \tag{32}\]  
Practical Byzantine Fault Tolerance (PBFT): PBFT-based protocols can tolerate up to one-third of the network being faulty or malicious. This lower tolerance level makes PBFT more sensitive to adversarial nodes, and, as a result, it has a stricter security threshold.  
\[f_{max}=\frac{1}{3} \tag{33}\]The Table 2 below summarizes the security thresholds for these different consensus protocols.  
For example, in a PoW network, if an attacker controls 40% of the hashing power (\(f=0.4\)), the network remains secure (\(S(f)=1\)). If the attacker gains control over 51% (\(f=0.51\)), the network's security is compromised (\(S(f)=0\)). Similarly, PBFT systems are more sensitive to faulty nodes due to lower \(f_{max}\), making them suitable for smaller permissioned networks where the number of nodes is limited and their identities are known.