Crypto Fundamentals: How does Blockchain work?

What is Blockchain?

The following article explains what a Blockchain is. It’s not about explaining what Bitcoin is, but about the underlying technology in general. My goal is that an interested layman, after reading the article, understands why innovation and technological revolution are the language when it comes to blockchains.

The only requirement is that you are interested in blockchains.

Blockchain is the solution - but for what problem?

Bitcoin is known as a digital currency. Similar to Euros or Dollars, Bitcoins can be sent to someone via a kind of e-banking. The shipment takes place in the form of a transaction. The special thing about transactions is that they work according to the principle of “Complete transaction or not at all”.

With old known currencies like Euros, banks make sure that this works. There are many things to check, such as whether there is enough money in the account or whether the recipient exists. If something goes wrong, the money stays on my account. If it works, it is debited from my account and charged to the recipient’s account.

That appears simple at first. However, the banking system is spread all over the world and among many senders and receivers who want to carry out transactions at the same time. Due to this simultaneity and size of the network, it is difficult to prevent that something goes wrong and e.g. the same Euro is spent twice or even worse: The neighbour spends my Euro.

The bank always sits in the middle and decides what works and what does not. It has to control who owns the account, it has to control identity cards, it has to hand out TAN codes and PIN codes and it has to pay attention to many other things.

A blockchain makes it possible to do the same - but without a bank. It makes it possible, securely and transparently, to store account balances and transactions and distribute the information around the world.

Blockchain - Explained in five minutes

A blockchain is a directory. This directory consists of tables. Each table consists of several columns. These columns record who sent what to whom.

Tables are not infinitely large. When the end is reached, a new table is created. Each table contains additional information in addition to its transaction rows. This includes a unique table ID and a pointer to the previous table.

Tables are called blocks in a block chain. The reference to the previous table turns it into a chain. These block chains are called blockchains.

The transaction lines in a table contain, in addition to the fields that show who sent what to whom, a unique identification number - ID for short. In addition, they contain additional information that allows absolutely anyone to check whether the tables and transactions are valid.

The verification works on the basis of a special mathematics - cryptography. (This is where the term “crypto currency” comes from.)

Bitcoins are mined - what does that have to do with mining?

Bitcoin is the best known blockchain and with Bitcoin I often hear and read something about mining. In fact, it’s similar to real mining, because just as miners struggle to get gold from gold mines, Bitcoins can be mined with computing power.

Public blockchains - Mininig is the Bitcoiner’s delight

This option is available in Bitcoin to ensure that new blocks are created in the block chain. “Mining” in Bitcoin consists of checking transactions, creating new blocks, and calculating check numbers for blocks. Anyone who wants to can do this work.

Since there is no central authority that determines the blocks and everyone is equally invited to participate, we speak of a public blockchain. Absolutely anyone can begin to create blocks and participate in the blockchain.

Since anyone can participate, the principle is: trust is good, control is better. In a public blockchain, everyone must prove that the blocks they create are trustworthy.

There are different approaches to this. In the case of Bitcoin, this proof is called “proof of work”. With other blockchains there are other types of proof such as “Proof of Stake” or “Proof of Time”.

Private Blockchains - Everything is possible, nothing is necessary

Private blockchains are called private because they are not open to the public. It is also not clearly defined who is allowed to include data, who creates blocks and how, and who is allowed to read it. All this is determined by the blockchain developer.

Ripple is e.g. a blockchain that allows banks to exchange different crypto currencies via their blockchain. Banks and other companies conclude contracts with the company behind the Ripple blockchain and are then authorized to set up such “mining” nodes in the network. They check transactions and create blocks.

The blockchain itself is public.

The Security of blockchains

The technology that makes it possible to make a globally distributed system like a blockchain secure is based on asymmetric cryptography (public key method) and one-way verification numbers (hashes). The great thing about these two methods is that the results are very difficult to manipulate but very easy to verify.

This allows each transaction to be marked in such a way that it can be proven that it was really sent by the real sender. You can also prove that the sender actually owned the shipment at the time it was sent. The blocks are also marked in this way and no transactions can be removed or cheated on without being noticed.

Since these are simple calculations that can be used to check transactions, anyone who sees the blockchain can verify whether it is correct or whether it has been manipulated.

The length is important

What happens if two blocks are created simultaneously in a global blockchain network? In principle, only one block at a time can be attached to the chain. Those who create new blocks have to re-define where they want to append the new block each time. The selection happens because each participant in the network only accepts the block at the top of the longest block chain.

If two blocks are created at the same time, a rivalry begins as to which chain gets new blocks attached faster. In practice, a chain wins the race after three blocks at the latest.

In the case of Bitcoin, for example, blocks are created every 10 minutes. The rule of thumb for this blockchain is that a transaction is considered completed when it is an hour old. Then there are at least four new blocks and any race has already been won.

Applications with blockchains

Blockchains are suitable to distribute data completely decentralized in a huge network and to ensure that the data is correct and tamper-proof. However, this costs time and computing power. (The Ethereum-Blockchain Mining needs e.g. more power per year than Cyprus!)

Compared to the technical systems of banks, which sometimes need more than two days for a bank transfer, they are still relatively fast. All in all, this is a great and innovative invention. The exciting thing about it is that it is far from being finished. It offers a lot of potential for extensions and further developments such as automatic contract handling (Smart Contracts) or surveillance protection (e.g. zcash).