Lesson 1 of 3 Ethereum Nodes and Clients

Execution and Consensus Clients

Since the Merge, an Ethereum node is two programs working together. This lesson explains what execution and consensus clients each do, how they communicate, which implementations exist and why client diversity matters.

Learning outcomes

After completing this lesson, you will be able to:

  • Distinguish the responsibilities of execution and consensus clients.
  • Name examples of each client type.
  • Explain the role of the Engine API and its JWT secret.
  • Explain why client diversity matters.

Nodes and clients

A node is a computer running Ethereum client software, which downloads blocks, verifies them and keeps a copy of the state. Ethereum is specified, not defined by one program, so several teams build independent clients in different languages. Since the Merge, a node that follows a public network runs two clients: an execution client and a consensus client.

The following comparison sets out their responsibilities.

Execution client
Main jobExecute transactions in the EVM and maintain state
KeepsWorld state, mempool, blocks' execution payloads
InterfacesJSON-RPC for applications (port 8545), peer-to-peer (port 30303)
ExamplesGeth, Nethermind, Besu, Erigon, Reth
Consensus client
Main jobRun proof of stake and choose the canonical chain
KeepsBeacon Chain state, attestations, validator records
InterfacesBeacon API (often port 5052), its own peer-to-peer network
ExamplesPrysm, Lighthouse, Teku, Nimbus, Lodestar
Sort into groups

Which client does this?

Exam skills 7.2.1

Decide whether each task belongs to the execution client or the consensus client of a node.

Log in to try this activity Interactive activities are free with an account.

The Engine API

The two clients communicate through the Engine API, a JSON-RPC interface that the execution client exposes only to its consensus client, by default on port 8551. Because it can control the node, it is authenticated with a JWT secret: a random 32-byte value in a file that both clients are given at start-up.

Through the Engine API, the consensus client sends new blocks' execution payloads to be validated and executed, tells the execution client which block is the head and which is finalised, and, when its validator must propose, asks the execution client to build a payload from the mempool.

# A typical pair of commands for a Sepolia node (paths shortened)
geth --sepolia --http --authrpc.jwtsecret /secrets/jwt.hex
lighthouse bn --network sepolia --execution-endpoint http://localhost:8551 \
  --execution-jwt /secrets/jwt.hex --checkpoint-sync-url https://checkpoint.example

The following diagram shows the two clients of a node and their interfaces.

The two clients of an Ethereum node. Applications call the execution client's public JSON-RPC endpoint, by default port 8545 for HTTP. The execution client and the consensus client talk through the Engine API on port 8551, authenticated with a shared JWT secret: the consensus client sends execution payloads to validate, tells the execution client the head and finalised blocks, and asks it to build a payload when its validator must propose. A validator client signs attestations and blocks for the consensus client.
Applications use port 8545; only the consensus client uses the Engine API.
True or false

The Engine API

Exam skills 7.2.1

Check what the Engine API is for and how it is protected.

Log in to try this activity Interactive activities are free with an account.

Validators and validator clients

Running a node does not make someone a validator. A validator also deposits at least 32 ETH and runs a validator client (usually bundled with the consensus client) that holds the validator's signing keys and performs its duties. Developers rarely need this; they run nodes to read the chain and submit transactions without relying on third-party providers.

Client diversity

If one client implementation runs on most nodes, a bug in it could split or halt the network, or, if it ran on more than two thirds of validators, finalise an invalid chain. Client diversity, spreading nodes and validators across several implementations, limits the damage of any single bug. Node operators are encouraged to choose minority clients.

Note

Geth (Go Ethereum) is the oldest and most widely used execution client and the one most learning material uses in examples. Its developer mode is covered in the lesson on local development nodes.

Scenario questions

Why client diversity matters

Exam skills 7.2.1

Reason about the risk of one client dominating the network.

Log in to try this activity Interactive activities are free with an account.
Worked example

A node that will not sync

After the Merge, a developer starts only Geth with --sepolia. Geth connects to peers but logs that it is waiting for a beacon client, and the block number does not advance. What is missing?

A consensus client. Since the Merge, the execution client cannot decide which blocks are canonical on its own; it follows the consensus client through the Engine API. The developer must run a consensus client, such as Lighthouse, pointed at Geth's authenticated port 8551 with the same JWT secret file.

Worked example

Which port for the application?

A web3.js script is configured with http://localhost:8551 and fails with authentication errors. What should it use?

Port 8551 is the Engine API, which only the consensus client may use, with the JWT secret. Applications use the execution client's public JSON-RPC endpoint, by default http://localhost:8545, enabled in Geth with --http (and --ws for WebSocket on port 8546).

Check yourself

Which client serves the JSON-RPC API that web3.js uses, and on which default port?

Show answer

The execution client, such as Geth, on port 8545. The consensus client drives it through the Engine API on port 8551, which applications do not use.

Exam Tips

Remember for the exam

  • Execution clients run the EVM, keep state and serve JSON-RPC; consensus clients run proof of stake.
  • The Engine API (port 8551, JWT secret) connects the consensus client to the execution client.
  • Applications use JSON-RPC on port 8545, never the Engine API.
  • Client diversity reduces the risk of a single client bug harming the network.