Proof of Stake in Cardano

In a typical blockchain network, the core function of nodes is to independently process transactions such that every node verifies each received transaction, aggregates a collection of the transactions into a new block and relays the new block to the rest of the network. The process of creating the new block includes making the block valid and for this to be the case, the entire network of nodes have to agree on the validity of the block. But why is this important? The main purpose of blockchain is ensure the integrity of transactions by being able to come to agreement on what are valid transactions without the need of a central authority. By having a way of incentivizing nodes into acting in good faith in the network, a blockchain can be able to create a ledger of transactions that have integrity.

To achieve this security, several mechanisms exist with the two prominent ones being Proof of Stake (PoS) and Proof of Work (PoW). To understand the Proof of Stake as the main focus of this article, it is necessarry to look at Proof of Work. At present, the two main mechanisms used in the dominant blockchains are Proof of Work and Proof of Stake. Bitcoin, in a process called mining, uses Proof of Work which generally involves all nodes in the network competing to solve a mathematical challenge when creating the block. The nodes that first gets the solution adds it to the block and broadcasts the block to the network. With that, other nodes stop their computation for that challenge and can easily prove that the winnig node spent considerable computing resources to arrive at the solution.

In general, Proof of Stake secures the network in the almost a similar manner. Nodes in the network verify and validate transactions, add those transactions to a block and broadcast the block to the network and earn a reward for the effort. The difference is on how the validation of a block is done. Unlike PoW blockchains where every node competes to validate a block and the first to complete wins, the PoS mechanism works by selecting validator nodes based on the amount of stake in ownership the node has in the network. Although the algorithm selects nodes randomly, it is designed such that nodes with more coins held have a higher probability of being selected. This approach makes sense because it assumes that the more stakes (hence the name Proof of Stake) a node has on the network, the more likely it will act in the best interests of the entire network and earn rewards in the process. In effect, this secures the network since a node that has alot of the blockchain’s value would be bound to act honestly to ensure that the network remains secure otherwise its stake in the network would be davalued.

How does PoS work in Cardano

In the standard PoS mechanism, a security flaw arises where the integrity of the blockchain can be compromised. In a scenario where a fork happens as a result of malicious action or two nodes simulatenously proposing blocks, a validator loses nothing by validating blocks on both chains. In any case since there is little computational cost in the PoS network, the validator is economically incentivised to add blocks to both chains as valid. This is called the nothing-at-stake problem and it can lead to double spends. An attacker trying a double spend attack could fork the chain at a point before he spends the coins and continue adding blocks to his chain until eventually his becomes the longer chain. In the Cardano blockchain, PoS in implemented though what is called the Ouroboros protocol which specifies how nodes in the blockchain network arrive at consensus. It is a variation of the standard PoS mechanism and it addresses several issues inherent in a standard PoS system. For instance, rather than validator nodes being selected in a round-robin manner, the Cardanoblockchain randomly selects validator nodes that are given authority to validated nodes for selected periods of time in future. These are called slot leaders and their selection is largely dependent on the amount of stake they hold. In particular, Cardano avoids the nothing-at-stake problem by using the concept of forkable strings analysis whereby it becomes infeasible to fok the chain back to if most nodes are online.In addition, it is infeasible in Cardano to have a fork generated by two nodes at the same time since the algorithm selects unique indentifiable nodes for validating blocks using an election process.

The implementation of the Ouroboros protocol, not only provides a provably secure algorithm that addresses many potential forms of attacks but it also provides a mechanism called delegation whereby a stakeholder can transfer the right to create blocks to a delegate who may or may not be a stakeholder. This is attractive to stakeholders with little amounts of value who may find it inconvinent to be always online and have little chance of being elected as slot leaders. With this scheme, rewards are shared out among the delegators in proportion to the amount delegated.

All development of the Cardano blockchain is preceeded by formal peer reviewed research and in the case of the consensus protocol, Ouroboros exists in several iterations namely Ouroboros Classic, Genesis, BFT, Praos and Chrono and Hydra.Each provides incremental research that improves the blockchain in several aspects. For instance, with Ouroboros praos, more users are supported with staking and DDos attaacks are mitigated while with Hydra, scalability architecture for high throughput is implemented. The implemetations of the specifications in the research papers are added iteratively as features and this continues to improve the blockchain in a research driven way.