Consensus on Cardano vs. other blockchains

Consensus on Cardano vs. other blockchains

(Written by @ElliotHill of the Cardano Foundation)

image

Consensus mechanisms are essential for all parties to agree on a single immutable history of a blockchain, to mint new blocks and to maintain the protocol as a whole.

The two main methods of consensus used today are based on proof of work (PoW) or proof of stake (PoS) mechanisms, which have influenced many other types of similar consensus methods.

Here, following the successful hard fork of Cardano to a PoS blockchain, we deep-dive into the history of consensus mechanisms, their limitations and how Cardano solves some of the most pertinent consensus issues through Ouroboros—the most technically advanced PoS algorithm to date.

We will also examine how Cardano’s approach to consensus makes smart contracts and decentralized applications (DApp) more secure than ever.

Proof of Work (PoW)

Proof of work was first implemented in blockchain as we know it today through Bitcoin in 2008. However, it’s foundations lie in cryptographic research much older than blockchain technology itself, and understanding the origin of PoW can help us understand distributed ledger technology as a whole.

First described by Cynthia Dwork and Moni Naor in 1993 as a computational technique for combatting junk mail, the basic theory behind early PoW systems was to require ecosystem participants to compute a moderately hard, but not impossible, mathematical problem to take part in a resource or network—thereby discouraging frivolous use.

Today, a quick look in your email junk folder may reveal that PoW found its most significant niche not in preventing spam, but in facilitating the creation of blockchain technology by preventing double-spending through Hashcash, part of the mining algorithm eventually used by Bitcoin.

In 1999, cryptographers Markus Jakobsson and Ari Juels formalized the notion of PoW, defining it as a verification that participants had performed a certain amount of computational work in a specified interval of time, in which case they were granted access to a resource—represented as a block reward in PoW blockchains.

A few years later, the late cryptographer Hal Finney built the first digital e-money using an iteration of PoW which saw limited economic use. However, just under a decade later, Finney was the first-ever recipient of Bitcoin, the original PoW functional blockchain built by the anonymous Satoshi Nakamoto—still the largest cryptocurrency by market capitalization today.

PoW gave rise to cryptocurrency miners, who use powerful computing hardware to solve cryptographic problems and validate blocks in return for block rewards. Crypto mining has since become a huge business, powering the cryptocurrency markets and industry as a whole.

It’s unclear whether these pioneers of cryptography had any idea what a behemoth Bitcoin and the rest of the blockchain industry would become. Nonetheless, the academic theory laid the foundations for consensus mechanisms and hashing algorithms as we know them today, even for those protocols which have evolved beyond PoW.

In addition to Bitcoin, PoW is used as the consensus mechanism for over 75% of blockchains today, including Litecoin, Ethereum, Bitcoin Cash, Monero, Dogecoin, and many more. But, just because it is the first, does not necessarily mean it is the best. Let’s explore some limitations of PoW.

Issues with PoW

Despite its usefulness for preventing double-spending, there are a number of theoretical and proven issues with PoW consensus, which include:

  • Energy inefficiency – PoW requires vast amounts of energy in order to power the computing hardware needed to mine blocks, representing a huge environmental burden. Research published in 2019 estimated that the Bitcoin mining network alone consumed at least 40 TWh of electricity per year, possibly up to 62 TWh—comparable with the energy requirements of the entire nation of Switzerland.

  • Hashrate consolidation – In theory, a relatively small handful of suitably well-funded miners or mining groups could become responsible for the majority of the hash rate in a PoW system. The risk of hashrate consolidation makes the entire network more centralized, as a relatively small number of miners are responsible for mining new blocks.

Proof of Stake (PoS)

As we will examine in detail below, Cardano is a PoS blockchain. PoS protocols are organized in rounds, and most PoS blockchains simply cycle through block producers when it comes to minting a new block in a round robin type selection. Instead, some PoS blockchains, as we will examine below, randomly elect leaders for each round or slot, who are called slot leaders in Cardano. The most critical algorithmic component is a slot leader election procedure, which determines a subset of participants with the authority to add a new block to the blockchain during each round.

Slot leaders are chosen according to their ‘stake’ in the protocol, or the portion of protocol tokens which they control relative to the rest of staking participants. Those with higher stakes are more likely to be chosen as a slot leader and mint a new block—hence the term proof of stake.

Crucially, PoS uses a fraction of the hashing power—and therefore, a fraction of the electricity—that PoW algorithms consume. The low hashing and energy requirement is because slot leaders are chosen according to their stake in the protocol, as opposed to how much physical hashing power they exert.

Other PoS blockchains

Cardano is one of the latest and most advanced PoS blockchains. Still, some other blockchains have pioneered its use in the past, some are currently using PoS, and some other blockchains are planning to implement it in the future:

  • Peercoin – Established in 2012, Peercoin was the first blockchain to implement PoS. Based on the Bitcoin codebase, Peercoin was described in a whitepaper that laid out the first formal minting using PoS based around the ‘age’ of coins in a network.

  • Tezos – Like Cardano, Tezos has a block producing round called a ‘cycle’. Tezos is built on an entirely different consensus layer to Cardano, despite surface-layer similarities. For instance, Tezos has an account model based on Ethereum rather than an extended UTXO like Cardano—which enables Hydra and superior multi-asset support. Tezos has both block producers, which it calls ‘bakers’, and participants who agree on new blocks, called ‘endorsers’. Participants in Tezos’ PoS consensus algorithm are assigned baking rights or endorsing rights at the beginning of each cycle using a random seed computed from information stored on the blockchain.

  • Ethereum 2.0 – Despite currently existing as a PoW blockchain, Ethereum will eventually move to PoS through the rollout of Ethereum 2.0. Ethereum 2.0 will rely on validators—a role also referred to as ‘virtual miners’—and ether deposits to reach consensus.

