A consensus mechanism is a protocol that lets nodes agree on blockchain state without a central operator. Proof of Work, used by Bitcoin, is the best known. Miners solve hard computational puzzles. The first to solve one adds the next block. That cost makes an attack expensive. You would need about 51% of computing power. Proof of Stake, used by Ethereum, works differently.
Validators lock tokens as collateral. They propose blocks. Other validators attest. Misbehavior burns stake. An attack then requires about 51% of staked tokens.
Proof of Work burns large amounts of electricity. Proof of Stake uses far less energy. Other designs exist. Proof of Authority lets approved entities validate. Proof of History adds a cryptographic timestamp. Proof of Burn has validators destroy tokens. The choice sets security, energy use, and how decentralized the set of block producers is.
Proof of Work is highly decentralized and energy heavy. Proof of Stake is cheaper to run and can concentrate if wealth concentrates. If validators misbehave, they lose their stake. A consensus mechanism is a protocol that lets nodes agree on the state of a blockchain without a central authority.
Ethereum's docs contrast proof of work (miners spend energy) with proof of stake (validators lock coins). Ethereum switched to proof of stake in 2022.
Consensus Mechanism Simulator
Compare Proof of Work vs Proof of Stake consensus algorithms
Mining Competition - Block #1
Proof of Work Explanation:
Miners compete to solve cryptographic puzzles. Higher hash power = more attempts per second = higher chance to win. Energy-intensive but secure.