Let´s continue with the second part of the article written by Hugo Cam. In this section, we will see some additional principles of Blockchain. If you missed the first article, you can find it web link here
Let’s review the second principle of Blockchain: Distributed Ledger.
Blockchain will change the centralized ledger to one distributed through the nodes in the network, which means that “D”, for example, can have a copy of the ledger and keep it in its node. “A” can also have the same copy of the ledger as well as any other participant of this network can keep the chain of events that happened.
Now that the ledger is distributed, the centralized ledger is no longer needed. As seen in our example, the role of the third party mediating participant has been removed.
However, we have created another problem, as there are several copies of the ledger in the network, we need to make sure that all these copies are synchronized and that all the participants in the network see their ledger as if it were the centralized ledger. This is the third principle of the Blockchain.
Until now, we know that a ledger is open, that is, everyone can see the ledger. It is distributed among several nodes. Now, we need to understand how the synchronization process is performed between the nodes of the network.
I will explain this process using an example:
Let’s say that “B” wants to move five dollars to “C”. What “B” will do is publish and transmit this intention of transaction to the network.
Everyone in the network will immediately see that “B” wants to move five dollars to “C”. This transaction has not been validated yet, so it cannot be added to the ledger.
In order for the transaction to enter the ledger, we need to understand the concept of “miners” in Blockchain.
The “miners” are special nodes that can update the ledger. Imagine that “A” and “D” are our miners. The miners will compete with each other to see who is the first to take this transaction (which is pending validation), validate it and put it on the ledger.
The first miner to do it will receive a financial reward.
The “miner” needs to do two things:
The first thing is to validate the new transaction. This is easy. The ledger is open so easily it can validate if “B” has the funds to transfer that amount. The second thing to do is to find a special key that allows him to take the previous transaction and join it (lock) with the new transaction.
To find this key, the miner needs to invest computational energy and time because this search for the key is random. The miner is repeatedly guessing new keys until he finds the first key that matches this type of a random pattern. The first miner who gets it gets the financial reward.
In this link, this process is visually explained: https://anders.com/blockchain/
Let’s see how these ledgers are synchronized through the network. The miner “D” was able to solve the puzzle and was able to take the transaction and add it to his own ledger. Now it will publish the solution throughout the network.
Transmitting it to the entire network means sending the transaction without validation, the lock to the previous transaction and the corresponding key. This allows everyone else in the network to take the transaction and add it to his or her own ledger.
The other miners will see that the transaction can be validated and added to their ledger, and they will not continue trying to resolve it to obtain the reward. They will look for another transaction to work hoping to have the reward next time.
Let’s try to summarize what I tried to explain about how the Blockchain works:
- Blockchain is not bitcoin, they are two different things.
- Blockchain is based on some basic principles, an open and public ledger so that everyone can see the transactions.
- The ledger is distributed and essentially exists in many nodes of the network, removing the dependency of a central third party.
- We learned about the concept of miners, which are special nodes in the network whose function is to validate transactions and add them to the ledger.
We only touch on the fact that the financial reward to the miners essentially ensures that collectively everyone agrees on what is the official ledger, that should be used by all.
Finally, mention that this explanation is very simplistic; it is only about concepts and ideas behind Blockchain, in order to answer some common questions that could be asked. The implementation itself is much more detailed and complex.