Q1 Describe hash functions with your own words
A hash function is a special type of function that maps data of arbitrary size to an output which a fixed size. The special key take away with has function sis that they are one way, meaning that we can go from input to output but never from output to input. Unlike regular functions which are not one way. This is why hash functions bring great security because they can be used to encrypt sensitive data.
Q2 How are hash functions used in cryptocurrencies like bitcoin? (Try to research this on your own, we will cover this later in the course but challenge yourself and see if you can find information on this already now).
Hash functions play a key factor in maintaining privacy and security on the blockchain. I believe that they can be used a few different ways. Firstly transactions on the blockchain are stored as hash functions. This is because when a transaction is made it can be viewed publicly on block explorers such as etherscan for example. However, transactions can hold sensitive information that the owner of the transaction might not want to be made publicily available. This is because potential bad actors could use sensitive information to take advantage with malicious intent. For example if a persons private key was not encrypted with the likes of a hash function, hackers could use this to rob or steal funds from the owner. This is why hash functions play an important role in cryptocurrencesas they help protect sensitive user information.
A second way that hash functions might be used in blockchain and crypto currencies is to do with actual mining. In bitcoin we know that in order for new bitcoin to be minted or mined, miners compete to solve complex cryptographic functions which when solved reward the miner who solved it with the privelge of verifying the latest block in the blockchain. These complex puzzles are hash function sin themselves and depending on the competition between miners can aqdjust the difficulty accordingly to ensure that on average a new block is verified once every 10 minutes or so.
These are two ways in which hash functions are used in blockchain and cryptocurrencies
Q3 What does it mean when we say that hash functions need to be collision resistant? (We didnât use the term âcollision resistantâ in the lecture, but you will easily find this on Google, we add this question intentionally to make you research information on your own, thatâs how you learn best).
In cryptography collision resistance is a characteristic of hash functions that defines a hash function to be collision resistant if it is near impossible to find two or more inputs that hash or map to the same output. Why is this important. Well obviously its to do security. The purpose of a hash function is to always map an input to a one way value. We would never want it to be possible to have two inputs that generate the same hash. This would undermine the integrity of the security of the blockchain. For example if a certain hash function was not collision resistant hackers could utilise this to their advantage to find loopholes and compromise the secure nature of the blockchain