Describe hash functions with your own words
Hash functions are special for two reasons. Firstly, for each unique input will result a unique output. It will give a fingerprint for each input. Secondly, one can go from input to output but you can not reverse output to input. A hash function is a one way function.
How are hash functions used in cryptocurrencies like bitcoin?
In the bitcoin protocol, hash functions are part of the [block hashing algorithm] which is used to write new transactions into the blockchain through the mining process.
In bitcoin mining, the inputs for the function are all of the most recent, not-yet-confirmed transactions.
The US National Security Agency (NSA) developed the SHA-256 hashing algorithm in 2001 which is the primary hash function used by Bitcoinâs blockchain.
This particular hash function is used because of these properties:
Unique hash value: For every input, it produces a unique output
High hashing speed: For each given input the computation is fast.
Secure hash function: It is almost computationally infeasible to reverse the function and make it two-way.
What does it mean when we say that hash functions need to be collision resistant?
Collision resistance is a property of cryptographic hash functions: a hash function is collision resistant if it is hard to find two inputs that hash to the same output; that is, two inputs a and b such that H ( a) = H ( b ). Every hash function with more inputs than outputs will necessarily have collisions.