## 1 Introduction
Realistically, every distributed software system looking to leverage the blockchain must determine the blockchain type based on the nature and validity of the users' access to the network. Additionally, based on the software scenario and requirements, the appropriate consensus algorithm should be determined. The appropriate blockchain network and consensus algorithm by each software are determined in light of the characteristics of each type, as mentioned above. For instance, if a distributed software system has been designed for a public business such as cryptocurrency, and is concerned about data immutability and availability and is not concerned about data privacy, where the throughput is not the ultimate goal for this system, thus a public blockchain that utilises PoW or PoS is a preferred choice for this software system. Blockchain offers promising solutions for attack detection techniques to overcome their challenges. In terms of attack detection techniques and their immutability challenge, blockchain provides a solid solution through applying the immutable mechanisms of blocks mining and appending to the blockchain network, which can be adopted as a mechanism to store behavioural-based attack detection techniques' data. Both trusted behaviours and the runtime behaviours detection techniques' input data have a set of linked events that in total represent the whole behaviour. Once an event is generated, it can be mined in the same fashion as blocks mining, where each event depends on the previous event hash \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Consensus Algorithm** & **Advantages** & **Disadvantages** & **Security** \\ \hline \multirow{3}{*}{Proof-of-work (PoW)} & Reaches consensus quickly, rules out the possibility of spamming and is most tested over time. & More power is consumed and wasted in the mining process. & Open to 51\% of attacks along with selfish mining and eclipse attack. \\ \hline \multirow{3}{*}{Proof-of-stake (PoW)} & It is advantageous over other protocols given reduced energy consumption, easy staking, and being environmentally friendly. & One basic disadvantage is that large stakeholders dominate the network. & Despite being secure against 51\% of attacks, it is vulnerable to nothing-at-stake, grinding, to nothing-range attacks. \\ \hline \multirow{3}{*}{Proof-of-authority (PoW)} & PoA increases the speed of transaction validation and functions as a platform for the development and maintenance of Dapps. & Full decentralisation is not considered. & Secure against DoS attacks and 51\% of other attacks to some extent. \\ \hline \hline \end{tabular}
\end{table} 
Table 3: The main comparisons between consensus algorithms [23]. value as required data to mine the new event. Any attempt to make an unobserved change in an event block will require changing all previous blocks in the chain. Such an action would be costly computationally and easily noticeable by the other blockchain properties. Consequently, all of the behaviour's events will be stored as linked blocks on a blockchain and once stored in this manner, any attempt to perform unobserved changes would be impossible. Therefore, the use of blockchain mining and storage mechanisms results in an increase of immutability for these detection systems. In terms of the reliability challenges faced by attack detection techniques, blockchain can provide a solution through applying the distributed ledger recording mechanisms consensus protocol, to be adopted as a mechanism for the detection results announcement. In the blockchain, consensus protocols such as proof-of-work (PoW) and proof-of-stake (PoS) play a significant role in recording any mined block and/or any other transaction on the distributed ledgers in a non-repudiated manner, thus making the distributed ledgers more reliable. Applying consensus protocols such as these to record any detected attack will increase the detection techniques' reliability at the level of exchanged data.