I’m sure we all have heard about cryptocurrency and blockchain and how interrelated they are, which is true too, but they are actually very different and can exist independently. Cryptocurrency is more of a product, while blockchain is a technology to facilitate transactions among trust-less parties.

A complete production-ready blockchain application could be large and complicated, but, at its heart, it’s a very simple but powerful concept. A blockchain is a collection of blocks which can contain one or more transactions. Each block is hashed, and the hashes are then paired, hashed, paired again, and hashed again until a single hash remains, the Merkle root of a Merkle tree.

Each block stores the hash of the previous block, chaining the blocks together. This ensures a block cannot be modified without modifying all the following blocks. Below is the probably simplest (Hello World) blockchain in Java.

This is a simple block representation (POJO) in Java. It holds data as a string but it could be anything that you can imagine, including Ethereum style smart contracts.