Consensus algorithms are used to ensure agreement among nodes in a blockchain network regarding the state of the ledger.