# Comparative Study of Blockchain Hashing Algorithms with a Proposal for HashLEA
## 3 Background
### Hash Functions for Blockchain-Based Applications  
Hash functions are an essential component of blockchain, and they are utilized in a variety of blockchain-based implementations, particularly cryptocurrencies. One among these applications is Bitcoin, which is the earliest and most widely utilized cryptocurrency that employs the PoW consensus protocol. PoW is recognized as a significant consumer of power and computation, which in turn uses the SHA-256 hash function. Other cryptocurrency applications like Titcoin, Peercoin, and Bitcoin Cash are also using the SHA-256 hash function [29]. One of the most well-known examples of a blockchain-based application is the Ethereum platform, which provides a decentralized environment for deploying and executing smart contracts. Ethereum allows participants to transact in a peer-to-peer network without any trusted intermediary. Transactions are sent to and received by Ethereum accounts created by users of the system. Smart contracts enable immutable, verifiable, and securely distributed transaction records, thus offering full transparency and control over their data to the participants. Ethereum moved from the PoW consensus mechanism to proof of stake, a more secure and energy-efficient way of governing the validation of blocks and the integrity of the blockchain network [53]. The Keccak, one of the hash function families based on the Sponge structure, is implemented through the Ethash function for coins that use Ethereum. Keccak is also a candidate for the SHA-3 hash function. Another common hash function used by many cryptocurrencies is Scrypt. The blockchain has a number of different uses for hash functions. Here is a comprehensive overview of the various crucial uses of hash functions in blockchain technology [24; 29; 35]:  
Data integrity: Hash functions are used to create a fixed-size hash value for each block of data in a blockchain. By comparing the hash of a block to the hash of the previous block, users can quickly verify whether the data within the block have been altered or tampered with. Even a slight change in the block results in a different hash value, indicating data corruption and ensuring data integrity. Merkle tree: Hash functions are employed in Merkle Trees to secure the integrity of the block header. This uses hash functions to make sure that it is not possible to discover two Merkle Trees with a similar root hash, and that helps the integrity of the block header to be protected by storing the root hash inside the block header and thus protecting the integrity of the whole transaction process. PoW consensus algorithm: This algorithm defines a valid block as one with a hash value below a certain threshold that the threshold value has a hash value greater than the block header hash value. Miners in PoW blockchains, such as Bitcoin, must find a hash meeting specific criteria to add a block to the blockchain. Digital signatures: Hash functions play an essential role in digital signatures to ensure data integrity and are utilized for authentication for blockchain transactions. Chain of blocks: In the blockchain, each block header holds the hash of the previous block header, forming a chain. This ensures that it is impossible to change even a single block in a blockchain without being noticed. The modification of one block requires changing subsequent blocks, and this increases the difficulty and challenge. Smart contracts: Hash functions are used in smart contracts for specific purposes, such as verifying input integrity or storing hashed data, ensuring the contract's conditions remain tamper-proof. Mining rewards: In PoW blockchains, miners must find a specific hash PoW that, when combined with the block data, produces a hash with a certain number of leading zeros. This hash is the basis for rewarding miners with new cryptocurrency coins. Block validation: Each block in the blockchain has a header that contains a hash of the previous block's header.