-
Describe hash functions with your own words
A hash function is a mini computer program, which will take in any length data string, then using SHA 256 (which Bitcoin uses), will output a unique digital fingerprint piece of data being 256 bits in length using hexadecimal 16 digits. This is designed as so an Input will create a 266 bit output string, however you can never go from an output back to an input. -
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 short, the mining process, uses processing power to preform hash calculations as fast as it can. This is so it can be the first computer on the network to get the block hash below the target. If your successful, then the computer/server can add the block of transaction to the blockchain and share it with the nodes on the network. -
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).
If Hash 1 and Hash 2 both produce the same output 256 output result, then this would break the Hash function properties.
Hash Function Properties:
- You cannot work out the original data from the result.
- The same data always returns the same result.
- Different data produces different results.
by definition of these hash properties, if Hash 1 and Hash 2 produced the same output result, then this would break the blockchain resulting in a ācollision".