Consensus Algorithms and Smart Contracts.
Consensus algorithms on blockchain networks
Finally, the blockchain technology has a way of determining who and how gets to add transactions to blockchain ledgers. This way is also known as consensus algorithm. Currently, there are several popular consensus algorithms.
The Bitcoin network uses the algorithm called proof-of-work. In this algorithm, miners on the Bitcoin network are trying to solve complex mathematical problems that the miner to first solve the problem gets to create a block of the blockchain and gets a reward in the form of newly minted Bitcoins from the network for doing so, which is how the Bitcoin network adds Bitcoins to circulation. You can see the total number of Bitcoins in circulation as you are reading this article by visiting http://www.bitcoinblockhalf.com/. The website will show you the total number of bitcoins in circulation, the percentage of total bitcoins mined (on the Bitcoin network, there can only be 21 million bitcoins. That’s how the creator of the network has designed it), total number of bitcoins left to mine, and many other interesting stats.
The fact that Bitcoin miners are trying to solve math problems using their computers and the first one to solve a problem wins means that, in essence, they are playing a lottery. They are all using the same software and solving the problems is in part about luck (finding the right number to add to a set of data to come up with a winning hash) and in part about the performance of the hardware used to run the software.
The approach works because the Bitcoin network is fully transparent and open and there can is no way to game the system. The disadvantage of this approach is that running the equipment to solve math problems burns a lot of electricity, yet doesn’t contribute to anything else than the creation of new coins. For example, according to an article in The Guardian from November 27, 2017, the electricity usage by the Bitcoin miners annually has surpassed the annual usage of electricity by such a country as Ireland.
This is one of the problems that the consensus algorithm called proof-of-stake has solved. In proof-of-stake, there is no mining. Members of a network vote on which blocks of the network are valid based on their “stake” in the network.
Yet another consensus algorithm is Byzantine Fault Tolerance. The name of the algorithm comes from the Byzantine generals’ problem. In the problem, generals need to make decisions based on the intelligence they receive without always knowing if the intelligence is coming from a trusted source, meaning that the source can be loyal or it could have been converted by the enemy. The generals need to come with one decision, which is whether they should go into a battle or not based on the information that they have.
Smart contract revolution
The Bitcoin blockchain was the first blockchain network to gain a somewhat large adoption and to this day it remains the largest cryptocurrency by market capitalization. The second largest cryptocurrency is Ethereum. The biggest difference between Ethereum and Bitcoin is that the Ethereum network has the Ethereum Virtual Machine, which is able to run code on the Ethereum network. On the Ethereum network, it is possible to run smart contracts, which are a way to run contract on blockchain networks. With smart contracts, it is possible not only to store information on a blockchain in a secure way, but also to automate business processes and transactions. For example, a smart contract on a blockchain could monitor temperature inside a cargo container or temperature of air in a zip code where a farm is located. If the temperature stays too high or too low for a prolonged period of time, the contract could automatically fill out an insurance claim.