1. Describe hash functions with your own words
Hash functions are one-way functions that generate a unique output for each unique input. One-way means that you can feed the hash function an input and get an output, but you cannot find out what the input was if you only had an output.
The job of hash functions is to scramble the input data so that it becomes indecipherable. No matter how long the input data is, the output will always be of the same length. But even if you only made a slight change in the input (such as replacing a lower case letter with a capital letter), the output would change completely and look nothing like it was before.
2. 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).
In order for a miner to be able to add the next block on the blockchain, they must find the appropriate input which, when put through the hash function SHA-256, gives an output that meets certain criteria such as starting with a certain number of zeros. In the case of bitcoin, the hash function is used to determine which new transactions will be written on the blockchain.
3. 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).
A hash function is collision resistant when it is impossible, or nearly impossible, to find two inputs that ācollideā, i.e. that give the same output. In other words, it is extremely difficult to find inputs x and y such that f(x) = f(y) after you put it through the hash function.