Writing

Ethereum's Engine API: How Execution and Consensus Clients Communicate

Reading time: 3 minutes

When I started exploring Ethereum nodes, I had a question: if Geth handles transactions and Lighthouse handles consensus, how do these separate programs agree on the same blockchain?

The answer is the Engine API. It connects Ethereum’s execution and consensus clients so they can build, verify, and follow blocks together.

1. Why does Ethereum need two clients?

Since The Merge in September 2022, a full Ethereum node has needed two cooperating components:

  • Execution client (EL): Handles transactions, runs smart contracts, and maintains Ethereum’s account and contract state. Examples include Geth, Reth, and Nethermind.
  • Consensus client (CL): Follows the Beacon Chain, processes blocks and attestations, and tracks the chain’s head and finality. Examples include Lighthouse, Prysm, and Grandine.

Think of them as a chef and a restaurant manager. The chef prepares the food; the manager decides which orders to handle and coordinates the service. They have different jobs, but they need to communicate.

2. What is the Engine API?

The Engine API is an authenticated JSON-RPC interface between the two clients. The execution client typically exposes it on port 8551, and the consensus client connects using a shared JWT secret.

This is an internal connection, separate from the public JSON-RPC endpoint your wallet uses. It should not be exposed to the internet.

graph LR
    A[Wallet or dApp] -->|Public JSON-RPC| B[Execution client]
    C[Consensus client] <-->|Engine API + JWT| B
    B <-->|Execution network| D[Execution peers]
    C <-->|Consensus network| E[Consensus peers]

3. Three Engine API methods to understand

Method What it does
engine_forkchoiceUpdated Tells the execution client which blocks are the current head, safe block, and finalized block. It can also request preparation of a new block.
engine_getPayload Retrieves a block payload the execution client has prepared for a proposal.
engine_newPayload Sends a received execution payload to the execution client for validation and execution.

These are method families. Actual calls have version suffixes, such as V3, and the version depends on the active Ethereum upgrade. Other methods handle capabilities, blob data, and payload bodies.

The execution client can return statuses such as VALID, INVALID, or SYNCING. A syncing response isn’t the same as a confirmed valid block.

4. How a block moves between the clients

For a locally built block, the simplified proposal flow looks like this:

  1. The consensus client decides which chain head to follow and calls forkchoiceUpdated. If the node is preparing a proposal, it includes instructions to start building a block.
  2. The execution client selects and executes transactions, then returns a payloadId for the build process.
  3. The consensus client calls getPayload to retrieve the prepared execution payload. The assigned validator signs and broadcasts the Beacon block.
  4. Other nodes receive the block. Their consensus clients call newPayload so their execution clients can validate its transactions and resulting state.

The consensus client then uses the execution result alongside its own consensus checks. These steps don’t always happen at fixed seconds within a slot, and not every node proposes a block.

5. Where does MEV-Boost fit?

A proposer can build a block locally through its execution client or use external block builders through MEV-Boost.

MEV-Boost communicates with relays through the Builder API to obtain builder bids and retrieve a selected block. It’s a separate path for sourcing blocks, not a replacement for the Engine API. The node still needs its execution and consensus clients to communicate and validate execution data.

6. Connecting Geth and Lighthouse

Both programs must use the same JWT secret. Here’s the basic idea, with a private path you choose for the secret:

# Generate the secret once
mkdir -p "$HOME/ethereum"
openssl rand -hex 32 > "$HOME/ethereum/jwt.hex"
chmod 600 "$HOME/ethereum/jwt.hex"

# Terminal 1: execution client
geth --mainnet \
  --authrpc.addr 127.0.0.1 \
  --authrpc.port 8551 \
  --authrpc.jwtsecret "$HOME/ethereum/jwt.hex"

# Terminal 2: consensus client
lighthouse bn --network mainnet \
  --execution-endpoint http://127.0.0.1:8551 \
  --execution-jwt "$HOME/ethereum/jwt.hex"

Check the current client documentation for installation, syncing, and any additional configuration before using this setup. A mismatched JWT, wrong port, or an unsynced client can prevent the two from working together.

What I learned

The Engine API helped me understand how Ethereum can have multiple independent client implementations without combining execution and consensus into one program.

It’s also a reminder that correct communication matters as much as correct execution. Both clients need to agree on the chain head, validate new payloads, and support the API versions required by the active network upgrade.

Further reading

Originally published on HackMD . Comments and discussion live there.