As blockchains are decentralised or based on a P2P network, the fact that there is no central authority means that reaching consensus on the state of the ledger (the order and uniqueness of transactions) is a crucial matter. However, there are several algorithms that ensure the formation of consensus in a hostile or trustless network. This category includes the proof algorithms, which provide proof that actions have been completed, for example.
Proof-of-stake
The proof-of-stake algorithm works on the idea that a node or user has enough stake in the system, making an attack a negative option for a malicious user. In other words, the user has invested so much in the system that any attack on it would disadvantage the user more than benefit them. This self-interest aspect of the proof-of-stake algorithm deters users from attacking the system themselves. This idea was first introduced by Peercoin and is set to be used in the ethereum blockchain.