status

Finality of Cardano transactions

Published 7.6.2023

The team designing the network consensus must carefully balance each feature. What is advantageous from one perspective may be disadvantageous from another. It is impossible to design a single best solution that has no drawbacks. Only diligent research and technological progress allow us to move closer to the ideal solution. Cardano uses Nakamoto-style Proof-of-Stake, which means, among other things, that it has probabilistic transaction finality. Come and read what this means and what are the advantages and disadvantages.

TLDR

The IOG team preferred liveness and security over transaction speed for the current version of PoS. Modern PoS networks combine the benefits of probabilistic and provable finality. Ouroboros Leios can change that.

Finality of transactions

You probably know that each transaction that users submit is gradually propagated through the distributed network to all block-producer nodes. If a value is to be transferred from address to address, the transaction must be included in the block and the block must remain in the blockchain. For a transaction to be considered final, the block must also be final.

Let's define what transaction finality and block finality means.

Transaction finality refers to the point at which a specific transaction within a blockchain network is considered irrevocably confirmed and cannot be reversed or invalidated. It represents the assurance that a transaction has been inserted in a block and is considered a permanent part of the blockchain's history. Once a transaction achieves finality, it is generally accepted as settled and immutable.

The finality of a transaction depends on the finality of the block into which it was inserted.

Block finality relates to the confirmation and permanence of an entire block within the blockchain. It represents the point at which a block of transactions is considered immutable and cannot be modified or discarded. When a block achieves finality, all the transactions included within that block are deemed final as well.

The role of network consensus

The finality of the block is important, as the content of the block is immutable. Network consensus is used to ensure that nodes in the network reach a majority consensus on adding a new block. So a blockchain is essentially just a chain of contiguous blocks whose order is immutable. More precisely, immutable from a certain point in time.

From the point of view of finality, it is crucial at what point a block can be considered non-reversible based on the network consensus. In other words, we are looking for the point at which a user can be sure that the majority of nodes in the network are sure that a given block will remain forever in the blockchain.

In the context of blockchain, time can be divided into periods in which new blocks are added. In the case of Cardano, this averages 20 seconds, for Bitcoin it averages 10 minutes, and for Ethereum, it is 12 seconds.

For a block to be considered final, a majority of block-producer nodes in the distributed network must agree. They can do this either before a new block is added to the blockchain through some form of voting, or afterward by linking the new block to its predecessor. The use of the previous block (or blocks) as a predecessor for the new block is an expression of the consent of that block-producer node.

As we said in the introduction, Cardano uses Nakamoto-style Proof-of-Stake, which is based on the Proof-of-Work design.

A Nakamoto consensus is only able to achieve a so-called probabilistic finality. The network is able to reach an eventual consensus. Probabilistic finality means that under some assumptions about the participants in the network, if we see a few blocks that have been added behind a given previous block, we can estimate the probability that the given previous block is final. Reaching the eventual consensus means that at some point in the future, all nodes will agree on the immutability of a certain set of blocks. Reaching the eventual consensus may take a long time. Moreover, it is not possible to determine how long it will take ahead of time.

Once a new block is added, no participant (neither block-producer nodes nor users) can be sure that the block will not be reverted. A so-called fork may occur, where the new block-producer node does not link to the last block in the blockchain, but to the predecessor of that block. This means that one block is followed by two successors. Only one of the successors can remain on the blockchain. The other one will be orphaned, including all transactions. Which successor remains in the blockchain will be decided by the following block-producer nodes who will choose one of the variants. The longer chain rule will decide the winning version of the blockchain.

To understand the concept, always after adding a new block, there is still a small chance of a block being reverted and thus all transactions in it are invalidated.

An alternative to probabilistic finality is provable finality. A consensus that is designed to have a provable finality aims to provide absolute certainty that a block candidate (and transactions in it) is final and cannot be reversed or altered. This is typically achieved through consensus mechanisms that guarantee a deterministic outcome and mathematical proofs. It is possible to create a consensus that prevents forks of blockchain. Participants can be assured that each newly added block is final, i.e. immutable.

Since each newly added block is provably final, it is essential that some form of voting takes place between block-producer nodes before it is included in the blockchain. The rule-defined majority (often ⅔ of the block producer nodes) must agree with the newly proposed block. If the majority disagrees, the block candidate is not added to the blockchain and a new candidate must be created and voted on again.

Advantages and disadvantages of probabilistic and provable finality

Note that both approaches described are essentially about some form of voting. The main difference is that in the case of probabilistic finality, the vote is taken after the block is added (which can lead to forks) while in the case of provable finality, the vote is taken before the block is added.

There are hybrid variants, where voting on a newly added block takes place immediately after it is added. A block is considered immutable as soon as the required majority in the network votes for it. This means that forks of the blockchain may occur, but the block can be finalized very quickly through voting (block-producer nodes vote to keep a particular block).

