Blockchain Consensus Cryptography
To understand Bitcoin it is also necessary to understand other consensus algorithms. There are other models that are not yet listed here.
Everyone talks about Blockchain(BC) but only a few know exactly what it defines.
The BC is a Distributet-Ledger-Technology DLT, a decentralized public booking system that is stored on thousands of servers. The Bitcoin network, according to Blockexplorer, has 10,000 nodes, in fact these are only the public, so-called listener nodes, most nodes use "hidden services" like Tor and therefore cannot be captured. The number of all nodes in the BTC network is estimated at over 100,000.
In Blockexplorer, all "on-chain" (neither Lightning Network nor Liquid N. Tx) transactions (by transaction ID "txid"), each block (e.g. #1 Genesis block) and each wallet are publicly visible by address or public key. To ensure that all nodes receive the same information, there is an algorithm called consensus.
The consensus has the task to propagate the new block, which was found by the Miner in the network, by homogenizing and verifying the information of all nodes, whereby the longest "chain" is preferred.
Meanwhile, there are several different consensus protocols, the Bitcoin is called Proof of Work (POW), it has proven itself since the first Public Block, the so-called Genesis Block!
Proof of Work POW
With the BTC POW, a new data block is created approximately every 10 minutes, which contains the data of the transactions as signatures and time stamps, as well as other implementations, such as Smart Contracts(SC) or sidechains. With the data from the new block and the hash value of the previous block together with an arbitrary number, the nonce, a mathematical task is created, which has the goal to generate the hash value of the new block. These hash value calculators guess the hash value to find the new Blcok, they are called miners, the POW process is called mining.
The hash value is a digital fingerprint, at BTC with the elliptic curve cryptography ECDSA and SHA256. This hash value and the nonce, must now be guessed by a work proof - Proof of Work.
Specialized hardware (ASIC - application specific integrated circuit) now generates several thousand petahashes per second worldwide, with the number of computing power in the network the difficulty to find a block increases.
The difficulty is crucial for security and fairness, since it adapts intelligently to the performance of the network. The difficulty adjustment takes place every 2016 blocks, a halving of the block reward takes place every 210000 blocks and is called block-halving. Once a block is complete and consensus is reached on the network, it cannot be changed.
With POW the longest blockchain is always propagated, which results in the possibility of a so-called 51% attack, in which a Miner has at least 51% of the computing power (theoretically also possible with less than 50%), the Miner can perform various manipulations, such as a double booking, he could determine which transactions to verify, but he can not destroy the entire network with a protocol change.
Another possible attack would be the Erebus Attacke, in which the nodes are provided with false information. The Erebus attack can easily be prevented by the node communicating a .onion address over the Tor network. The Blockexplorer can be used to check how many nodes (nodes / peers) are active in the network and whether they communicate via Tor.
Criticism of POW
Electricity consumption in spring 2019 is currently around 53 TW/h per year. Furthermore, special hardware is manufactured, the ASIC miners, which have the goal to provide more and more computing power. If the technology is outdated, it is useless and cannot be used for other applications. This means that any amount of high-quality electronic waste is produced, the resources of which are limited and cause considerable damage to the environment. The Bitcoin thus follows an ice-cold capitalist logic of profit maximization and exploitation of the planet. Can the price of this technology be justified at all?
We can, of course, compare technologies that solve a problem: In my opinion, Bitcoin is technically more efficient and safer with second-layer technologies and Lightning N. than the money system with its many institutions that we have known so far. Allegedly, the worldwide dollar system consumes about 350 TW/h, the gold mining apart from the ecological catastrophe also needs about 370 TW/h! Bitcoin is perhaps still the somewhat smaller ecological catastrophe.
A study has shown that 73% of mining plants are located in regions that are supplied by renewable energies, of which 2/3 are hydropower, some of which is not yet used elsewhere. Another scientific article, entitled "Renewable energies do not solve Bitcoin's sustainability problem", has been published in English and deals with the topic in depth.
Other Consensus models:
Proof of Stake POS
At POS the blocks are verified by the stakeholders/minter, it is basically like a lottery, where the number of coins/token is decisive for the so-called staking/forging/minting process. As with the POW, a hash value is guessed that is defined by a mathematical task that might look like this:
Ω=0,5+5⋅(Number of Coins)
The higher the number of coins in the wallet of the winter, the higher the amount of events Ω is. The Minter must now find a result within the range of this event set and will be rewarded with the Blockreward. The security of the network is at risk if 51% of the coins are in the possession of a Minter, since he can now determine what is written in his forged block.
Cryptographers do not yet agree on the extent to which POS is protected against doublespending. The proponents of POS, however, claim that this problem is solved, because the first POS BC still exists NEXT NXT and had no known case of double booking! The most important advantage of the POS is the low energy consumption of the network, because no large computing capacities are needed!
At the Delegatet Proof of Stake DPOS delegates forger/nodes are elected with a fee of usually a whole coin/token, the delegate is not in possession of the voter's coins. The selected forger decides on the percentage distribution from the amount of minted coins to the voters/voters as well as the interval of the payments. The POS Consensus is not deflationary, a certain amount must be premined.
Proof of Activity
Proof of activity is a combination of Proof of Stake and Proof of Work. So the blocks are created once with POW without transactions and into this POW block comes the POS block which determines who is allowed to complete the block with the transaction history.
The aim is to use the advantages of both consensus protocols and to minimize the disadvantages of both protocols at the same time. This means for the security that 51% of the hash power and 51% of the coins are needed for an attack, the procedure gives the blockchain an additional level of decentralization.
Due to the high security of the system, the computing power for the POW can be neglected, which can significantly reduce the energy consumption for the network, or is this completely dependent on the POW Blockreward and the value of the coin!
Proof of Burn
As the name Proof of Burn suggests, this consensus algorithm burns coins. Burnt coins are irrevocably deleted and are never accessible to anyone again. The basic idea behind this rather radical measure is that the miner is willing to accept a short-term loss in order to make a long-term profit. Because by burning he gets the right to generate a new block.
Anyone who has burned coins once receives a lifelong right to generate new blocks. The probability of being selected for the next block increases with the number of coins burned over time. Here again parallel to the Proof of Stake algorithm are shown.
To burn coins, which theoretically can be native or foreign crypto currencies, they are sent to an Eater address. The Eater address is, as in this example, a random Bitcoin address. It does not have a private key and since this cannot be calculated backwards from the Bitcoin address, it is completely impossible to ever get to the coins in this address.
Proof of Capacity
The proof of capacity does not work with computing power (POW) or coins but with storage space. The aim is, for example, to offer a decentralized e-mail service or cloud storage. With Siacoin, for example, you can offer your own storage space against sia and rent it the other way round. Miners generate data segments (plots) and store them on their unused hard disk. In order to ensure data loss and encryption, the data is encrypted and fragmented during upload and then stored by the miners! Sia is the most prominent and oldest project, with an active open source community and is therefore probably the most decentralized d-cloud provider.
Proof of Elapsed Time
With the Proof of Elapsed Time, a random period of time is selected for each participating node within the network, which must wait for this node. The node whose wait time is shorter wins the new block. The new block is then added to the blockchain and sends the necessary information to all other nodes within the peer-to-peer network. Then the process starts all over again.
Two points are important for the consensus algorithm to really work:
1. the choice of waiting time must be random, otherwise the participants could deliberately choose a particularly short time to increase their chances of getting the new block.
2. it must be comprehensible that the node operator has actually observed the corresponding waiting time.
These points are met by two functions. First, the CreateTimer function ensures that the waiting time is randomly assigned. The second function is CheckTimer. It checks whether the user has kept the waiting time and is therefore authorized to append the new block.