The consensus layer
The third layer of the stack is the consensus layer. This layer deals with the enforcement of network rules that describe what nodes within the network should do to reach consensus about the broadcasted transactions. It also deals with the generation and verification of blocks. The following diagram shows the common capabilities that are part of this layer:
The consensus layer includes capabilities that describe the rules for reaching consensus. The rules that need to be enforced depend on the consensus mechanism that is chosen when the network is initially set up.
When we speak about consensus, we mean the collaborative process that participating nodes of the network use to agree that a transaction is valid and to keep the distributed ledger synchronized at all times. These consensus mechanisms lower the risk of malicious (or fraudulent) transactions because they would have to occur (or be executed) across many locations at the same time, or else the tampering will be noticed almost immediately by other nodes. To reach consensus, the majority of the participants need to agree that the transaction is valid before it is permanently recorded in the ledger.
Once a transaction is permanent, no one, not even a system administrator, can delete the transaction from the ledger. The cost and time needed to reach consensus depends on the mechanism in place and the number of nodes participating in the consensus. A permissionless, or public, blockchain has relatively higher costs as compared to a trusted network of participants (permissioned or private blockchain). A wide variety of consensus mechanisms exist and are available to choose from in order to run an enterprise blockchain. When trust is high between nodes, a simple consensus mechanism, such as a majority vote, may be all that is needed. Alternatively, the network may choose to use a more hardened method.
The following example mechanisms and capabilities demonstrate how a network can reach consensus. The available consensus mechanisms can be categorized in to two groups: sophisticated and lightweight consensus mechanisms. Where the trust between participants is limited or non-existent, you will usually see one of the following more advanced consensus methods being used.