In the previous two sections, we followed the journey of a transaction:

  • A Transaction is a request to change data.

  • Nodes receive and transmit information across the network.

  • Validation checks transactions and Blocks according to the rules.

  • A Block organizes data.

  • A Hash helps link data and detect changes.

But imagine this situation:

Two groups of computers receive two different Blocks at the same time. Each group temporarily sees a different Blockchain branch.

So which branch will the network continue building on?

This is where Consensus plays its role.

1. What is Consensus?

Consensus can be understood as a mechanism for reaching agreement.

In a Blockchain, it is a set of rules that helps network participants agree on the data state and history to accept.

This matters because computers do not necessarily receive information at the same time.

One Node may receive a new Block earlier than another. In some situations, multiple competing branches may appear in the network.

Consensus helps Nodes handle these situations according to shared rules.

2. Fork Choice: Which branch should be followed?

Fork Choice is the rule for selecting the chain branch that a Node treats as the main branch to follow and build on.

Let's use Ethereum as an example.

Ethereum uses the LMD-GHOST algorithm for branch selection. Simply put, the algorithm considers Validators' latest attestations and their weight to determine which branch has the greatest accumulated support under the protocol rules.

Imagine that two branches, A and B, appear at the same time.

Some Validators attest to branch A, while others attest to branch B. Nodes use the Fork Choice rule to determine which branch has greater attestation weight and select it as the chain head they follow.

This does not mean that every computer gets one equal vote.

In Ethereum, attestation weight is tied to a Validator's effective participation balance under the protocol.

3. Finality: When is data considered complete?

Selecting the main branch does not mean that every Block on it has reached a finalized state.

This is where we need to understand Finality.

Finality is the state in which part of the Blockchain history has met the protocol's conditions for completion. Once a Block is finalized, reversing it would require a serious violation of security assumptions and could cause enormous economic losses for participants.

In Ethereum, this mechanism uses Casper FFG and milestones called Checkpoints.

Validators attest to pairs of Checkpoints. Once the required consensus threshold is reached, a Checkpoint can move to the justified state and then become finalized.

At a high level, this threshold requires attestations representing at least two-thirds of the total amount of ETH staked.

Therefore, Finality is not simply a matter of waiting for a few more Blocks and then automatically considering a transaction complete.

4. How are Fork Choice and Finality different?

Let's distinguish them with an example:

  • Fork Choice answers: "Among the competing branches, which one should a Node continue to follow?"

  • Finality answers: "Which part of the history has met the consensus mechanism's conditions for completion?"

A Block may be at the head of the selected branch without having been finalized.

During that time, if new information appears under the protocol rules, the chain head may change. This can result in some Blocks being replaced in the history being followed.

Once a Block has been finalized, reversing it is no longer an ordinary change. It would require a situation that seriously violates Ethereum's economic and security guarantees.

5. What problem does Consensus help the network solve?

Let's return to the original question: when many computers participate, how do they agree on the data history?

No central computer makes the decision on behalf of everyone.

Nodes follow the protocol rules. Fork Choice helps select the preferred branch. Finality helps determine which part of the history has met the conditions for completion.

These are two related but distinct functions.

And remember: Ethereum is just one example. Other Blockchains may use very different mechanisms for chain selection and finalizing data.

In conclusion: Six components, one coordinated system

  • Transaction: Creates a request to change data.

  • Node: Receives, checks, and relays information according to its function.

  • Validation: Checks data against the rules.

  • Block: Organizes transactions into units of data.

  • Hash: Helps link data and detect changes.

  • Consensus: Helps the network agree on the accepted data history.

Blockchain does not work through a single algorithm. It relies on the coordination of data, software, validation rules, and consensus mechanisms.

This is how multiple parties can maintain the same data history without depending entirely on a central authority.

CODEX LAB | Decode. Discover. Develop.

#blockchain #Consensus #Ethereum #LMDGHOST #CODEXLAB