Blockchain is commonly defined as the Internet of Value in comparison to the traditional internet. To understand the definition of the Internet of Value, let's briefly introduce the limitations of the traditional internet.
Since the first e-commerce experiments that were conducted on the traditional internet, a series of problems have emerged that have to do with the guarantee of authenticity. This involves various factors in the field, such as the following:
Intermediaries that traditionally guaranteed such factors (typically, banks) have proven to be ineffective in a dematerialized environment such as digital commerce on the internet. The need has, therefore, emerged not only to guarantee users immunity from identity theft, or the holders of copyright from infringement, but also to guarantee the reliability of the means of payment themselves.
By fulfilling this need, the blockchain has become the Internet of Value.
In coincidence with the financial crisis of 2007-2008, a digital currency, Bitcoin, was introduced for the first time. First and foremost, it was intended to ensure that its value was protected from inflation, without being conditioned by the monetary policies of central banks.
The protection that was provided regarding the value of the currency against erosion caused by inflation, together with its independence from the central monetary authorities, testifies to the aim of introducing a democratic means of payment, which can also act as an alternative (and in competition) currency to the traditional national currencies.
It is no coincidence that many citizens of politically unstable countries have decided to use Bitcoin as a reserve currency, precisely because of the guarantees that this digital instrument provides with respect to the fragility of national currencies.
Like any self-respecting coin, even Bitcoin is based on an essential element that is constituted by trust.
The concept of currency trust translates into practice as follows:
- Conservation of currency value over time
- Protection against possible counterfeiting attempts
- A general acceptance of money as a means of payment
To this end, given the dematerialized nature of Bitcoin, it was necessary to set up a technological infrastructure that would guarantee these prerequisites and be responsible for preserving the trust in transactions between operators.
This technological infrastructure, which is the basis of Bitcoin, is the blockchain.
The blockchain is a technological infrastructure through which it is possible to certify value transactions (which are not limited to the exchange of currencies but can include any type of asset) between trusted counterparties, without the need for the intervention of a central authority (be it banks, government regulators, brokers, and so on).
To perform these tasks, the blockchain is organized into a sequence of blocks (hence the name, block and chain) that contain the references of the transactions that took place over time. For each transaction that's entered into the blocks, a reference is associated with the previous and subsequent transactions. Finally, the blocks are stored in a shared register (blockchain ledger).
The main feature of the blockchain ledger is that it is append-only; that is, each registration is appended to the pre-existing ones, and the integrity of the ledger is guaranteed by the use of the cryptographic primitives offered by the Public Key Infrastructure (PKI), which we will cover in more depth in Chapter 2, Cryptography Essentials.
The other element that characterizes the blockchain is its network topology, which follows the peer-to-peer protocol. This is used to realize the decentralization of the infrastructure, thereby eliminating the need for a central authority that guarantees the reliability and integrity of transactions.
In practice, a copy of the ledger is saved at each node of the peer-to-peer network; in this way, users taking part in the blockchain can always obtain a copy of the ledger by contacting any of the peer-to-peer network nodes without needing to contact a predefined central node.
Whenever a new transaction is added to the blockchain, all copies of the ledger that are saved within the nodes of the peer to peer network are updated accordingly.
To summarize, the blockchain is characterized by the following elements:
- The presence of a shared ledger within a peer-to-peer network.
- Value transactions are recorded in append-only mode within the ledger.
- The reliability and integrity of the transactions recorded within the ledger is guaranteed by the use of cryptography.
Each new transaction that's entered into the blockchain determines the corresponding update for the ledger and the copies of it present in each node of the peer-to-peer network. In this way, it is possible to do without a central authority that guarantees the reliability and integrity of the transactions that are carried out within the network.
One of the revolutionary ideas of the Bitcoin blockchain was to introduce the distributed ledger mechanism. Satoshi (the pseudonym that the creator of Bitcoin is hidden behind) had, in fact, realized that the main reason for the intervention of intermediaries (in particular, banks) in transactions between private individuals was linked to the management of such transactions. These were recorded in a centralized ledger book. Satoshi's intuition was to replace the centralized ledger, which was managed by the corresponding central authorities, with a shared public ledger that's updated by the same subjects participating in value transactions.
However, with this, a series of problems remained to be solved:
- How to ensure that this shared ledger is tamper-proof and that it is robust with respect to arbitrary changes
- How to guarantee an adequate degree of confidentiality to the subjects who carry out value transactions
- How to properly manage the size of the ledger, since each transaction must be registered in it
To solve these problems, the blockchain was created. Now, let's take a look at the building blocks of blockchain.
Now, we're going to analyze the constituent elements of the blockchain and start with the blocks. As we mentioned earlier, transactions are stored within the blockchain blocks, so each block is composed of two parts:
- A block header, in which the link to the previous block is stored in the form of a hashing checksum digest. This is done to prevent the possibility of altering the transactions stored in the previous block.
- A block body, containing the list of transactions, complete with relevant information (including the amount transferred, the addresses of peers, and so on).
The following diagram shows the structure of Bitcoin blocks and their mutual relationships within the blockchain:
You can check out the image in the following link, https://commons.m.wikimedia.org/wiki/File:Bitcoin_Block_Data.png. As a consequence of how the blocks of the blockchain are...