Digital Security

How does a blockchain work?

Changed on 13/07/2021
Although the term "blockchain" is now part of our modern lexicon, there is still a lot of confusion about what a blockchain is, what it does and how it works. Daniel Augot, an Inria researcher and holder of the "Blockchain and B2B platforms" chair supported by CapGemini, NomadicLabs, and the Caisse des Dépôts, explains.
Comment fonctionne la blockchain
@Pixabay / photo Pete Xresch

The principle

A blockchain is a technology that allows information to be shared between several users, whether financial, informational or material, in a fully automated and secure manner. More precisely, it can be defined as a peer-to-peer network containing a shared ledger, whose content is validated and secured by a calculation algorithm called "mining" or by cryptographic keys.

It consists of three important concepts: blocks, nodes, and miners. When a transaction is shared on the peer-to-peer network, it is collected by miners and, for efficiency reasons, processed in batches (called blocks).

Each block is made up of four components: the hash that makes it possible to refer to the previous block, all the transactions that are recorded in it, an arbitrary number given in cryptography, called the nonce, and finally the "hash" of the block, which is unique.

The miners create new blocks following the existing ones, by a process called "mining". Thanks to this, it is almost impossible to extract an existing block to modify it, or to falsify it. Once verified by thousands of computers, the block is added to a node, called a blockchain, and the miner can be, typically, financially rewarded. Hence the idea of "blockchain".

Three mechanisms for a single result

Any miner can submit information and decide to store it on a blockchain.

In order for a block to be validated according to the rules, a self-checking mechanism can be used. This mechanism, which aims to answer the question "how can we ensure the validity of each transaction?", allows other users to review the transactions proposed in a block and decide by consensus whether it can be added to the network or not.

Not all blockchains have the same block validation mechanisms. This is what will differentiate them from each other. There are currently three main mechanisms: proof of work, proof of stake, or consensus algorithms that come from distributed computing (which have existed for about thirty years).

1 - Proof-of-Work

The most open blockchains have no notion of identity. In principle, each user can create several identities without being really identified in order to flood the network, with the aim of resolving a large quantity of blocks.

To counter this problem, these blockchains use the proof-of-work mechanism, which represents the resolution of an important cryptographic enigma. In order to solve this puzzle and, therefore, validate a block, the computer must be powerful enough to perform these calculations. "This mechanism is related to the fact that users cannot be clearly identified, according to the very principle of an open blockchain. We therefore need mechanisms to prevent certain users from committing fraud in order to take control of the calculations," explains Daniel Augot. The proof of calculation also has the advantage of making the register immutable and irreversible, by making it almost impossible to rewrite previous blocks. This is another way to curb abuse.

Even better: if blocks start to be produced too quickly, a self-adjustment mechanism is set up by adjusting the difficulty of the calculations to the computing power of the computers, thus slowing down the production of blocks. This solution leads to another problem: the important energy consumption that this entails.

2 - Proof-of-stake

The second proposal is the proof-of-stake. Rather than asking miners to devote hardware resources (powerful and expensive computers) to secure the network, this one is characterized by a random designation of a miner who can add a block to the blockchain, by asking him to put cryptocurrencies into play.

Thus, in order to have a chance to verify transactions in a block - and collect the associated fees - miners must block a minimum amount of virtual funds, which they cannot spend. "We're going to refer to a virtual resource that is the amount of funds users have in their virtual wallets, and the advantage is that users have a vested interest in making it work," explains Daniel Augot. "If a validator disconnects when a block is created or does not validate it, they can lose some of their money for harming others," the Ethereum website says.

The main advantage of this validation mechanism is that it reduces the significant energy expenditure associated with proof of work. On the other hand, some believe that this validation system does not have as good a level of immutability.

3 - Permitted blockchain

In some cases, the proof-of-work and proof-of-stake validation mechanisms of public blockchains are not always suitable. The total transparency and decentralization of information (and therefore accessibility by all), which appear to be a major advantage of these public blockchains, can indeed put off industrialists who want to exchange more or less confidential information among themselves.

This is where the permissioned blockchain comes in. Partially decentralized, its network is only accessible to a limited number of users. Each new member must be co-opted by the existing members of the consensus, and will have different access rights to the data in question. The validators are known, and totally transparent among themselves. "The idea is to get actors with different interests to cooperate, but who have a vested interest in certain information being shared," explains Daniel Augot, before adding: "For example, between the time the car is created and the time it is scrapped, there are many people involved. The idea is that all these people are identified and that they manage a blockchain, that they cooperate over time to make the logbook evolve in a traceable and reliable way at the same time as the car is being tracked". A problem that also arises when looking for traceability in the food industry.

The essential on: blockchain