On decentralized public ledgers, the core purpose of a consensus mechanism is to enable **cryptographically proven agreements** between *unknown* parties, allowing transactions to occur in a [[Trustless|trustless]] way. This consensus - or final agreement - can be achieved through various implementations of [[Practical Byzantine Fault Tolerance]] (BFT) algorithms, but purely trustless blockchain consensus also relies upon the [[Decentralization|decentralization]] of the nodes on the network (and their ability to communicate securely in a peer-to-peer way). When network nodes cannot collude because they are too decentralized or distributed, a consensus mechanism can provide a viable solution to the [[Byzantine Generals Problem]] in distributed computing. That is, effective decentralized consensus mechanisms are designed so that data sent/received by any node is virtually irreversible. This design is for collusion resistance, which is more commonly referred to as being [[Censorship resistance|censorship resistant]] in the blockchain community. >[!tip] Consensus relies on a combination of economic (dis)incentives such as [[Chain Concepts/Tokenomics/Thermodynamic Cost|thermodynamic cost]] - in addition to [[Sybil Resistance]] and cryptographic [[signature algorithms]] - to maintain valid transactions and blockchain [[Finality|finality]]. There are many implementations of blockchain consensus. The two primary types are [[Proof of Work]] and [[Proof of Stake]]. The thermodynamic cost associated with Proof of Work mechanisms is generally accepted as the most viable solution for blockchain security; these still suffer from scalability limits. [[Proof of Stake]] mechanisms are still early in their adoption phase at scale, but these can suffer from other issues such as risks of increased centralization. Whatever the implementation, consensus algorithms serve the additional key purposes: - Preventing [[Double-spending|double-spending]], or nodes/wallets trying to spend money twice that does not exist - Preventing [[Double-proposing|double-proposing]], or validators trying to sign multiple blocks per time period (potentially causing a [[Forks|fork]]) - Disincentivizing a [[51% Attack]], or a network majority creating a competing, counterfeit chain of blocks By design, all data transacted on the chain is independently verified using [[Hashing Algorithms and Functions|hashing algorithms]] before final confirmation, bolstering another key property in blockchain consensus known as [[Immutability|immutability]]. >[!note] There are three primary principles on which public ledger blockchains operate: >1. [[Decentralization]] >2. [[Transparency]] >3. [[Immutability]] These core principles, however, do present challenges which are vital to long-term adoption of blockchain networks and related ecosystems. Still, the objective is to achieve consensus in a way that fosters development and adoption (now and in the future), which requires optimization between the following three properties: > 1. Decentralization > 2. Security > 3. Scalability Decentralization is the common denominator. Because decentralization distributes computational power across untrusted parties, traditional blockchain consensus has a built-in delay on a per-block basis. Because of this design, decentralization can be a countervailing force against scalability. Achieving all of the above three properties is commonly referred to as the Blockchain Trilemma, a problem which has purportedly not been solved. >[!example] Example >The "block size war" occurred after significant bottlenecks on the Bitcoin blockchain in late 2017, resulting in a major debate on protocol design (See [[Bitcoin Proposals#BIP 248 (blocksize debate)|BIP 248]]). In most early proof-of-concept blockchain designs, security and decentralization were generally favored over scalability because adoption was not large enough to limit or prohibit network participants from transacting. Other blockchains have opted for a different optimization mix, with some favoring scalability and security first, by implementing varying degrees of network decentralization or distribution. Some of these blockchains are more often considered [[Practical Byzantine Fault Tolerance|Practical Byzantine Fault Tolerant]] protocols, as they are not *actually* decentralized in most commonly accepted descriptions of the word. >[!Note] Many new technologies are currently being developed to improve scalability, security, and decentralization. Some projects are attempting to solve at the base layer of the blockchain, where early communities such as Bitcoin and Ethereum are more focused on hybridized Layer 1s, Layer 2s, and/or sidechain-based solutions. Here are some examples of consensus mechanisms and associated projects: | Consensus Mechanism | Blockchain \| Distributed Ledger Technologies | | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | | [[Proof of Work]] (PoW) | [[Bitcoin]] (BTC), [[Ethereum]] (ETH 1.0), Monero (XMR) | | [[Proof of Stake]] (PoS) | Avalanche (AVAX), Cardano (ADA), [[Ethereum]] (Ethereum 2.0) | | Pure Proof of Stake (PPoS) | Algorand (ALGO) | | Proof of Spacetime | Filecoin (FIL) | | Proof of History (SOL) | Solana (SOL) | | Proof of Authority (PoA) | Vechain (VET) |