## Bitcoin mining hash

If you’ve already heard about Bitcoin, you probably know that mining is one of the core concept underlying this blockchain technology. You’ve maybe also heard that mining involves thousands of powerful computers which solve some magical puzzles. But do you really know how does mining works under the hood?

Science behind Bitcoin

Despite the fact that the blockchain technology takes advantage of a few sophisticated numerical algorithms, the underlying concepts are quite straightforward. And definitely you don’t need an engineering degree in programming to grasp the gist of this revolutionary technology!

Cryptographic hash function

Hash functions belong to a very useful class of algorithms that transform any data into a short message which then we can easily compare and process. Simple example of that could be a mathematical function which as an output gives the remainder of division by 1000 (modulo operation). You can think about hashes as fingerprints of data.

Cryptographic hash functions must meet some conditions, such as:

- be deterministic — that means for the same input function have to always return the same hash
- you shouldn’t be able to guess the input from hash except by trying all possibilities, which is impossible even for supercomputers
- small change in the input should result in a completely different hash
- it should be extremely hard to find 2 different inputs which give the same hash (like winning Powerball 10 times in a row hard!!!)

Cryptographic hash functions are diligently analyzed before they are recommended to production use. For instance National Institute of Standards and Technology organized several contests for hash functions in which finest minds in the world tried to crack or find vulnerabilities in the list of proposed algorithms.

Bitcoin relies heavily on this properties when it comes to mining blocks. If you’re curious, an actual implementation uses well known and battle-tested algorithm called SHA-256 .

**Merkle tree**