Consensus algorithms are processes where validators (also known as nodes or miners) within a blockchain network agree on the current state of the network. This mainly entails agreeing on whether a transaction submitted by a validator is authentic. Fraudulent or inaccurate transactions are rejected by the network assuming all validators are acting fairly with no malicious intent. Validators are rewarded with cryptocurrency for submitting accurate and authentic transactions, whilst malicious actors are penalized depending on the consensus protocol.
For example, in proof-of-work (PoW) networks like Bitcoin (BTC), validators have to spend energy via expensive hardware to validate transactions, and if successful, they gain new tokens. If they act maliciously they gain nothing and the loss comes from the wasted energy used in submitting the fraudulent or