function takes in input x,
it checks whether output H(x) already exists,
If it exists, it returns that output,
If not, it creates a new output, associates it to this input, and returns that out.
What is it used for?
How does it work?
Let’s start by explaining the graphic below:
Notice that instead of keeping n hashes, you could just keep one root hash created from all the previous ones. This is very efficient and saves some space – that’s why we can compare it to a compression.