In a blockchain, an algorithm is the specific set of mathematical rules a network follows to validate transactions, produce new blocks, and keep every node's copy of the ledger in agreement without a central authority. Rather than one universal formula, each chain chooses an algorithm suited to its own goals for security, speed, and decentralization.
The most familiar category is the hashing algorithm used in Proof of Work mining. Bitcoin relies on SHA-256, a cryptographic function where miners repeatedly test numbers until one produces a hash below a target value, a race that has driven the rise of specialized ASIC miners. Litecoin and Dogecoin instead use Scrypt, designed to be more memory intensive and harder to dominate with custom chips, while Ethereum ran on Ethash, built specifically to resist ASICs, before it changed direction entirely.
Algorithms are not limited to mining. Since its 2022 Merge, Ethereum secures its chain with a proof-of-stake algorithm called Gasper, which combines a fork-choice rule (LMD-GHOST) with a finality mechanism (Casper-FFG) so validators, rather than miners, propose and confirm blocks by staking ETH. Other networks rely on their own Proof of Stake variants, delegated voting schemes, or Byzantine fault-tolerant models suited to smaller validator sets.
Choosing an algorithm involves real trade-offs between energy use, resistance to centralization by specialized hardware, transaction throughput, and how easily the network can be attacked. A project's algorithm is one of the clearest signals of its underlying security philosophy.