Under the hood of blockchains

The most essential building block of blockchain technology is the concept of a "cryptographic hash". A hash function is a sort of one-way encryption mechanism: it is very easy to create a hash string from an input, but almost impossible to understand what’s the input that generated a given hash.

Hash strings, or simply hashes, look like this: 6b1cfe66c8f23dab339467ddfe8302d37cdcc2b9d280f148fed55379edffaf7a

Every transaction in a blockchain system has its own unique hash, which functions as an identifier. To make the system work, the transactions must be grouped into single chunks called “blocks”, hence the term “blockchain”. Every block has its own unique hash identifier as well, but more on that later.

A block must have something called a “block header”, a set of values representing its properties. This is where all the magic happens!

Blockchain structure

Inside the block header the hashes of all of the transactions contained in the block are summed into one “master hash” called the Merkle Root. This hash is a unique representation of all of the transactions inside the block, and even the tiniest alteration in one of the components would produce a completely different Merkle Root.

The Merkle root is then added together with the hash identifier of the previous block (and several other values) to create a new hash string: the identifier of the new block. Thus, every single block directly depends on the previous one, forming a chain.