Everyone talks about Bitcoin and most of the time the term "Blockchain" is mentioned shortly after that. But what is the Blockchain and how does it work? In this article we want to explain this as simply as possible.
The term "Blockchain" itself already tells us a little bit:
The block in the chain
As the term "blockchain" may already suggest, it is about a chaining of blocks. A block simply represents a collection of arbitrary information. In the case of Bitcoin, these are the transactions. Simply put: from where was which amount transferred to where?
The Digital Fingerprint - Hash
By means of a so-called hash-function (a mathematical procedure), a unique value (the hash) is calculated from the information stored in the block.
You can easily test this here. Enter any text in the "Contents" field. Below the input, the calculated hash is displayed:
Regardless of the amount of information, the calculated hash always has the same length. If you enter the same information on another computer, it will also calculate the same hash. However, if you change only one character, it will no longer match.
A hash is therefore also known as a digital fingerprint. The special thing about this is that there is no way to predict a hash without knowing the information itself.
This is also used, for example, to avoid saving passwords. Only the hash of the password you have chosen is saved. Since you cannot infer the password from the hash, it cannot be stolen. As soon as you enter a password to log in, the hash is calculated again and compared with the stored hash.
In our example we use a hash process called SHA256, but there are many other hash processes besides this one.
The digital currency Bitcoin uses the calculated hash to protect the transactions stored in a block from manipulation, which is described in more detail below.
Block by block - The Blockchain
If a block is full, the following information is stored in a new block. At the same time, the hash of the previous block is stored in the new block.
The last sentence deserves special attention because this is how the chain is created: The hash of the previous block is part of the information from which the hash of the new block is calculated.
The consequence of this is: If something has been changed on any block in the chain, then none of the following blocks are correct.
This is the core of the blockchain as it excludes the possibility of manipulation. But not quite up to now, but more about it.
You can test the procedure here again. Below are three blocks. Each block contains the hash of the previous block. Just try changing the contents of the first block:
Distributed data storage
Until now, the whole thing is only safe from manipulation if you trust the one who stores the blockchain. Nothing would prevent anyone from changing a transaction and then simply recalculating the hashes of all subsequent blocks.
This is ultimately prevented by two methods: Countless participants of the Bitcoin network (the miners) calculate the hash values in parallel on the basis of copies of the blockchain as well as the artificially created difficulty to calculate the hash values themselves.
Basically, anyone can become a part of the Blockchain network. You will do this by installing the Bitcoin software. This can load a complete copy of the blockchain onto your computer from where you can calculate hash values for new blocks. Since you, like many others, now have a copy of the blockchain, the hash values you have calculated would not match those of the other participants if your data were modified in any way.
If you have already made a payment with Bitcoin, you may have noticed that the recipient is waiting for a certain number of confirmations. The more miners that come to the same result, the more certain is that a transaction has been properly executed. With 3 or more confirmations you can already be quite sure.
The miners are therefore extremely important for the safety of the entire block chain. Since the provision of this computing power is also associated with a considerable amount of effort (more on this in the following), the miners receive a remuneration in the form of bitcoin.
The hash difficulty
Computers are extremely good at calculating hash values. Normally, calculating the hash of a block using any standard PC or smartphone would not be a particularly important task. The difficulty was therefore artificially increased, which made mining a real battle for computing power. With a standard PC you have little chance now. Manufacturers of graphic cards, whose processors are particularly suitable for computationally intensive tasks and, of course, energy suppliers who are pleased with the high power consumption, will now benefit from this.
The difficulty is achieved by the fact that the hash must start with a certain character string. For example, with the value 000a. Only when the hash starts with this value is a block valid. This is called a signed block.
For this purpose, additional information is required, which is included in the calculation of the hash. This information is called "nonce". In the following example you can try to change the nonce value until the hash starts with 000a. This process is called mining. If you prefer to leave the task to your computer, you can press the "Mine" button and wait for the result.
The fear is now that quantum computers will be able to overcome this challenge with ease. Some cryptocurrencies therefore rely on other calculation methods, which are considered to be "quantum proofs". The IOTA cryptocurrency, which was specially conceived for the IoT (Internet of Things) area, is one of these.
Blockchain - Simple but ingenious
The blockchain itself is not a particularly complex thing at first and makes use of tried and tested methods. However, distributed processing makes the procedure described here much more complex. Bitcoin and other digital currencies also include much more. After all, it must also be ensured, for example, that you can safely dispose of your own credit balance. For example, no stranger can make a payment on your behalf. This is where topics such as digital signatures come into play, but this would go beyond the scope of this article.
Nevertheless, we would like to briefly explain an interesting matter here. You may have wondered where the account balance is stored:
It's simple: nowhere. Only the transactions themselves are saved. When you make a payment, the transactions are traced backwards until sufficient funds have been found for the payment. It may sound awkward at first, but due to the above described, it is absolutely tamper-proof.
You have received a payment of 4, as well as one of 2 Bitcoin. So you have 6 Bitcoin.
If you transfer 2.5 Bitcoin, the system will search backwards until incoming payments of 2.5 Bitcoin equal to or greater than the 2.5 Bitcoin to be paid are found.
Since the first found incoming payment to your Bitcoin address was 2 Bitcoin, therefore not sufficient, the search continues until the previously received payment is also found via 4 Bitcoin. This results in the following posting:
6 Bitcoin at your expense
2.5 Bitcoin to the receiver
3,5 Bitcoin in your favor
The Blockchain is currently attracting a lot of attention and from our point of view it is not entirely unjustified. Not because of cryptocurrencies such as bitcoin itself, but rather because of the resulting possibility to store information up to entire processes in a tamper-proof and fail-safe manner and without being able to store it without trusted third parties. Projects such as Ethereum or NEO with so-called (DApps = Distributed Apps) have dedicated themselves to these possibilities. The basic idea is a form of virtual machine, which allows the execution of programs on the blockchain. There are also interesting opportunities in crowdfunding. Unfortunately, the latter has already led to numerous cases of fraud in the context of initial coin offers (ICO), which has meanwhile led to a temporary ban in China and is also being viewed critically in other countries.
Those who want to experiment with blockchain in the enterprise environment should take a look at Stratis or NEO . Stratis also provides side-chains, for example, so that not all information has to be stored in an endlessly growing blockchain.