Skip to main content

Overview

Epoch represents a consensus layer epoch in Ethereum’s proof-of-stake system. Each epoch contains 32 slots (6.4 minutes) and serves as the fundamental period for validator duties, finality, and checkpoint organization. Type: bigint & { readonly [brand]: "Epoch" }

Key Concepts

  • Duration: 32 slots = 6.4 minutes per epoch
  • Finality: Two consecutive epochs must pass for finality
  • Validator committees: Reshuffled every epoch
  • Rewards: Calculated and distributed per epoch

Methods

Epoch.from(value)

Create Epoch from number, bigint, or string.

Epoch.toNumber(epoch)

Convert Epoch to number. Throws if exceeds MAX_SAFE_INTEGER.

Epoch.toBigInt(epoch)

Convert Epoch to bigint.

Epoch.equals(a, b)

Check if two epochs are equal.

Epoch.toSlot(epoch)

Convert epoch to the first slot of that epoch (epoch * 32).

Usage Examples

Calculate epoch timing

Work with finality

Convert between slots and epochs

References