In this post, we’ll dig deeper into the need for blockchain consensus and how the two most popular consensus mechanisms – Proof of Work and Proof of Stake – compare to one another.
The need for blockchain consensus
Because blockchain networks are open, anyone can run a node and contribute to the system. And because there is no one central party to make decisions, agreement must be reached among the nodes in order to validate transactions, create blocks, and update the distributed ledger.
Consensus mechanisms must be resilient to failures and malicious activity by one or more actors to maintain the security of the network. This challenge is represented well by an anecdote called the Byzantine Generals Problem.
The Byzantine Generals Problem
In the Byzantine Generals Problem, the Byzantine Army has decided to capture an enemy city. The army has multiple divisions with generals who lead them, and these divisions have the city surrounded. The generals can communicate only via messenger, and they all need to agree on a battle plan before they can move forward.
If they all agree to attack, they must do so all at once, or else they will be defeated.
If all generals were loyal and trustworthy, then there would be no issue with making a decision. But the concern is that there may be traitors among the generals who will send false messages and sabotage the attack.
How can the Byzantine army overcome the small number of potential bad actors to carry out their intended plan?
The two most popular consensus mechanisms used today are Proof of Work and Proof of Stake. Let’s take a look at how each of them works and their pros and cons, starting with Proof of Work.
Proof of Work
Proof of Work (PoW) is the consensus mechanism employed by Bitcoin (and Litecoin, Zcash, Monero, and many other cryptocurrencies). We will refer specifically to the Bitcoin network in this section, but similar principles apply to other PoW cryptocurrency networks.
How Proof of Work Mining Works
The process of validating transactions and creating new blocks in PoW is called “mining.” Miners are nodes in the Bitcoin network who validate transactions, group them into blocks, and add them to the blockchain.
To do so, miners must expend computing power to solve a mathematical puzzle. The first miner to complete this task is automatically granted the ability to add the block of transactions to the blockchain, which is then verified by all nodes in the network.
These mathematical puzzles have some specific properties that help maintain the network:
These puzzles are computationally- and time-intensive to solve, but it’s very easy to confirm that the answer is correct. The difficulty of solving these puzzles is represented by the network’s hashrate, which is a measure of the computing power of the entire Bitcoin network. The higher the network’s hashrate, the more difficult the puzzle is to solve, and the more computing power you need to mine blocks.
The only way to solve these puzzles is through brute force. If you want to solve the puzzle more quickly, the only solution is to add more computational power. You can’t work smarter, only harder.
The difficulty of these puzzles changes so that one block is added to the Bitcoin network on average every 10 minutes. If blocks are created too quickly (i.e. low difficulty/hashrate), the network adjusts to make the puzzles harder. If blocks are created too slowly (high difficulty/hashrate), the puzzles get easier. This is to maintain the pre-determined consistent pace of creating new coins.
The miner receives a block reward and associated transaction fees for performing this work. Block rewards are paid in Bitcoin generated as a result of a transaction. This Bitcoin is awarded to successful miners as a means for motivating participation and encouraging good behavior.
Miners can use a variety of computer hardware to mine Bitcoin:
CPU (Central Processing Unit): CPUs are found in normal computers like the one you’re using to read this article. Because of the limited processing power of CPUs, it’s pretty much a waste of your time to try to mine Bitcoin with your computer, but you may be able to mine other lower-hashrate cryptocurrencies with it.
GPU (Graphics Processing Unit): GPUs are more powerful graphics processing cards that are frequently used for gaming and other processing-intensive activities.
FPGA (Field-Programmable Gate Array): FPGAs are powerful chips that can be programmed to perform a specific task. These are much more powerful than CPUs and GPUs.
ASICs (Application-Specific Integrated Circuit): An ASIC is a type of chip that is specifically built to do one thing and do it very well. Most ASICs manufactured today are built for Bitcoin mining because they are extremely fast and energy-efficient.
Pros of Proof of Work
The main advantage of PoW is its security. It’s extremely difficult for a bad actor to take over the network.
To do so, the villain needs to control 51% of the mining power of the network. This is a massive amount of computing power that will be extremely expensive to obtain. So it’s not in the best interest of miners to go against the network because if their ploy doesn’t work, they can incur huge financial losses.
After 11 years of existence, the Bitcoin network has never been hacked. That’s pretty amazing.
Cons of Proof of Work
High Energy Consumption
The primary drawback of PoW mining is that it uses a lot of energy and can be detrimental to the environment.
Raw computational power is the only way to mine a PoW coin, and this power needs electricity to run. And mining Bitcoin uses A LOT of energy.
And with the growth in popularity of Bitcoin, these energy consumption numbers will only increase.
While Bitcoin has been extremely secure and it is nearly impossible for a single bad actor to overtake Bitcoin’s network, a 51% attack can be achieved if many miners combine their computational power.
Currently, miners work together as “mining pools”, where they aggregate their computational resources so they can increase the likelihood of mining blocks and obtaining the rewards. If multiple mining pools combine their resources, it is possible that they can coordinate a 51% attack on the Bitcoin network.
Per Blockchain.com, 57.6% of Bitcoin’s hashrate is concentrated in the top 4 mining pools.
Validators in PoS environments are analogous to miners in PoW systems – these nodes help maintain the security of the network by validating transactions and creating new blocks. But instead of a miner purchasing expensive computing equipment to mine new blocks, validators stake the PoS network’s cryptocurrency for the ability to validate transactions and “forge” the next block.
Here’s how the process works.
The validator puts some of their cryptocurrency at stake (essentially, putting it in escrow) to win the right to forge the next block. Depending on the cryptocurrency network’s policies, winning validators are selected based on one or a combination of the following methods:
Randomized Block Selection: Validators are selected by looking for nodes with a combination of the lowest hash value and the highest stake.
Coin Age Selection: This method selects validators based on “coin age”, which is calculated by multiplying the number of days the coins have been staked by the number of coins staked. Once a node has forged a new block, their coin age reverts back to zero and they must wait a certain period of time to be able to forge another block. This helps prevent nodes with large stakes from continually winning the right to forge blocks.
If a validator tries to approve a fraudulent transaction, s/he will lose their stake and the right to create blocks in the future. If the validator approves legitimate transactions, they are granted the right to create the next block and will receive compensation in the form of transaction fees.
Because validators are putting their cryptocurrency up for stake, theoretically they are incentivized to validate legitimate transactions and not act out of line.
Pros of Proof of Stake
The biggest advantage of PoS networks is energy efficiency and environment friendliness.
Massive computational power is not necessary to create blocks; validators can use normal desktop and laptop computers to participate.
A positive side effect of this energy efficiency is that it theoretically incentivizes more people to run nodes, and thus makes the network more decentralized.
Cons of Proof of Stake
The first con of Proof of Stake is that validators with a large amount of coins can have outsized influence on the network. As validators win the right to create new blocks and earn more rewards, their chances to continue to forge new blocks increases and thus the network becomes more centralized.
While the Coin Age selection method tries to prevent this, the size of stake will always be a factor in selecting validators. So this problem can’t be entirely avoided.
Even though you don’t need massive hardware requirements to participate in PoS networks, you do need to be connected to the internet at all times to maximize your chances of forging the next block. Not everyone can be continuously connected, so this can lead to network centralization around those who can.
Proof of Work and Proof of Stake are the most popular cryptocurrency consensus mechanisms used today. Each has its benefits and drawbacks, and it’s important to understand how they work to provide security of these networks.
In our next post, we’ll review additional consensus mechanisms, such as Delegated PoS, Proof of Elapsed Time, and others, that are used by other cryptocurrency networks, and their pros and cons.
We would love to hear your thoughts about these consensus mechanisms. Did we miss anything?
If you enjoyed this article, please give it a share with the toolbar on your left! Also, sign up for our mailing list below, and follow us on Twitter and Facebook to be notified of future posts.
Learn more about how blockchains work, the benefits they provide, and how they can be applied to various industries.
Blockchain is one of the most disruptive technologies since the internet was invented, and will have wide-ranging impact on many industries, including finance, supply chain, and many more.
But what exactly is blockchain technology and how does it work?
Blockchain was made famous when it was used to develop the most popular cryptocurrency, Bitcoin, and is a new way of storing, distributing, and sharing data. But it can do so much more.
In this article, we’ll go over how blockchain works, what benefits it provides, different structures of blockchains, and a few of its potential applications.
A Definition, Analogy, and Real World Example
In technical terms, a blockchain is a series of blocks of data which are linked to each other via cryptographic hash functions – mathematical algorithms that verify the authenticity of data and are extremely difficult to reverse.
Each of these blocks contains data (which can be transaction data, identity data, or many other types) that is secured cryptographically, which makes it resistant to modification. The blockchain is managed by a network of interconnected computers called nodes that maintain these data records, alleviating the need for the network to be managed by a single, centralized party.
To better understand how blockchain works, let’s try an analogy.
Imagine a Google Sheet spreadsheet that is shared with thousands of people. All of these people can see the data that the Google Sheet contains and they have influence over the content in the spreadsheet:
All changes to the data in the Google Sheet’s cells are readily viewed by all.
Users can work together to agree upon the validity of the data being entered into the spreadsheet.
When new data gets entered, everyone will have an updated version right before their eyes.
So in this case, the Google Sheet is the blockchain, the data in the spreadsheet cells is like the data in the blocks, and the spreadsheet users are the network nodes.
Now imagine having all of this distributed, transparent functionality without Google being the central party that provides the Google Sheets technology. Pretty powerful and interesting, huh?
Let’s take a look at a real world example, with a simple one being in the form of payments.
Let’s say you want to pay your friend via PayPal for tickets to the Backstreet Boys reunion concert. I know this isn’t happening, but we can dream, right?
Anyway, you open your PayPal app and send her money. For this transaction to be verified and executed, PayPal, the centralized entity, must:
Confirm your and your friend’s accounts in their databases.
Make sure that you have enough money in your account (or have a bank account or credit card linked).
Withdraw money from your account and transfer it to your friend’s account.
Update their databases to reflect the executed transaction.
Now let’s say you wanted to pay your friend via Bitcoin. You create a request to send Bitcoin (usually through a cryptocurrency wallet like Coinbase or Trezor) to your friend’s wallet address and the process would go something like this:
The transaction request gets distributed to Bitcoin’s network of nodes.
The network nodes validate the transaction and update your and your friend’s balances (a lot more goes into this step, but let’s keep it simple for now).
A new permanent and unchangeable block that reflects this transaction (among others) is added to the Bitcoin blockchain.
The transaction is complete.
As you can see, this transaction isn’t verified by a single company with centralized databases. Rather, it’s validated by many others who contribute to the Bitcoin blockchain and maintain a distributed ledger that is permanent and unchangeable.
Cryptocurrencies like Bitcoin, Ethereum, and Litecoin are mentioned as interchangeable with blockchain, but that’s only part of the story. Yes, these cryptocurrencies run on a blockchain, but not every blockchain’s main purpose is to be a form of money. We’ll learn more about the potential uses of different blockchains later in this article.
Characteristics and Benefits of Blockchains
The last time I checked, there were over 2400 (!) different blockchain protocols in existence. While many of these have unique traits, there are three core characteristics of blockchains:
Decentralization: All the data inside the blockchain is not owned by a single centralized entity. Rather, the nodes, which are the people who help manage the network, all download the blockchain data onto their computers, which means that no one party owns the data. Different blockchains have varying levels of decentralization based on their consensus mechanism (which we go over in this section).
Transparency: The nodes that have downloaded the blockchain onto their computers can see all the data that is stored on said blockchain. Every single bit of data can be traced right back to its very origins. For example, in the Bitcoin blockchain, every single bitcoin (or fraction of a bitcoin) can be traced back to see who owned the currency in the past and what transactions those coins were involved in.
Immutability: The data stored on the blockchain is secured via cryptographic hash functions and thus cannot be tampered with. This ensures that the blockchain provides top-level security of its data, and the data cannot be edited once it has made it onto the blockchain.
These three properties – decentralization, transparency, and immutability – help provide the following key benefits:
Trustlessness: You no longer have to trust a central party to execute a transaction. The decentralized nature of blockchains allow peer-to-peer transactions – whether they are a transfer of money or exchange of data – to be carried out without a single party sitting in the middle. And blockchain’s transparency lets everyone see that these transactions were executed.
Enhanced traceability: Transactions on the blockchain are tracked in chronological order and can’t be changed or reversed due to the cryptographic hashing. All of the network’s nodes have access to every transaction, which makes it very easy to trace what transactions took place, when, and by whom.
Censorship resistance: If a central party manages a network’s data, it has the ability to censor how you use their app. For instance, PayPal has a history of not allowing pornography workers to use its payment system. That has led to the rise of SpankChain, a decentralized platform that helps these workers get paid with no censorship.
Reduced cost: Goods are costlier than they need to be because middlemen add fees and charges. With blockchain, these intermediaries are kept to a minimum because of the trustlessness of the network, thus reducing costs.
Increased speed and efficiency: Blockchain is increasingly replacing slow, paper-based processes, as well as processes that require alignment of multiple separate databases. By aggregating data on a single distributed ledger, transactions can be executed and shared more efficiently, leading to faster operations in many cases.
Improved security: The combination of distributed data and cryptographic hashing makes blockchains more difficult to hack than centralized databases. Hackers no longer have a single database to attack. Rather, they will have to find a way to overcome the security provided by thousands of computers across the world who are monitoring the network.
Categories of Blockchains
Blockchains fall into three general categories – public, private, and consortium blockchains. Each have their pros and cons and are best applied to different situations.
Let’s first review public blockchains, which are also called “permissionless” blockchains.
Public blockchains are open to the public, and anyone can access and participate in these networks without anyone’s permission – hence, permissionless. These are the blockchains that you are most familiar with – Bitcoin, Ethereum, Litecoin, and many other cryptocurrencies.
The advantages of public blockchains are that it’s simple to join their network. Any willing participant can join, read, write, and make legitimate changes to the network, provided that the rules of the network are followed. As a result, public blockchains are decentralized in the purest sense of the word – there is no one central body controlling the data on the blockchain. Also, once data gets written to a public blockchain, it cannot be changed.
But they do have certain drawbacks which makes them impractical for some use cases, namely by enterprises:
Many public blockchains suffer from scalability issues. Bitcoin can only manage somewhere between 3-7 transactions per second, and it takes 10 minutes to mine a block. Ethereum fares a little better with 25 transactions per second and a 15-second block time. This is simply not good enough for big enterprises who need to deal with millions of transactions per day with near zero latency.
Consensus mechanisms are extremely important for public blockchains. However, as in the case of proof-of-work (PoW) chains like Bitcoin, consensus can be an extremely time-consuming and expensive process, which doesn’t fit well with enterprises.
Finally, public blockchains are transparent. This is a huge problem for enterprises who need to store and transact across terabytes of confidential data. In this case, public blockchains simply can’t work.
Thus, many enterprises choose to use private blockchains.
Public blockchains are open to anyone who wants to participate. Private or permissioned blockchains, on the other hand, are controlled by a central authority and only allow a select few to take part in the network.
Entities who want to participate in a private blockchain must gain permission to do so from the centralized body. Once the entity has joined the ecosystem, they can play a role in the consensus of the network.
These private blockchains have been specifically designed for enterprise needs and offer benefits such as:
High Performance – Because the number of nodes are limited in private blockchains, consensus can be reached very quickly. Thus transactions can be executed faster and the system can be scaled more easily.
Compliance – Enterprises may have to adhere to various compliance requirements, and having control over the network helps them achieve this.
Data Privacy – All the nodes in the private blockchain network are carefully vetted members of the community. No random person can enter the network and become a participant; thus privacy is increased.
The Linux Foundation’s Hyperledger Fabric is an example of a permissioned blockchain framework (it can also be used to create consortium blockchains, which we go over below). It has been designed from the ground up to cater to enterprise requirements and has been implemented by large organizations for various purposes.
One of these companies is Walmart. The world’s largest retailer is working with IBM to use blockchain to track the source of their vegetables throughout the supply chain.
Each entity who handles vegetables that get delivered to Walmart can be a node who adds their data to the network. This will allow Walmart to quickly and easily identify who handled what food, when, and where. Walmart is leveraging IBM’s Food Trust product, which is built with Hyperledger Fabric.
A consortium blockchain is a hybrid blockchain which can be described as “kind of decentralized.” Yes, that’s a technical term.
Instead of allowing anybody to participate in the blockchain (like in public blockchains), or having one entity primarily control the network (like in private blockchains), a small number of entities are selected to manage the network and have equal influence in doing so.
Consortium blockchains follow a permission system called shared permissioned ledgers. This is a closed ecosystem between multiple entities who share the same blockchain. The right to read the blockchain may be public, but the ability to form consensus and edit the network data is restricted only to the participants.
“In general, so far there has been little emphasis on the distinction between consortium blockchains and fully private blockchains, although it is important: the former provides a hybrid between the ‘low-trust’ provided by public blockchains and the ‘single highly-trusted entity’ model of private blockchains, whereas the latter can be more accurately described as a traditional centralized system with a degree of cryptographic auditability attached.”
Facebook’s Libra can be considered a consortium blockchain, where Libra’s partners such as Visa, Uber, PayPal, and others will help manage the network.
Decentralization brings a myriad of benefits. But with the lack of a central authority, who makes the decisions, and how do all the nodes come to an agreement?
Enter consensus mechanisms.
Per Wikipedia, “Consensus decision-making is a group decision-making process in which group members develop, and agree to support a decision in the best interest of the whole.”
In simpler terms, consensus is a dynamic way of reaching agreement in a group. And consensus mechanisms are at the core of how blockchain nodes reach agreements of which transactions are approved.
We can write all day about the different types of consensus mechanisms that blockchains use and all of their technical details. And maybe one day, we will. But for now, we’ll review the two most popular consensus mechanisms – Proof of Work and Proof of Stake – on a high level.
Proof of Work
The Proof of Work (PoW) algorithm was created before the advent of cryptocurrencies but was made famous and applied by Satoshi Nakamoto – the unknown founder of Bitcoin – to provide consensus for its ecosystem.
In Bitcoin’s PoW mechanism, miners need to solve a difficult computational problem to validate the transactions in a block and add it to the blockchain. To do so, they must dedicate a large amount of their computing power and if they are successful, they will receive monetary rewards in the form of bitcoins.
The difficulty of this work, called the hashrate, is adjusted so that a block can be generated only once every 10 minutes. There is a low probability of successfully generating a block, so it’s difficult to predict which miner will be successful and reap the rewards.
Each mined block contains the hash of the preceding block, and all blocks are connected, forming the blockchain. Changing the data in a block requires the regeneration of all preceding blocks, which is extremely resource-intensive and nearly impossible. This difficulty protects the immutability of the data on the blockchain.
The main advantage of PoW is its security. Miners need to spend a real-world resource (their computing power) to mine these blocks, which can get really expensive. It is not in the best interest of the miners to go against the system since they can incur huge losses.
The main disadvantages are as follows:
PoW mining uses a lot of energy and can be detrimental to the environment.
Wealthy companies can buy large amounts of mining equipment and increase their hashrate within the system. If they gain 51% of the hashrate, then they will be able to control the network and render it useless. But again, this is extremely difficult to pull off.
Proof of Stake
The Proof of Stake (PoS) consensus mechanism shares the same purpose as PoW – to validate transactions and achieve system consensus.
However, instead of miners dedicating computing power to create new blocks, validators are deterministically chosen as block creators based on their stake. Their stake is typically how many coins they are willing to lock up within the system in order to create the next block.
For instance, if Mike stakes 20 coins and Vicky stakes 200, Vicky has a 10x better chance to be the next block validator. And she will get a reward proportional to the number of coins she staked.
The biggest advantage that PoS has over PoW is energy efficiency. Because PoS doesn’t require a large amount of energy to create blocks, it is much more environmentally friendly.
There are debates about which consensus mechanism is more secure.
With PoW, you need a significant amount of computing power to overtake 51% of the network, which is very difficult and expensive. And PoW has proven to be resilient for a longer amount of time.
With PoS, you’ll need over 51% of the amount of coins on the network (which is also very difficult to achieve), but if you were to attack the system this way, others in the network will leave, and your coins will be rendered valueless. While this system seems to be effective, it is not as proven as PoW.
There are a few other consensus mechanisms, such as Delegated Proof of Stake (DPoS), Proof of Capacity (PoC), Proof of Elapsed Time (PoET), and others, each with their cool acronyms. We’ll go over those in future posts.
Applications of Blockchain
There are many scenarios where the decentralized, transparent, and immutable nature of blockchains can be beneficially applied. Let’s go over a few of these potential use cases.
As mentioned earlier with the PayPal/Bitcoin example, blockchains are often used for peer-to-peer payments. Bitcoin, Litecoin, Dash, and many other cryptocurrencies are being used by people to pay each other and purchase goods and services from merchants. And there are many companies such as BitPay, Crypto.com, and others that provide the infrastructure for retailers to accept cryptocurrencies as payment.
Supply Chain Management
Just as in the Walmart example, blockchains are being used to create more transparent supply chain networks. The origin and movement of goods can be tracked with speed and transparency never available before.
If food contamination occurs, retailers can use the data on the blockchain to quickly identify the source of the tainted food.
Everledger is doing the same for diamonds, Ernst and Young built a blockchain platform called TATTOO to track the source of wines, and many other blockchain networks are being created to better track the supply chain of goods around the world.
The process of getting a loan is miserable. You have to fill out tons of paperwork, generate all kinds of identification to prove you are you, and depend on some human loan officer to determine whether you are worthy of borrowing money. This process takes weeks, if not months.
Companies like MakerDAO and Compound Finance are building blockchain-based lending solutions that take the manual parts of the process and replace them with computer code. Loans can now be executed much more quickly and with little to no human intervention.
The elections process requires a lot of trust. As a voter, you have to trust that your ballot was properly delivered and not edited, and all ballots were accurately read and counted.
Coinifide CEO Yuri Zamostin was interviewed by Hehmeyer’s Jessica Darmoni about the company’s cryptocurrency trading and education platform.
Mr. Zamostin talked about how important education is for the nascent cryptocurrency space, and how there is high demand from enterprises and universities to educate their employees and students. Certification is an important component as well, as students want credibility and hiring companies want official certification of course completion.
He also spoke about the innovative peer-to-peer cryptocurrency trading platform that focuses on security, accessibility, and liquidity.