Although blockchain has a variety of definitions, a blockchain can best be described as a data structure of blocks that are chained together to form a collection of records, called a ledger, with cryptography being a key ingredient in the process. A blockchain doesn't have a storage mechanism; instead, it has a set of protocols that govern the way in which information is forged. So, a blockchain can be stored in flat files or in a database.
Blockchain technology gained popularity due to the fact that its integrity can't easily be compromised. A compromised blockchain can be recognized for what it is, and rejected quite easily by anyone in a network. This integrity is achieved by cryptography, which is what binds the blocks together; we'll study this idea of cryptography in Chapter 2, A Bit of Cryptography.
Blockchain's promise of providing such robust integrity is what eventually paved the way for the idea of sharing chains of data in untrusted peer-to-peer (P2P) networks. Validation of the blocks in a blockchain is what makes sure that a blockchain has a valid global state that can be accepted by everyone. Due to a blockchain's ability to share information in an open P2P network without any central authority governing it, the technology can have many different applications; however, the technology could not simply just be deployed to these applications immediately without any troubleshooting. Although blockchain technology, from the beginning, had a huge role to play in the decentralization of applications, it still faced several challenges with regards to its application in trustless environments. One of the biggest challenges was keeping a blockchain consistent across all the participants of a P2P network. This was solved by creating a consensus algorithm, which agrees on how the blocks should be appended to grow the chain in a trustless environment.
The term blockchain actually entails a number of concepts, including P2P network management, consensus mechanism, and more, all contributing to the creation of a decentralized application.