Blockchain, a chain of blocks. Everybody’s talking about it thanks to the ongoing success of Bitcoin. By many tech enthusiasts it is considered to be the greatest invention at least since the internet. If the blockchain keeps it’s promise, it may change how we pay, how we vote and that should just be the beginning. In a nutshell, it could revolutionize everything where trust is involved.
What is a blockchain?
First and foremost, it’s a database. While traditional databases are stored on one hard drive with one or more backups, blockchain databases in many cases are distributed over thousands of computers. A popular example of a central database is Facebook. If someone hacks the Facebook database, which should be hard enough, he can easily change several sets of data. If someone wants to hack a blockchain database on the other side, he has to change the dataset on the majority of the thousands of computers distributed all over the planet. This is why the blockchain is often referred to as distributed ledger.
The blocks
Now imagine someone wants to add new information to the database. For example in the case of Bitcoin, someone wants to add, that one Bitcoin (we call that Bitcoin #123) does no longer belong to Adam, but has changed hands and now belongs to Ben.
In a tradicional database, the line Bitcoin #123: Adam
would be replaced by the line Bitcoin #123: Ben
.
In a blockchain database however, the line Bitcoin #123: Adam
would remain on the block, because once some information has been added, it is not going to be changed anymore. Instead the line Bitcoin #123: Ben
is just added to a new block, which is added to the already existing chain of blocks.
So, the Bitcoin database would now contain the two entries Bitcoin #123: Adam
and Bitcoin #123: Ben
. How can you tell then, who owns the Bitcoin #123 now. That is easy. Because blocks are added one after the other, you simply search for the last block where Bitcoin #123 is mentioned. This would be the block we just added. Hence from a logical point of view it is clear that Bitcoin #123 formerly was owned by Adam, but has changed hands and now belongs to Ben.
Now you could ask, what if Carl comes around and tells the block creator to write the line Bitcoin #123: Carl
on a new block. That is why we need the miners. Their job is to verify that Ben agrees that Bitcoin #123 changes hand again and now belongs to Carl.
Of course the miners don’t do that work for free. They get a reward for appending one block to the other in the form of new Bitcoins. That’s why the whole process is called mining.
Which one of the miners gets the reward?
The reward for each block that is mined is currently 12.5 Bitcoins. For each block, a so called mathematical puzzle is to be solved by the miners. Whoever finished the calculation first, gets the reward. This concept is called proof of work.
So what if one of the miners is corrupt?
What happens if miner X is supporting Carl with his fraud? We assume he solves the puzzle the fastest and just puts the line Bitcoin #123: Carl
on the latest block despite he knows it’s not true. Now the several thousand other miners come into play. They know it’s not true because they can see that Bitcoin #123 has never been sent to Carl in a correct way. Hence they just don’t approve the work of miner X. They basically create the next block without the fradulent transaction. This is because the honest majority of the miners don’t want to put the line Bitcoin #123: Carl
on the block, they outvote miner X and Bitcoin #123: Carl
is not written to the new block.
That means Carl would have to persuade the majority of the miners to support him in his fraud. And this is highly unlikely.
How the double-spending problem is taken care of
Okay, Carl didn’t get the Bitcoin.
For the following scenario, it is important to know that it takes roughly 10 minutes to solve the mathematical puzzle and hence append a new block to the chain. This may be different for every blockchain. The timespan is called the block time and essentially is the time a transaction needs to be confirmed by the network.
Now imagine Ben, who is the rightful owner of Bitcoin #123, does something bad. He buys some water at the supermarket, pays with Bitcoin #123. Then, within the 10 minute block time, he rushes to the bakery and buys bread with the same Bitcoin #123. Is this possible? Yes it is. As long as the current block has not been appended to the chain, the baker can’t see that Ben has already spent Bitcoin #123.
So how does the system handle such situations? First of all, the information, that Ben spent Bitcoin #123 at the supermarket, is not known to all miners at the same time. The information is rather passed on from one computer to the next over time. It might even happen that the miner who solves the puzzle first has not even got the information. Is this a problem? No. Then the transaction is just processed during the creation of the next block.
Now imagine some miners already got the information that Ben transferred Bitcoin #123 to the supermarket, some others have knowledge of Ben transferring Bitcoin #123 to the baker. Who gets the Bitcoin now? If the miner who solves the puzzle the fastest has the information that Bitcoin #123 was transferred to the Baker, the Baker gets the Bitcoin.
During the next block time, the miners will try to process the transaction of Bitcoin #123 from Ben to the supermarket. But this doesn’t work because Ben is no longer the owner of Bitcoin #123, the baker is. Hence the supermarket gets nothing.
That is why the receiver of a transaction should always wait until it is confirmed by the network.
Summary
This article explains the general idea of how a blockchain works by using Bitcoin as an example. It shows how the rightful owner of an asset can be determined, how mining works and how Bitcoin prevents double-spending. Please note that most of the explanation is simplified so that the topic can be understood easily.
Disclaimer: The above references an opinion and is for information purposes only. It is not intended to be investment advice. Seek a duly licensed professional for investment advice.
The information contained in this website is for general information purposes only. We endeavour to keep the information up to date and correct, but we make no representations or warranties of any kind, express or implied, about the completeness, accuracy, reliability, suitability or availability with respect to the website or the information, products, services, or related graphics contained on the website for any purpose. Any reliance you place on such information is therefore strictly at your own risk.
In no event will we be liable for any loss or damage including without limitation, indirect or consequential loss or damage, or any loss or damage whatsoever arising from loss of data or profits arising out of, or in connection with, the use of this website.
Through this website you are able to link to other websites which are not under our control. We have no control over the nature, content and availability of those sites. The inclusion of any links does not necessarily imply a recommendation or endorse the views expressed within them.
Every effort is made to keep the website up and running smoothly. However, we take no responsibility for, and will not be liable for, the website being temporarily unavailable due to technical issues beyond our control.