# offchainlabs/prysm architecture

> Architecture diagram of the GitHub repository offchainlabs/prysm, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/offchainlabs/prysm
- Repository: https://github.com/offchainlabs/prysm

## Overview

Prysm is a Go implementation of Ethereum consensus, with beacon-node and validator runtimes. A beacon node processes consensus data, coordinates fork choice and execution, and exposes node APIs; validator services manage signing keys and interact with beacon nodes. The tree also shows peer networking, persistence, light-client, slasher, and monitoring subsystems. The supplied excerpts establish some execution-engine, runtime, and key-manager behavior, but not most wiring; unverified relationships are omitted rather than inferred.

Main entry points: [`cmd/beacon-chain/main.go`](https://github.com/offchainlabs/prysm/blob/develop/cmd/beacon-chain/main.go) (Beacon runtime), [`validator/accounts/cli_manager.go`](https://github.com/offchainlabs/prysm/blob/develop/validator/accounts/cli_manager.go) (Account management), [`validator/keymanager/remote-web3signer/keymanager.go`](https://github.com/offchainlabs/prysm/blob/develop/validator/keymanager/remote-web3signer/keymanager.go) (Remote signer), [`validator/rpc/handlers_keymanager.go`](https://github.com/offchainlabs/prysm/blob/develop/validator/rpc/handlers_keymanager.go) (Validator key API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_node["Beacon node"]
  node_beacon_main["Beacon runtime<br/>[main.go]"]
  node_node_service["Node lifecycle"]
  node_sync_service["Synchronization<br/>[service.go]"]
end

subgraph group_consensus["Consensus processing"]
  node_blockchain["Chain processing"]
  node_forkchoice["Fork choice"]
  node_transitions["State transitions"]
  node_consensus_rules["Consensus operations"]
  node_execution_coord["Execution coordination"]
  node_execution_service["Execution client service<br/>[engine_client.go]"]
  node_execution_rpc["Engine JSON-RPC<br/>[engine_jsonrpc.go]"]
  node_builder["Block builder<br/>[service.go]"]
end

subgraph group_interfaces["Networking and APIs"]
  node_p2p["Peer networking"]
  node_beacon_api["Beacon APIs<br/>[handlers.go]"]
  node_ssz_api["SSZ query API<br/>[ssz_query.go]"]
end

subgraph group_validator["Validator services"]
  node_validator_main["Validator runtime<br/>[main.go]"]
  node_accounts["Account management<br/>[cli_manager.go]"]
  node_local_keys["Local key manager<br/>[keymanager.go]"]
  node_remote_keys["Remote signer<br/>[keymanager.go]"]
  node_validator_api["Validator key API"]
  node_slasher["Slasher<br/>[service.go]"]
end

subgraph group_state["State and persistence"]
  node_database[("Beacon database")]
  node_genesis[("Genesis state<br/>[storage.go]")]
  node_light_client["Light client<br/>[lightclient.go]"]
end

node_operator(("Node operator"))
node_execution_layer(("Execution client"))
node_signer(("Web3Signer"))

node_operator -.->|"starts node"| node_beacon_main
node_beacon_main -->|"starts runtime"| node_node_service
node_beacon_main -->|"wires builder"| node_builder
node_beacon_main -->|"wires sync"| node_sync_service
node_blockchain -->|"calls execution"| node_execution_service
node_execution_service -.->|"implements RPC"| node_execution_rpc
node_execution_rpc -.->|"sends requests"| node_execution_layer
node_beacon_main -->|"wires chain"| node_blockchain
node_operator -.->|"starts validator"| node_validator_main
node_validator_main -.->|"loads accounts"| node_accounts
node_accounts -->|"uses key manager"| node_local_keys
node_accounts -.->|"uses key manager"| node_remote_keys
node_validator_api -.->|"manages keys"| node_local_keys
node_validator_api -.->|"manages keys"| node_remote_keys
node_remote_keys -.->|"signs remotely"| node_signer
node_beacon_main -.->|"exposes APIs"| node_beacon_api
node_beacon_main -.->|"exposes query"| node_ssz_api

click node_beacon_main "https://github.com/offchainlabs/prysm/blob/develop/cmd/beacon-chain/main.go"
click node_node_service "https://github.com/offchainlabs/prysm/tree/develop/beacon-chain/node"
click node_blockchain "https://github.com/offchainlabs/prysm/tree/develop/beacon-chain/blockchain"
click node_forkchoice "https://github.com/offchainlabs/prysm/tree/develop/beacon-chain/forkchoice/doubly-linked-tree"
click node_transitions "https://github.com/offchainlabs/prysm/tree/develop/beacon-chain/core/transition"
click node_consensus_rules "https://github.com/offchainlabs/prysm/tree/develop/beacon-chain/core"
click node_execution_coord "https://github.com/offchainlabs/prysm/blob/develop/beacon-chain/blockchain/execution_engine.go"
click node_execution_service "https://github.com/offchainlabs/prysm/blob/develop/beacon-chain/execution/engine_client.go"
click node_execution_rpc "https://github.com/offchainlabs/prysm/blob/develop/beacon-chain/execution/engine_jsonrpc.go"
click node_builder "https://github.com/offchainlabs/prysm/blob/develop/beacon-chain/builder/service.go"
click node_p2p "https://github.com/offchainlabs/prysm/tree/develop/beacon-chain/p2p"
click node_beacon_api "https://github.com/offchainlabs/prysm/blob/develop/beacon-chain/rpc/eth/beacon/handlers.go"
click node_ssz_api "https://github.com/offchainlabs/prysm/blob/develop/beacon-chain/rpc/prysm/beacon/ssz_query.go"
click node_database "https://github.com/offchainlabs/prysm/tree/develop/beacon-chain/db/kv"
click node_genesis "https://github.com/offchainlabs/prysm/blob/develop/genesis/storage.go"
click node_light_client "https://github.com/offchainlabs/prysm/blob/develop/beacon-chain/light-client/lightclient.go"
click node_sync_service "https://github.com/offchainlabs/prysm/blob/develop/beacon-chain/sync/service.go"
click node_validator_main "https://github.com/offchainlabs/prysm/blob/develop/cmd/validator/main.go"
click node_accounts "https://github.com/offchainlabs/prysm/blob/develop/validator/accounts/cli_manager.go"
click node_local_keys "https://github.com/offchainlabs/prysm/blob/develop/validator/keymanager/local/keymanager.go"
click node_remote_keys "https://github.com/offchainlabs/prysm/blob/develop/validator/keymanager/remote-web3signer/keymanager.go"
click node_validator_api "https://github.com/offchainlabs/prysm/blob/develop/validator/rpc/handlers_keymanager.go"
click node_slasher "https://github.com/offchainlabs/prysm/blob/develop/beacon-chain/slasher/service.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_beacon_main,node_node_service,node_sync_service,node_execution_layer toneBlue
class node_blockchain,node_forkchoice,node_transitions,node_consensus_rules,node_execution_coord,node_execution_service,node_execution_rpc,node_builder toneAmber
class node_p2p,node_beacon_api,node_ssz_api toneMint
class node_validator_main,node_accounts,node_local_keys,node_remote_keys,node_validator_api,node_slasher toneRose
class node_database,node_genesis,node_light_client,node_operator,node_signer toneIndigo
```

## Components

### Beacon node

- [Beacon runtime](https://github.com/offchainlabs/prysm/blob/develop/cmd/beacon-chain/main.go): `cmd/beacon-chain/main.go`
- [Node lifecycle](https://github.com/offchainlabs/prysm/tree/develop/beacon-chain/node): `beacon-chain/node`
- [Synchronization](https://github.com/offchainlabs/prysm/blob/develop/beacon-chain/sync/service.go): `beacon-chain/sync/service.go`

### Consensus processing

- [Chain processing](https://github.com/offchainlabs/prysm/tree/develop/beacon-chain/blockchain): `beacon-chain/blockchain`
- [Fork choice](https://github.com/offchainlabs/prysm/tree/develop/beacon-chain/forkchoice/doubly-linked-tree): `beacon-chain/forkchoice/doubly-linked-tree`
- [State transitions](https://github.com/offchainlabs/prysm/tree/develop/beacon-chain/core/transition): `beacon-chain/core/transition`
- [Consensus operations](https://github.com/offchainlabs/prysm/tree/develop/beacon-chain/core): `beacon-chain/core`
- [Execution coordination](https://github.com/offchainlabs/prysm/blob/develop/beacon-chain/blockchain/execution_engine.go): `beacon-chain/blockchain/execution_engine.go`
- [Execution client service](https://github.com/offchainlabs/prysm/blob/develop/beacon-chain/execution/engine_client.go): `beacon-chain/execution/engine_client.go`
- [Engine JSON-RPC](https://github.com/offchainlabs/prysm/blob/develop/beacon-chain/execution/engine_jsonrpc.go): `beacon-chain/execution/engine_jsonrpc.go`
- [Block builder](https://github.com/offchainlabs/prysm/blob/develop/beacon-chain/builder/service.go): `beacon-chain/builder/service.go`

### Networking and APIs

- [Peer networking](https://github.com/offchainlabs/prysm/tree/develop/beacon-chain/p2p): `beacon-chain/p2p`
- [Beacon APIs](https://github.com/offchainlabs/prysm/blob/develop/beacon-chain/rpc/eth/beacon/handlers.go): `beacon-chain/rpc/eth/beacon/handlers.go`
- [SSZ query API](https://github.com/offchainlabs/prysm/blob/develop/beacon-chain/rpc/prysm/beacon/ssz_query.go): `beacon-chain/rpc/prysm/beacon/ssz_query.go`

### Validator services

- [Validator runtime](https://github.com/offchainlabs/prysm/blob/develop/cmd/validator/main.go): `cmd/validator/main.go`
- [Account management](https://github.com/offchainlabs/prysm/blob/develop/validator/accounts/cli_manager.go): `validator/accounts/cli_manager.go`
- [Local key manager](https://github.com/offchainlabs/prysm/blob/develop/validator/keymanager/local/keymanager.go): `validator/keymanager/local/keymanager.go`
- [Remote signer](https://github.com/offchainlabs/prysm/blob/develop/validator/keymanager/remote-web3signer/keymanager.go): `validator/keymanager/remote-web3signer/keymanager.go`
- [Validator key API](https://github.com/offchainlabs/prysm/blob/develop/validator/rpc/handlers_keymanager.go): `validator/rpc/handlers_keymanager.go`
- [Slasher](https://github.com/offchainlabs/prysm/blob/develop/beacon-chain/slasher/service.go): `beacon-chain/slasher/service.go`

### State and persistence

- [Beacon database](https://github.com/offchainlabs/prysm/tree/develop/beacon-chain/db/kv): `beacon-chain/db/kv`
- [Genesis state](https://github.com/offchainlabs/prysm/blob/develop/genesis/storage.go): `genesis/storage.go`
- [Light client](https://github.com/offchainlabs/prysm/blob/develop/beacon-chain/light-client/lightclient.go): `beacon-chain/light-client/lightclient.go`

### Other components

- **Node operator**
- **Execution client**
- **Web3Signer**

## Connections

- Node operator → Beacon runtime: starts node
- Beacon runtime → Node lifecycle: starts runtime (evidence: `cmd/beacon-chain/main.go`)
- Beacon runtime → Block builder: wires builder (evidence: `cmd/beacon-chain/main.go`)
- Beacon runtime → Synchronization: wires sync (evidence: `cmd/beacon-chain/main.go`)
- Chain processing → Execution client service: calls execution (evidence: `beacon-chain/blockchain/execution_engine.go`)
- Execution client service → Engine JSON-RPC: implements RPC
- Engine JSON-RPC → Execution client: sends requests
- Beacon runtime → Chain processing: wires chain (evidence: `cmd/beacon-chain/main.go`)
- Node operator → Validator runtime: starts validator
- Validator runtime → Account management: loads accounts
- Account management → Local key manager: uses key manager (evidence: `validator/accounts/cli_manager.go`)
- Account management → Remote signer: uses key manager
- Validator key API → Local key manager: manages keys
- Validator key API → Remote signer: manages keys
- Remote signer → Web3Signer: signs remotely
- Beacon runtime → Beacon APIs: exposes APIs
- Beacon runtime → SSZ query API: exposes query