If a block-producer node proposes a block candidate, he or she essentially votes on it alone. The block has little "weight". The weight increases with the votes of the other nodes. In the case of Cardano (and also Bitcoin), the weight increases with each block added. Therefore, the weight (number of voters) grows slowly. If the consensus allows a block to be voted on before (or shortly after) it is added, the new block has high weight relatively quickly.

The topic is a bit more complex, as it is important to consider the voting power of individual block-producer nodes (pools). In a Cardano network, each pool can have a different stake (number of staked ADA coins). A new block can propose a pool with a low stake or a fully saturated pool. What effect does this have on the new candidate block? Theoretically none, as each newly proposed block has a similar status. However, SPOs having a high stake have a higher chance of producing more blocks in a given time period, which can be an advantage if forks occur.

We will not make the topic more complicated and will stick to finality, but it is important to note that block-producer nodes may or may not have the same voting power in different networks. Network decentralization is based on scarce resources (coins or hash rate) and whoever has more of it has more voting power.

Let's go back to the finality. The difference between probabilistic vs. provable finality has a major impact on robustness and liveness. It also affects the speed of transactions, i.e. the user experience.

In the case of Cardano, the block can be discarded, so once your transaction is inserted into the block, you have no assurance that it will stay on the blockchain forever. There is still a small chance that it will be reverted. Cardano has slow finality of blocks, hence transactions. As explained above, weight grows slowly because voting is done by adding new blocks. One vote is added every 20 seconds.

Approximately 1,200 pools are currently producing blocks in the Cardano network. Voting just 10% of the pools takes 40 minutes. During this time, 120 new blocks are added.

A given block can be assumed to remain in the blockchain after a certain small number of new blocks have been added. The problem is that this low number is difficult to estimate and is only probabilistic.

There are networks, such as Algorand, that are able to achieve instant block finality through voting. Once a new block is added, it can never be discarded. At the same time, there are never forks of the blockchain. Algorand has a block time of approximately 3.6 seconds and if your transaction is inserted into the block, it is immediately final.

Ethereum splits all validators into 32 equal committees every epoch. The epoch has 32 slots. Each slot lasts 12 seconds. The whole epoch is therefore 6 minutes and 24 seconds long. Each committee is responsible for producing a block and members of the committee are responsible for providing attestation (confirming whether they agree or disagree with the block proposed by the producer). Each newly added block is confirmed by 3.1% of the overall voting power. This means that the block will gain high weight (a large number of votes) significantly faster than in the case of Cardano.

The Nakamoto-style consensus prefers protocol liveness over the speed of transactions, i.e. the ability to always produce a new block even if a large fraction of nodes are unavailable. In case of a large number of nodes get offline, block production will take longer (missed slots), but there is a good chance that this will happen. As nodes gradually return to the network, block production will become more frequent.

For networks in which there is active voting on each block, block production can be stopped if 34% (usually more than ⅓ of the block-producer nodes) go offline. Networks with provable finality are considered more resilient to attacks and can better ensure the integrity of the blockchain. These networks prefer to stop producing blocks rather than producing blocks at all costs.

Networks with provable finality have several disadvantages. Network consensus can be relatively complex and vulnerable. Voting requires some overhead and can take a relatively long time. These networks may be more susceptible to block production outages if there are problems with the speed of data propagation over the Internet. It may be more difficult to achieve high scalability.

Returning just briefly to decentralization and security, in the case of Cardano the attacker needs to obtain more than half of the scarce resource (ADA coins) while in networks with provable finality, he usually needs to obtain more than ⅓ of the resource. Obtaining 1/3 of the resource is enough for the attacker to make the network unable to reach a consensus.

Conclusion

Users tend to prefer transaction speed over security, as security is relatively high on most blockchain networks. They mainly want to send a transaction quickly and be assured of finality. However, the first layers should primarily be as secure and decentralized as possible. The future probably belongs to hybrid approaches that combine the longest-chain rule with a mechanism that ensures fast finality. Ouroboros Leios will bring something like this to Cardano, as out of the 3 types of blocks that will be produced in the network, some form of voting will take place over the second type, the endorsement blocks. The third kind of block, which will be similar to the current one, will contain references to endorsed blocks, i.e. blocks containing the agreement of a relatively large stake.

The article was mostly about transaction finality, but it's important to remember that the heart of Cardano is high decentralization and native liquid staking. These features were achieved in part because Cardano has no slashing and you don't need to have a certain (relatively high) number of coins to participate in staking. Ethereum uses voting to reach consensus, and this requires the ability to lock ETH and punish validators for behavior that goes against the interest of the protocol. The finality of transactions is also related to the quality of staking, for example, and hence decentralization.

Technological progress will push Cardano forward. Ouroboros Leios will be the next major step regarding the finality of the transactions on the first layer.

Featured:

Related articles

Did you enjoy this article? Other great articles by the same author