As you probably already know bitcoin and all other currencies using hash functions to validate coins or more precisely to ensure “proof of work”. If you are not familar with hash functions these functions are mathematical functions with following behaviour:
- Function has one input (text to hash), optionaly second ouput (salt). The second input is to make more options avaliable for us and it is used for security, not in case of bitcoin.
- Function has one output. This output is always with fixed size, for example: 256 bites.
- Function is deterministic. This means that for the same input the output is always the same.
It does not seem to be interesting untill you know others requiriments we have for hash functions:
- It is not possible to get input from the output.
There are two reasons for it. Because input into the function can be as long as you wish, but the output is always the same size. This means that there is limited about of results (but very high number) but unlimited about of inputs. So, there are inputs with the same output (called “collision”). The reason why you cannot get the original from the hashed value is simply that there is unlimited number of inputs which have this value after hashing. The second reason is more interesting: It is easy to calculate hash, but very hard to calculate original for it (for example for 256 bit function it requite 2 power (256) operations). After this huge amount of cpu work (which is currently not avaliable for us) you can get an input which could be a original. As there are many inputs with this output one is enough and it can be any of all of them.
Because there are these collisions there is another task: To have any two outputs which have the same hash value. To be able to calculate this you would need more much less work (but still more than we have avaliable now) .
How is it related to risk on bit coin market and possibly crashes on currecies markets?
Well, the thing is that nothing is perfect. These hashing functions