MCPcopy Index your code
hub / github.com/berachain/beacon-kit

github.com/berachain/beacon-kit @v1.4.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.4.1 ↗ · + Follow
4,348 symbols 19,268 edges 668 files 2,703 documented · 62%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

beacon-kit-banner

Berachain's Consensus Client

CI status Deps status CodeCov Telegram Chat X Follow Discord

What is BeaconKit?

BeaconKit is Berachain's consensus client. It implements the Ethereum consensus layer specification with Berachain-specific modifications, using a modified CometBFT for consensus instead of Ethereum's standard beacon chain consensus.

Berachain is a high-performance L1 blockchain powered by Proof of Liquidity (PoL), an incentive mechanism that aligns validators, protocols, and users through its three-token system (BERA, BGT, HONEY).

BeaconKit communicates with Bera-Reth (the execution client) via the standard Engine API, forming the two-client architecture used by Berachain nodes.

Key Differences from Ethereum

  • CometBFT Consensus — Uses timeout-based rounds instead of fixed 12-second slots. If a proposer fails, a new round starts at the same height with a different proposer.
  • Single-Slot Finality — Blocks are finalized immediately when 2/3+ validators commit, unlike Ethereum's ~13-minute finalization through Casper FFG checkpoints.
  • No Missed Slots — Block heights are strictly sequential with no gaps. Every height eventually produces a block through round-based consensus.
  • No Attestations or Committees — Consensus is driven by CometBFT's validator voting (prevotes/precommits) rather than Ethereum's attestation committees and sync committees.
  • Capped Validator Set — The active validator set is capped (currently 69 validators) rather than being open-ended.
  • EVM Inflation Withdrawal — Every block includes a mandatory EVM inflation withdrawal as its first withdrawal, a Berachain-specific economic mechanism.

Networks

Network Chain ID Description
Mainnet 80094 Production network
Bepolia 80069 Public testnet
Devnet 80087 Local development

Network configurations are stored in testing/networks/<chain-id>/.

Execution Client

BeaconKit requires Bera-Reth, a Berachain-specific fork of Reth. Communication happens over the Engine API with JWT authentication.

Quick Start

Prerequisites

Open two terminals side by side.

Terminal 1 — Start the consensus client:

make start

Terminal 2 — Start the execution client (after beacond is running, since make start generates the execution genesis file):

make start-reth

The devnet runs with chain ID 80087. The following dev account is preloaded with the native token:

Address:     0x20f33ce90a13a4b5e7697e3544c3083b8f8a51d4
Private Key: 0xfffdbb37105441e14b0ee6330d855d8504ff39e705c3afa8f859ac9865f99306

Multinode Devnet (Kurtosis)

For running a multinode local devnet using Kurtosis:

make start-devnet

See the Kurtosis README for full details on configuration and usage.

Project Structure

beacon/              Core beacon chain logic (blockchain service, validator service)
chain/               Chain specifications and network configs
cli/                 CLI commands and configuration
config/              Configuration templates (TOML)
consensus-types/     Consensus layer types (blocks, states, validators, SSZ)
contracts/           Solidity contracts (deposit contract, staking)
da/                  Data availability (blob management, KZG commitments)
engine-primitives/   Execution engine types (Engine API types, payloads)
execution/           Execution client integration (Engine API client, deposit syncing)
kurtosis/            Kurtosis multinode devnet deployment
node-api/            REST API implementation (beacon API handlers)
node-core/           Core infrastructure (dependency injection, service registry)
primitives/          Basic types and constants (Slot, Gwei, ValidatorIndex)
state-transition/    State transition logic (state machine, fork transitions)
storage/             Database backends (block store, blob store, beacon DB)
testing/             Test utilities, network configs, e2e and simulation tests

Development

Building

make build                # Build beacond binary to build/bin/beacond
make install              # Install beacond to $GOPATH/bin
make build-docker         # Build Docker image

Testing

make test                 # Run all tests (unit + forge)
make test-unit            # Run unit tests with coverage
make test-unit-bench      # Run benchmarks
make test-unit-fuzz       # Run Go fuzz tests
make test-simulated       # Run simulation tests
make test-e2e             # Run e2e tests (builds Docker image first)
make test-forge-cover     # Run Solidity tests with coverage

Linting & Formatting

make lint                 # Run all linters
make format               # Run all formatters
make golangci-fix         # Auto-fix Go linting issues
make gosec                # Run security scanner
make nilaway              # Run nil pointer checker
make vulncheck            # Run govulncheck vulnerability scanner

Code Generation

make generate             # Run all code generation
make proto                # Generate protobuf code
make generate-check       # Verify generated code is up to date

Documentation

License

BeaconKit is licensed under BUSL-1.1.

Extension points exported contracts — how you extend this code

TxData (Interface)
TxData is the underlying data of a transaction. [6 implementers]
gethlib/types/transaction.go
DB (Interface)
DB is the interface for a simple key-value store. [7 implementers]
storage/interfaces/db.go
AppOptions (Interface)
AppOptions, usually implemented by Viper, holds the configuration for the application. [9 implementers]
cli/commands/server/types/types.go
Node (Interface)
Node defines the API for the node application. It extends the Application interface from the Cosmos SDK. [23 implementers]
node-core/types/node.go
Basic (Interface)
Basic is the minimal interface for a service. [13 implementers]
node-core/services/registry/registry.go
BeaconStateMarshallable (Interface)
BeaconStateMarshallable is the interface for a beacon state that can be marshalled or hash tree rooted. [11 implementers]
node-api/handlers/proof/types/interfaces.go
SSZMarshaler (Interface)
SSZMarshaler is an interface for objects that can be marshaled to SSZ format. [24 implementers]
primitives/constraints/ssz.go
SSZUnmarshaler (Interface)
SSZUnmarshaler is an interface for objects that can be unmarshaled from SSZ format. [22 implementers]
primitives/common/interfaces.go

Core symbols most depended-on inside this repo

Equal
called by 844
gethlib/types/transaction_signing.go
New
called by 462
node-core/components/interfaces.go
Get
called by 197
storage/interfaces/db.go
Error
called by 190
log/mod.go
Len
called by 168
gethlib/types/transaction.go
Unwrap
called by 122
primitives/math/u64.go
Info
called by 111
log/mod.go
Run
called by 109
primitives/crypto/mocks/bls_signer.mock.go

Shape

Method 2,428
Function 1,224
Struct 499
Interface 142
TypeAlias 45
FuncType 10

Languages

Go100%

Modules by API surface

node-core/components/interfaces.go151 symbols
chain/spec.go109 symbols
gethlib/types/tx_types.go88 symbols
gethlib/deposit/contract.abigen.go81 symbols
node-core/types/mocks/consensus_service.mock.go52 symbols
consensus-types/types/mocks/new_payload_request.mock.go46 symbols
testing/e2e/standard/beacon_api_test.go42 symbols
node-api/handlers/beacon/mocks/backend.mock.go40 symbols
gethlib/types/transaction.go40 symbols
beacon/blockchain/interfaces.go40 symbols
consensus-types/types/validator.go36 symbols
consensus-types/types/body.go35 symbols

For agents

$ claude mcp add beacon-kit \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact