Autor: Richard Red, contribuidor Decred.
A consensus mechanism in Blockchain serves to ensure that there is agreement between participants regarding the current state of the network. The consensus mechanism determines who is able to add new blocks of transactions and one of its main objectives is to ensure that the chain is not rewritten or altered.
Consenso Proof of Work
Blockchains with a pure Proof of Work (PoW) consensus mechanism, such as Bitcoin, can only have new blocks added by miners, who invest in powerful equipment to be more efficient in trying to guess the answer to mathematical problems. Each time a miner guesses a valid answer, he can construct a network-allowed block. While miners can choose any chain to mine, the network will only accept the chain that has the highest accumulation of Proof of Work (e.g., most hashes or guesses) as the legitimate chain. This means that miners are incentivized to mine on the longest chain, and when they see a new valid block, they try to find the answer to the next block's math problem, allowing them to build on the previous one.
The difficulty of rewriting the blockchain is what makes it possible for the network to function as a ledger for financial transactions. When a transaction appears in a block, sending coins to a wallet, and multiple blocks have been built on top of that block (confirmations), it becomes unlikely that the block (and the transaction) can be rewritten or changed.
If an entity or organization has enough Hashing Power (processing power) to overcome the “honest chain”, it can rewrite (or reorganize) the blockchain by mining an “old” block instead of the newer one. Here is a simple description of this type of attack, better known as a 51% Attack: The attacker makes a transaction in block X to a broker's wallet, and then starts mining a parallel chain privately (these blocks are not are transmitted to the network). Once the required number of confirmations has been exceeded, the attacker trades his coins for others and then withdraws these assets. When the broker completes the withdrawal process, they release the parallel chain, and if it has greater PoW (blocks) than the original chain, the network will accept it as the legitimate chain and the history represented by the original chain (including the attacker's deposit ) will disappear. This way the attacker will be free to spend the same coins again.
Since miners are the only entities that have the power to add blocks directly to the chain in pure PoW-based cryptocurrencies, this gives them an important role in network governance. Therefore, for any change to the network's consensus rules to be adopted, it needs to have the support of most of the existing hashing power. “Soft Forks” require that enough miners recognize a new set of rules so that users can expect their transactions to be properly processed and included in blocks. “Hard Forks” divide the network into two parts, and by the commonly accepted rule that “the chain with the highest PoW is the correct chain to follow”, miners will choose which is the legitimate chain.
Consenso Proof of Stake
Proof of Stake (PoS) consensus is an alternative method used to decide who can add new blocks and verify the current state of the blockchain. Instead of miners competing to solve mathematical problems, in the case of PoS, the next block builder is determined by a process based on the number of coins held in wallets (or “stakes”). This process believes that those users with the highest stakes will make more responsible decisions to maintain the integrity of the network.
The PoS consensus mechanism eliminates the need for extremely energetically costly mining, but this lack of energy expenditure creates another problem, sometimes called “nothing at risk.” In the case of a forked chain, PoS forgers (“forge” is usually a substitute for “mine”) are incentivized to mine on both chains, because it costs very little to do so on an extra chain and they can collect rewards in both chains. And this is a problem for the network, because supposedly only a single chain should exist and agreeing on its current state is the purpose of the consensus mechanism.
PoS has an additional problem when it comes to token distribution. PoW miners have significant costs (such as equipment and electricity) and typically sell a large portion of their mined coins to cover operating costs. As a result, many mined coins end up being available for purchase on the market, instead of being accumulated by miners. PoS forgers have a very low operating cost, so they do not need to sell the coins they receive as a reward for maintaining the network. Wealthier users who enter the PoS process tend to increase their share of the percentage of coins in circulation, this happens because they collect block rewards and transaction fees from network users. This entire process has been compared to feudalism, according to which the network is owned and operated by currency holders, making users pay rent for use. There is usually a cutoff number, where being below it makes it impossible to participate in the PoS process.
Hybrid PoS/PoW
The goal of hybrid Proof of Work and Proof of Stake systems is to capture the benefits of the respective systems and use them to balance the weaknesses of each. Decred is among the few cryptocurrencies that utilize PoW and PoS in a recognizable way and unite them to produce a hybrid or multi-factor consensus mechanism.
“Masternode Coins” are, in some aspects, also hybrid, having a recognized PoW component that plays a similar role in the case of Bitcoin, and an additional function for special nodes. There is usually a requirement that these special nodes hold a certain amount of cryptocurrencies as collateral, demonstrating that they can be trusted to act in the best interests of the network, something very similar to the reasoning behind Proof of Stake. Dash is a masternode currency and refers to this model as Proof of Service. This article will focus on hybrids with a Proof of Stake component, and will not consider the variety of coins that emulate masternodes or Proof of Service.
Decred's PoW component works similarly to other PoW-based projects and uses the Blake-256 Hash Function. Decred's PoS component and the way it is inserted into the chain is quite unique and deserves further explanation.
To participate in Decred's Proof of Stake process, holders must “lock” their coins to purchase tickets (or, tickets). The price of an individual ticket is set by a market mechanism, in which the system is pointing, according to a defined number of tickets (40,960) - if there are more than the target number, the price goes up, if there are less, decreases. When someone buys a ticket, the coins used in that purchase are locked (making it impossible to spend them) until their tickets are called for pseudo-random voting, or until they expire after approximately 142 days. This introduces an opportunity cost to PoS, designed to ensure that voters are “in their own skin” and acting in the best interests of the network.
PoS participants (also known as voters or holders) have three distinct roles to play: voting en bloc, voting for changes to consensus rules, and voting for project management using the Politeia Proposal System. Politeia). The first of these, “block voting,” is the way in which PoS voters become more directly involved in maintaining consensus.
Voting in blocks
When a PoW miner finds a valid block, he broadcasts it to the network, but for that block to be considered truly valid, it must include votes from at least 3 to 5 randomly selected tickets. PoS voters keep their wallets open and ready to respond with votes when their tickets are called (or they can hire a voting service provider (VSP) to vote in their place). When a PoS ticket is called to vote and responds, its owner receives a reward.
When tickets are called, they vote to accept or reject regular transactions from the most recent block. Network nodes will not recognize a new block as valid until it has at least 3 votes. If the majority of tickets called for voting reject transactions from the previous block, they will be returned to the mempool (mining pool memory). These regular transactions include the PoW miner reward, but not the PoS voter reward.
Therefore, PoS voters have the power to withdraw miners' rewards without affecting their own rewards. This limits the power of PoW miners to veto changes to the network's consensus rules, which are voted on by stakeholders. In fact, PoS voters can reject any type of undesirable behavior miners exhibit by simply adopting the policy of voting “no” when malicious or inefficient behavior is detected - preventing bad miners from writing transactions and receiving rewards.
This PoS verification layer significantly increases network security and resistance against majority attacks (such as the 51% Attack). The common method of conducting a double-spend attack is to rewrite the blockchain by mining an alternative chain in secret, releasing it after a certain period of time, and taking advantage of voiding transactions on the “old” chain (e.g., spending double your entries). Because Decred blocks require randomly selected ticket inputs to be considered valid, and cannot be built by PoW miners until they have received the input, it is not possible for PoW miners to mine in secret unless they also control a significant proportion of existing tickets (see these articles).
The hybrid design of PoW/PoS significantly increases the costs of attacking a network because there are two distinct systems that must be bypassed by the attacker. The PoS component, in particular, is configured in such a way that tickets can only be acquired slowly. A limited number of tickets can be purchased in each block/slot, and purchasing the maximum number causes the price to rise drastically. Additionally, once these tickets have been purchased, the funds used to purchase them will be locked up for a time, leaving an attacker exposed to any devaluation of their coins, which would be directly affected as a result of an attack.
The requirement that each block be voted on by randomly selected holders means that the blockchain must be shared with all participants as it is mined, increasing the security of the network. Decred's hybrid system is designed to also grant holders power over PoW miners.
Voting for consensus change
Decred set out early on to make PoS holders a dominant decision-making force in blockchain governance. Written into the consensus rules is an update procedure whereby any changes to the network's consensus rules can only be implemented after going through a voting process. Changes can only be made if approved by at least 75% of voting tickets. This process begins when a certain proportion of miners (95%) and voters (75%) are running software updated with the latest rule changes. If the proposal has 75% support after a 4-week voting period, it will be accepted. Otherwise, it will be rejected, and if it does not have the necessary majority, a new vote will begin. If a proposal is accepted, the rule change will be activated one month later.

Management Project: Politeia
Decred block rewards are split between PoW miners (60%), PoS voters (30%), and a “savings” (10%) to fund open source software development that furthers the project’s goals. Ticket holders have the sovereignty to vote on how this fund should be spent, what features should be added, and determine policies through the Politeia platform.
Final considerations
Since PoS voters receive 30% of a block’s rewards, they cannot simply keep their stakes. Most newly mined DCRs go to PoW miners in exchange for the role they play in securing the network, preventing the “nothing at risk” problem that pure PoS systems have. Miners would typically have to sell a significant portion of the rewards they receive to cover their operating costs, ensuring that a good amount of DCRs are available on the market.
The Decred blockchain features a unique architecture and is one of the most notable examples of a hybrid PoW/PoS system. In the same way that PoS consensus projects are a general grouping with significant variations, future projects that implement hybrid PoW/PoS approaches will also be unique and will not necessarily follow the Decred framework.