Issues with Proof of Stake

There are some theoretical issues associated with PoS, many of which were problematic in early iterations of PoS blockchains. Let’s explore some of them here, and we will examine below how Cardano avoids these:

  • The ‘nothing-at-stake’ problem – Attacks against PoS blockchains can be facilitated by validators, who continue simultaneous multiple blockchains by exploiting the fact that little computational effort is needed to build a PoS blockchain. As securing the network does not have an intrinsic cost as in PoW algorithms, this can result in validators building on all past forks of a PoS blockchain in order to collect transaction fees on whichever chain ends up becoming the most used. This can be disruptive to consensus and leave the wider network vulnerable.

  • Goldfinger attacks – Named after the Bond villain who tried to destroy US Treasury reserves, Goldfinger attacks seek to undermine and destabilize the consensus protocol itself for the attacker’s financial gain. These attacks can take various forms, such as a buy-out attack, a bribery attack, rental attacks, or building attack, each with varying modus operandi to the same end.

Consensus on Cardano

Following the hard fork from Byron to Shelley, Cardano now operates on Ouroboros Praos, a PoS protocol that is the first to be provably secure against adaptive attackers and scalable in a truly practical sense.

In ancient Egyptian and Hellenistic iconography, Ouroboros is a self-eating snake which represents cyclic renewal—particularly apt for the way verifiable random functions are generated during one epoch and used to elect slot leaders in the next epoch.

Ouroboros Praos provides security against fully-adaptive corruption in the semi-synchronous setting, which means that adversaries can corrupt any stakeholder at any moment without the underlying blockchain being affected, as long the stakeholder distribution maintains an honest majority of stake—made possible through stake pools and delegation.

Participants are prevented from exerting too much control over the Cardano network through a pool saturation point, or ‘K’, at which point the pool would realize diminishing returns for participating in consensus. This is to prevent a single or handful of pools from being disproportionately chosen as slot leaders, and keep the blockchain truly decentralized.

The design of staking pools and delegation on Cardano ensures that the protocol has a much greater capacity for decentralization—encouraging the creation of thousands of stake pools and a theoretically unlimited number of delegates. Hence, Cardano’s PoS algorithm has been said to ‘dwarf’ similar competitor chains according to independent code auditors.

How does Cardano overcome PoS limitations?

Cardano has been built using the latest cryptographic research, constantly improved through academic rigor, and informed by almost 80 peer-reviewed cryptography papers published by IOHK.

As a result, many of the limitations associated with PoS consensus have been alleviated or avoided entirely, making Ouroboros Praos the most secure iteration of PoS to date.

The ‘Nothing at stake’ problem is taken care of through Cardano’s analysis of forkable strings. Even if an adversary were to brute-force all possible strategies to fork the Cardano blockchain in the near future, there are no strategies that would be financially viable.

Likewise, the chain selection rule instructs participants to ignore very deep forks that deviate from the block they received the last time they were online.

Beyond Shelley—smart contracts, optimal throughput, and sidechains

Shelley introduced live PoS to Cardano, but there are many more benefits of PoS consensus to the utility of the broader Cardano blockchain. These include smart contracts, optimal transaction throughput, and sidechains. Let’s explore some of the basic principles of these features.

Smart contracts

The way Cardano reaches consensus is important for its smart contract and DApp capabilities. More decentralization in a blockchain means that more nodes are agreeing upon a single version of the truth.

As a result, smart contracts written on a sufficiently decentralized network are particularly robust and trustworthy. When paired with a decentralized oracle network, these smart contracts could adequately serve enterprise use cases, or even settle complex legal agreements.

Near-optimal throughput

Achieving a high transaction throughput is one of the biggest challenges for blockchains, but it is essential if blockchains are to become the financial operating systems of the future.

IOHK researchers have proposed a formal execution model for PoS based on Ouroboros, which maintains security while also allowing optimal transaction throughput, which would allow the Cardano blockchain to scale and handle high numbers of transactions while remaining secure.

PoS sidechains and interoperability

Sidechains have long been explored for their potential to enable blockchain scalability and interoperability, but there are many security considerations and problems to solve before they can be effectively implemented.

In May 2019, researchers at IOHK were the first to describe a construction for PoS sidechains which could be deployed on Cardano’s Ouroboros Praos PoS protocol.

A solution was proposed which would support safe cross-chain value transfers, which in turn would maintain the security of each underlying chain, verify a majority of honest stake exists for both participating chains, and maintain the integrity of one transacting chain should the other fail.

Goldfinger attacks and other attempts to undermine consensus are thwarted on sidechains, as they only carry a small amount of stake at a time.

In practice, implementation of PoS sidechains could enable, for the first time, full interoperability between blockchains—accelerating scalability across the entire blockchain industry, but also enabling communication with legacy banking and financial systems via permissioned ledgers.

Learn more about consensus on Cardano

Having explored a history of consensus mechanisms to date, and where Cardano’s PoS consensus fits within the wider picture, we can begin to understand how advanced Cardano’s PoS mechanism is; and more crucially, how it underpins the entire Cardano ecosystem.

You can read more about Cardano’s consensus mechanism by visiting our developer documentation, heading over to our forums, or reading IOHK’s extensive research library.


Read more articles in our Shelley blog series below:

13 Likes

Great article!
Small edit under Tezos - should be “are called” or “they call” :pray:.

1 Like

Very well spotted, thank you :slight_smile:

1 Like

Such a concise and informative overview! Thanks for sharing

1 Like

Great article, could be reused more widely…

1 Like