This knowledge base will grow and grow and grow.
Blockchain based on Bitcoin
1.1 Introduction
In the following, the blockchain technology will be introduced to a non-IT-savvy person using Bitcoin Core (BTC) as an example. As a result, the content is presented in a highly abstracted manner, but it hits the essential messages right on the nose. It is important to note that what is presented applies to “Bitcoin” (BTC). Other cryptocurrencies have similar or completely different ways of implementing the features described. However, Bitcoin – the first digital currency in the context of blockchain technology – is excellent as an illustrative example to introduce the technology.
1.2 A counterintuitive rationale
We are used to being able to hold a banknote – or even a gold bar – in our hands. The same is true of a bank account. We believe that the money provided to the bank is in the bank account.
To understand blockchain technology, you have to get away from the basic idea that you hold some kind of “storage unit” on your computer. Instead, you have to think of it as a chain of payments that anyone, anywhere, can view at any time via the Internet.
Example: How is a payment generally defined? Person A has 200 monetary units (GE) and transfers person B 100 GE. If we abstract this information, it would look like this: AB100. If B then transfers 50 GE to C and C transfers 25 GE to A, the entire string would look like this: AB100, BC50, CA25. This string can be continued indefinitely for further transactions and new participants (for example D).
The respective account balances are determined by a computer program going through the string and calculating each person’s ending balance – so in the case of A: 200 – 100 + 25 = 125.
This string of characters is called a blockchain or public ledger because – in the case of Bitcoin – everyone can see it. In the meantime, this blockchain is several gigabytes in size. Put simply, the blockchain is a text document on which every payment made so far is displayed, with new transactions being added continuously.
If one now ensures a distribution of this character string across the network – at the current time this is around 10,000 computers – it is irrelevant whether individual or several computers are attacked by hackers or falsify their data, because all other network participants would immediately notice if individual character strings had been manipulated. This is what is meant by decentralization.
1.3 The account number and access
From cryptography come the terms public and private key, also known as asynchronous encryption. ,
Public and private keys are inseparable. The private key is produced randomly. From this, the public key can always be calculated with a small program. A public key, however, never allows a conclusion to be drawn about a private key.
To illustrate this, the public key is the bank account number and the private key is the access permission to the bank account. The bank account number may be disclosed to anyone. The private key must be kept safe. The person who knows the private key controls the Bitcoins assigned to the public key. If one loses the private key, there is no way to transfer the Bitcoins according to the current state of the art.
In the above example, we simply replace the persons A, B, C with the account numbers – or also – with the public keys of A, B, C, where each person can transfer his monetary units with his private key.
The Bitcoin holdings assigned to the respective public keys can be viewed by anyone. A conclusion as to which natural or legal person is the effective holder of the public key is only possible if the respective person makes this known or if payments are made from a public key assigned to the holder. At this point, it should be noted that Bitcoin is a very transparent payment system. Alternative cryptocurrencies such as Monero are 100% anonymous – an inference is impossible.
1.4 The storage options – also called wallets
A private key is a 256-character sequence of zeros or ones. It is possible to make up a private key yourself or to flip a coin 256 times and write down the results (zero or one). The 256-character sequence is then converted into a format that is more convenient for humans. Converted into a decimal format, the number has 78 digits (1077) – for comparison: The number of visual atoms in the universe is about 1080. In order not to have to flip a coin 256 times each time, wallets exist.
Wallets have three basic purposes, depending on the form they take:
Wallets can basically be divided into three types:
1.5 A transaction
From a systems architecture perspective, the cryptographic mechanisms, transactions and mining, are the “heart” of the technology.
In a transaction, the sender signs his transfer with his private key. Signing a transaction is nothing more than encrypting a message that can only be decrypted with the sender’s public key; similar to a signature. This ensures that only the owner of the private key, and therefore the owner of the Bitcoins, can make a payment. The cryptographic control of the signature is carried out by the so-called nodes or miners.
If the transaction were read aloud in a human-understandable way, the message would likely read something like, “I, the authorized holder of this account number, as evidenced by my private key, send these monetary units to the following account number: …”
1.6 Blocks
A transaction can be compared to one or two lines on a sheet of paper, which contains the aforementioned content (among other things, the sender’s public key, the recipient’s public key, the number of monetary units). The sheet of paper is the block, which means that there is room for several transactions in one block, or to continue the example, there are several lines on one sheet of paper.
In Bitcoin, the block is one megabyte in size, which means that the space for the number of transactions is limited. The blocks stack up like a pile of paper, with a block being put together every 10 minutes on average. At the time of writing, we are at block 621180, where a block always contains a reference to its predecessor (block 621180 refers to block 621179) by means of a so-called hash code.
A hash code is nothing more than a digital fingerprint of a file. Using the hash function, a hexadecimal string can be created from a file of any size. If only one bit or one character of the file is changed, the digital fingerprint changes significantly. Similar to the concept of public and private keys, the original file can never be produced from a hash code. Conversely, the calculation or validation of the hash value takes only milliseconds. ,
A block contains information compiled in a specific way:
The fact that a block contains, among other things, the hash code of its predecessor means that the blocks are inextricably linked. If the contents of the predecessor block were adjusted by only one bit or character, the calculated hash value would not match the code displayed in the current block. Thus, the older a block is, the more forgery-proof it is, since an adjustment has an impact on all subsequent blocks. Since the blockchain is simultaneously stored at countless servers (nodes), the majority of network participants would immediately notice an adjusted version of the string and declare it invalid.
1.7 Mining and Nodes
The successful mining of a block means that the hash code, which must fulfill certain properties, has been found through a vast number of attempts. There are now computers operating in so-called mining farms whose sole purpose is to calculate hash codes as quickly as possible. The last part of the block contains the so-called nonce. This is a trial variable that is tried through until the hash code meets certain conditions.
In the case of Bitcoin, successful mining at the current time means finding the hash code starting with 18 zeros. This is for block number 621180: 0000000000000034cbe896bf63f31d7a437077cece6366646c89b3f00e68. That is, the mining device adjusts the nonce until the hash code starts with 19 zeros. The level of difficulty of successful mining is dynamically increased by the system, so that as the global computational capacity of the network increases, more zeros are required, and on average a block is still successfully mined every 10 minutes.
If a block is mined successfully, the miner concerned currently receives 12.5 Bitcoins, i.e. around USD 100,000. On June 11, 2020, this reward will be reduced by half. After a further halving of the credit, the final payment is to be made in 2140.
This credit represents a payment from the system for the computing power provided and is made in the first transaction of each block, called “Coinbase”. This is the only transaction per block that does not contain a “from address” but only an “to address” (public key). Furthermore, miners receive all transaction fees of the block in question.
To mine more efficiently, groups of miners with specialized computers join together to form a so-called mining pool and divide the rewards along the computing capacity provided. In principle, however, any desktop computer can already mine. The only thing needed is the installation of a program, access to the Internet and a sufficiently large hard disk. This feature allows the Bitcoin network to become, in principle, as decentralized as the Internet itself.
Nodes are observers and check, among other things, whether the calculated hash code is correct. They also check whether the transactions have been signed correctly. Miners always work with a node because, in addition to successful mining, part of the task is to validate the transactions and blocks. However, nodes also exist that only perform validation, either on a voluntary basis or in connection with a business model (for example, operating a website with corresponding information on the blockchain or offering an online wallet [payment service provider]).
The more nodes and miners serving the network, the more secure the network itself. The fact that a real-economy power is required to run the network, namely the operation of a miner and the consumption of energy, also makes the system more secure. So in Bitcoin, power consumption is a security component.
1.8 A race – the fastest wins
The system is based on the fact that blocks from different miners have individual content during their creation. For example, the recipient address of the Coinbase transaction is different each time. This means that a calculated nonce from one miner does not necessarily represent the correct result from another miner; the content of the block (and thus the nonce and hash code) varies.
When a user signs his payment, it is spread across the network via wallet providers and enters a pool of pending payments. The higher the advertised transaction fees (defined by the user), the faster the transaction is considered for execution on the network. A miner basically customizes the selected payments and the content of the blocks according to predefined rule instructions.
Once the miner has successfully calculated the nonce and hash code through countless attempts, it distributes its realization across the network as quickly as possible. As soon as a miner receives notification that a block has been successfully mined, it forwards this to the other network participants and validates the result. This means that each miner checks, among other things: Were all rule instructions followed? Does the nonce used result in the hash code with the required number of zeros? Have the transactions been signed correctly? If it finds that everything is correct, it stops its work for the current block, adds the newly found block to its string, removes the payments just processed from its pool of pending payments, compiles a new block with the new transactions to be processed, and starts again with the search for the nonce or the correct hash code for the new block.
It happens that at the same time a block has been mined by different miners. Both machines spread their version of reality over the network as quickly as possible. Thus, it is possible that one part of the network is working on a different blockchain. In this case, both parts of the network process different realities (a so-called fork – or in German “Gabelung der Blockkette”). As soon as another new block of a chain has been successfully mined, the miner again disseminates its result. Again, a validation by the network participants begins. The miners who have been working on the other blockchain realize that their chain has a smaller number of blocks, i.e. it is less advanced. They stop their work, revalidate the block of the other chain and start hashing the “correct reality” again.
In the source code of the software is defined that always that chain is valid, which is older and/or on which most work was done (in the sense of number of blocks). To change this or parts of the basic software with which one works, it needs a majority decision.
1.9 A Democratic Decision – Consensus
Miners have the possibility in the block to put a message in a certain part of the meta data. This is also referred to as signaling. In order to implement a software update that has new features, for example, in terms of security, not only must a vast majority of miners vote in favor of a particular thing, but other stakeholders must also agree:
In order to implement a software update, the vast majority of all parties (usually around 95%), must reach a consensus. Therefore, Bitcoin Core (BTC) is considered to be rather sluggish, but stable.
Stakeholders sometimes pursue different interests. So, in terms of a conclusion drawn by the author, from a short-term perspective, for example, it is advantageous for miners to maintain a slow network because then transactions with priority from users are given high charges so that processing takes place more quickly.
If the network is no longer used, the usage rate is reduced and therefore the price is automatically reduced. Interest is lost. This in turn has a negative impact on miners, as they have usually invested in expensive hardware.
There are further mechanisms to bring about democratic decisions or to ensure decentralization. We are talking about the more resource-efficient, so-called proof of stake approach. To show the advantages and disadvantages of Proof of Work (used in Bitcoin) and Proof of Stake as well as other approaches is a topic in itself. The only thing to note is that the Proof of Work approach has a real economic background – namely power consumption. Thus, it is basically considered more secure for Bitcoin supporters. In this sense, the electricity is not used to mine Bitcoins, but to provide a secure, decentralized network. At the same time, however, the number of transactions per unit of time is limited due to physics. In other blockchains, the aim is to combine the advantages of the aforementioned approaches from a technical and political point of view.
1.10 Discord – Forks
As is sometimes common in a democracy, separate paths are taken when there is disagreement. In terms of blockchain technology, this process is called a “fork.” In this process, the string is forked starting at a particular block, creating two blockchains from that point on. If one had currency units before the fork, one is entitled to both strings afterwards. The new blockchain created in this way can now have different properties to its “sister”. This means that it may not be used to the same extent and the monetary units of the new chain may be worth less. ,
Forks are broadly divided into four groups:
It would go beyond the scope of this article to go into the details of the individual characteristics. It should only be mentioned that, similar to a democracy, processes and rules of conduct are established that are applied in the event of a consensus. Logically, any kind of disagreement weakens Bitcoin in different dimensions. Thus, it is basically in the interest of the participants to find an agreement.