Consensus explained
Consensus is the process of reaching a majority opinion by everyone involved in running the blockchain. An agreement must be made on which blocks to produce, which chain to adopt and to determine the single state of the network. The consensus protocol determines how individual nodes assess the current state of the ledger system and reach a consensus.
Blockchains create consensus by allowing participants to bundle transactions that others have submitted to the system in blocks, and add them to their chain (sequence of blocks). Determining who is allowed to produce a block when, and what to do in case of conflicts, (such as two participants adding different blocks at the same point of the chain), is the purpose of the different consensus protocols.
The protocol has three main responsibilities:
- Perform a leader check and decide if a block should be produced
- Handle chain selection
- Verify produced blocks
About Ouroboros
Cardano runs on the Ouroboros consensus protocol, which was delivered with several peer-reviewed papers presented at top-tier conferences and publications in the area of cybersecurity and cryptography. Rather than relying on 'miners' (as in proof-of-work protocols) to solve computationally complex equations to create new blocks – and rewarding the first to do so – proof of stake selects stake pools to create new blocks (opens in a new tab) based on the stake they control in the network.
How Ouroboros works
Ouroboros divides time on Cardano into epochs where each epoch is divided into slots. A slot is a short period of time in which a block can be created. Grouping slots into epochs is central to adjusting the leader election process to the dynamically changing stake distribution.
Central to Ouroboros’ design is that it must retain its security in the presence of attacks. As such, the protocol has built-in tolerance to prevent attackers from propagating alternative versions of the blockchain and assumes that an adversary may send arbitrary messages to any participant at any time. The protocol is guaranteed to be secure in the so-called synchronous setting (that is, with strong guarantees on message delivery times) so long as more than 51% of the stake is controlled by honest participants (that is, those following the protocol).
A slot leader is elected for each slot, who is responsible for adding a block to the chain and passing it to the next slot leader. To protect against adversarial attempts to subvert the protocol, each new slot leader is required to consider the last few blocks of the received chain as transient: only the chain that precedes the prespecified number of transient blocks is considered settled. This is also referred to as the settlement delay. Among other things, this means that a stakeholder can go offline and still be synced to the blockchain, so long as it’s not for more than the settlement delay.
Within the Ouroboros protocol, each network node stores a copy of the transaction mempool – where transactions are added if they are consistent with existing transactions – and the blockchain. The locally stored blockchain is replaced when the node becomes aware of an alternative, longer valid chain.
Read more about the different versions of Ouroboros here:
- Ouroboros overview (opens in a new tab)
- From Classic to Chronos: the implementations of Ouroboros explained (opens in a new tab)
- Ouroboros Chronos provides the first high-resilience, cryptographic time source based on blockchain technology (opens in a new tab) blog post
- Ouroboros Genesis: enhanced security in a dynamic environment (opens in a new tab) blog post.