Chain confirmation versus transaction confirmation
Chain confirmation v transaction confirmation
When discussing Cardano, often-repeated questions are what is Cardano’s transaction time?, and how many network confirmations does Cardano require before a transaction goes through? The answers to these questions require a deeper look at the concepts of chain confirmation and transaction confirmation, and how these relate to the protocol.
This is the point beyond which the chain is guaranteed by the protocol not to alter any further because of randomness, or random events.
Chain confirmation occurs at some point in the future, after a certain amount of future k blocks have been minted. The time between now and the point when chain confirmation for a particular transaction occurs is called the stability window (that is, the number of slots required for a block to become stable, where stable is defined as a block that cannot be rolled back). The formula to calculate this window is 3k/f (where k is the security parameter in genesis, and f is the active slot co-efficient parameter in genesis that determines the probability for amount of blocks created in an epoch.)
This is the point in time when a transaction is accepted into the chain and becomes immutable. The concepts of block depth and settlement window come into play here.
A transaction can be considered confirmed if the block that contains it is deep enough in the chain. Deep enough is a relative concept: the depth of a block indicates how many more blocks have been added to the chain since that particular block was appended to it. And because blocks have depth, so do the transactions contained in them.
If the depth of a particular block is greater than a pre-defined threshold, the transaction is considered to be confirmed, and the assets in that transaction can be used 'safely' (i.e., the protocol guarantees that the transaction has become immutable, so the assets can be traded, exchanged, etc.)
The time period that elapses between the point when a transaction is confirmed, and when the transaction's assets can be used to exchange with other assets is called the settlement window.
Likelihood of immutability
Another way of determining whether or not a transaction is confirmed is by considering the transaction's likelihood of immutability. The probability of a transaction being immutable depends on how many blocks have been added to the chain since that transaction was accepted into the chain. The more blocks added, the higher the probability that the transaction will become immutable.
A transaction becomes immutable as soon as its depth is greater than 3k/f slots (that is, 129600 slots on current mainnet, or 36 hours). If this transaction is inserted into a block at slot 10 for instance, it will only become truly immutable at slot 129600. This is guaranteed by the Ouroboros Praos protocol.
However, 3k/f slots normally exceed the requirements in most situations, so a more practical approach is to consider the probability for a transaction to become immutable. In this case, we consider that a transaction is confirmed if the probability for it to become immutable is high enough.